|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /var/www/html/pathumthani_eoffice/application/bin/meetingroom_bk/ |
Upload File : |
<?php
header('Content-Type: text/plain; charset=utf-8');
include("../../config/config.inc.php");
$qu=$_GET['qu'];
$id=$_GET['id'];
$aa=$_GET['aa'];
$sql="select cost_request,cost_paid from meeting_reserve where refid='$id'";
$query=mysql_query($sql);
if($qu=="show"){
?>
<?php
list($cost_request,$cost_paid)=mysql_fetch_row($query);
echo'<br /><strong>ค่าใข้จ่าย</strong> ',$cost_request,' บาท<br /><br /><strong>จ่ายไปแล้ว</strong> ',$cost_paid,' บาท<br /><br />';
?>
<strong>ค้างจ่าย</strong> <input type="text" id="abc" value="<?php echo $cost_request-$cost_paid; ?>" style="width:50px;" /> <input type="button" value="บันทึก" onclick="updateCost(<?php echo 'this,\'',$id,'\',\'',$aa,'\',\'',$cost_request-$cost_paid,'\''; ?>)" /><br />
<?php
}else if($qu=="update"){
list($cost_request,$cost_paid)=mysql_fetch_row($query);
$repaid=$_GET['repaid']+$cost_paid;
$date=date("Y-m-d");
$sql2="update meeting_reserve set cost_paid='$repaid',date_paid='$date' where refid='$id'";
mysql_query($sql2);
if(($cost_request-$repaid)>0){
$command_but="<input type=\"button\" value=\"ชำระเงิน\" onclick=\"displayCommand(this,'".$id."','".$aa."')\" />";
}else{
$command_but="<span style=\"width:60px;height:20px;background-color:#D6D6D6;color:#EEEEEE;border:#C8C1C6 solid 1px;text-align:center;\">ชำระแล้ว</span> ";
}
echo $aa,'.00 บาท/วัน ',$command_but;
}
?>