| Server IP : 61.19.30.66 / Your IP : 216.73.216.80 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /var/www/cooperative/ |
Upload File : |
<?
require_once "config/confiteacher.inc.php";
?>
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=tis-620">
<title></title>
</head>
<body>
<script language="javascript">
function fncSubmit()
{
if(document.frmMain.cash.value == "")
{
alert('ระบุเงินที่จ่าย');
document.frmMain.cash.focus();
return false;
}
document.form1.submit();
}
</script>
<?
$teach=$objResult[teachcode];
$time = date("H:i:s");
$signup = (date("Y")+543).date("/n/j") ;
$bill = $time.$signup.$teach;
$year=date(" Y ")+542;
//*** Update Condition ***//
if($_GET["Action"] == "Save")
{
for($i=1;$i<=$_POST["hdnLine"];$i++)
{
$strSQL = "UPDATE paybill SET ";
$strSQL .="totalpay = '".$_POST["txtpricsell$i"]."' ";
$strSQL .="WHERE idpaybill = '".$_POST["hdnid$i"]."' ";
$objQuery = mysql_query($strSQL);
}
//header("location:$_SERVER[PHP_SELF]");
//exit();
}
$strSQL = "select * from paybill
where totalpay='' and usersellbill=$teach";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$i = 1;
?>
<form name="frmMain" method="post" action="bacodesavebill.php?Action=Save" onSubmit="JavaScript:return fncSubmit();">
<table width="100%" border="0" bgcolor="#999999">
<center><font size='+1' color='red'>บิลรับเงิน</font>
<input type="text" name="txtbill" style="font-size:20px;" maxlength="10" value="<? echo $bill?>" ></center>
<tr bgcolor="#FFFFFF">
<th width="10"> <div align="center"></div></th>
<th width="10"> <div align="center">#</div></th>
<th width="80%"> <div align="center"><font size="+4">รายการ</font></div></th>
<th width="10%"> <div align="center"><font size="+4">จำนวน</font></div></th>
<th width="20%"> <div align="center"><font size="+4">ราคา+ค่าบริการ</font></div></th>
<th width="80"> <div align="center"><font size="+4">ลบ</font></div></th>
</tr>
<?
$i =0;
while($objResult = mysql_fetch_array($objQuery))
{
if($bg == "#EEEEEE") { //ส่วนของการ สลับสี
$bg = "#FFFFFF";
} else {
$bg = "#EEEEEE";
}
$i = $i + 1;
$idsell =$objResult["idpaybill"];
$idcodesell =$objResult["idcodin"];
$pricsellstoc =$objResult["monypay"];
$unitsell =$objResult["unitsell"];
$bacode =$objResult["bacodpay"];
$sereail =$objResult["sereail"];
$pric =$objResult["monypay"];
$pricsum+=$pric+10;
$pricsum20+=$pric+20;
?>
<tr bgcolor="<?=$bg?>">
<td><div align="center">
<input type="hidden" name="hdnid<?=$i;?>" size="5" value="<?=$objResult["idpaybill"];?>">
<td><font size="+5"><?=$i?></font></td>
<td><div align="right"><font size="+2">รหัส <? echo $bacode?></font>
</div></td>
<td><font size="+5"><? echo $pric?></font></td>
<td><input type="text" name="txtpricsell<?=$i;?>" style="font-size:40px;" maxlength="10" value="
<? if($pric < 5001)
{
echo "$pricsum";
}
else if($pric > 5000)
{
echo "$pricsum20";
}
?>
" >
</td>
<td> <a href=delbill.php?id=<? echo "$idsell"; ?> onClick="return confirm ('คุณต้องการลบข้อมูลนี้? ')"><img src=images/delete.png width=40 height=40 border=0 alt=ลบข้อมูล></td>
</tr>
<?
$i = $i;
}
?>
<tr bgcolor="#FFFFFF">
<th width="10"> <div align="center"></div></th>
<th width="10"> <div align="center">#</div></th>
<th width="100"> <div align="center"><font size="+5">รหัสลูกค้า<input type="text" name="card" style="font-size:20px;" maxlength="10" value=''/></font></div></th>
<th width="100"> <div align="center"><font size="+5">ระบุเงินจ่าย<input type="text" name="cash" style="font-size:40px;" maxlength="10" onKeyUp="if(isNaN(this.value)){ alert('เฉพาะตัวเลข'); this.value='';}" /></font></div></th>
<th width="100"> <div align="center"><font size="+5">รวม</font></div></th>
<th width="50"> <div align="center"><font size="+5">
<input type="text" name="sumtotalall" style="font-size:40px;" value="
<? if($pric < 5001)
{
echo "$pricsum";
}
else if($pric > 5000)
{
echo "$pricsum20";
}
?>
" >
</th>
<th width="100"> <div align="center"><font size="+5"></font></div></th>
</tr>
</table><center>
<input type="image" name="submit" src='images/pay.gif' width="400" height="200">
<input type="hidden" name="hdnLine" value="<?=$i;?>">
</form>
</body>
</html>