|
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/event_calendar/ |
Upload File : |
<?php
include("../../config/config.inc.php");
$id=$_GET['id'];
$xdate=$_GET['xdate'];
$xtimeStart=$_GET['xtimeStart'];
$xtimeEnd=$_GET['xtimeEnd'];
$sql=" SELECT count(function_mgr.id) as n_count ";
$sql.="FROM function_mgr ";
$sql.=" WHERE function_mgr.staffid='$id' AND function_mgr.edate='$xdate'";
$sql.=" AND(";
$sql.=" (( '$xtimeStart' >= function_mgr.stime and '$xtimeStart' < function_mgr.etime) or ('$xtimeEnd' >= function_mgr.stime and '$xtimeEnd' < function_mgr.etime)";
$sql.=" )OR";
$sql.=" ((function_mgr.stime >= '$xtimeStart' and function_mgr.stime < '$xtimeEnd' ) AND ( function_mgr.etime >= '$xtimeStart' and function_mgr.etime < '$xtimeEnd')";
$sql.=" )) ";
$result= mysql_query($sql)or die("ERROR:Query line ". __LINE__ ." Error <hr>".mysql_error()); ;
$rs = mysql_fetch_assoc($result);
$str="";
if($rs){
$str="OK:".$rs['n_count'] ;
}else{
$str="OK:0";
}
// $str="ERROR:".$sql;
echo $str;
?>