|
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/public/ |
Upload File : |
<?
header ("Content-Type: text/html; charset=tis-620");
include("../chk_permission.php");
include("../../../config/config.inc.php");
include("../libary/function.php");
echo'<link href="style_detail.css" rel="stylesheet" type="text/css">';
$arr_month = array('','มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม');
function show_xdat($intD){
switch ($intD) {
case 0:
$shday= "วันอาทิตย์ ";
return $shday;
break;
case 1:
$shday= "วันจันทร์ ";
return $shday;
break;
case 2:
$shday= "วันอังคาร ";
return $shday;
break;
case 3:
$shday= "วันพุธ ";
return $shday;
break;
case 4:
$shday= "วันพฤหัสบดี ";
return $shday;
break;
case 5:
$shday= "วันศุกร์ ";
return $shday;
break;
case 6:
$shday= "วันเสาร์ ";
return $shday;
break;
}
}
if(isset($_GET['action'])){$limit= $_GET['action']; } else{$limit= "" ;}
if(isset($_GET['edate'])){$edate= $_GET['edate']; } else{$edate= "" ;}
$arr_d=explode("-",$edate);
if(count($arr_d)>0){
$show_yeng = trim($arr_d[0]);
$show_yth = $arr_d[0]+543;
$show_m = trim($arr_d[1]);
$show_d = trim($arr_d[2]);
$show_date = intval($show_d)." เดือน " .$arr_month[ intval($show_m)]." พ.ศ. $show_yth ";
$conedate = "$show_yeng-$show_m-$show_d";
if ($limit=='limit'){
$limituser="LIMIT 0,3";
$limitdetail="LIMIT 0,2";
}
echo"<div class='contaner'><br>";
echo"<div class='texttead'>ปฏิทิน นัดหมายผู้บริหารวันที่ $show_date </div>";
$sqlhead="SELECT distinct epm_staff.staffid ,epm_staff.prename, epm_staff.staffname, epm_staff.staffsurname ,epm_staff.title ,emp_staff_priority.indexid
FROM epm_staff INNER JOIN function_mgr ON (epm_staff.staffid = function_mgr.staffid)
INNER JOIN emp_staff_priority ON (epm_staff.staffid = emp_staff_priority.staffid)
WHERE (function_mgr.edate ='$conedate')ORDER BY emp_staff_priority.indexid ASC ".$limituser;
$result_h = mysql_query($sqlhead)or die("Query line " . __LINE__ . " Error<hr>".mysql_error());
while($rs_h = mysql_fetch_assoc($result_h)){
echo"<ul>$rs_h[title] ";
$sqldetail=" SELECT function_mgr.stime, function_mgr.etime , function_mgr.event_name
FROM epm_staff INNER JOIN function_mgr ON (epm_staff.staffid = function_mgr.staffid)
WHERE (function_mgr.edate ='$conedate') and (epm_staff.staffid='$rs_h[staffid]')
ORDER BY function_mgr.etime ASC ". $limitdetail;
$result_detail = mysql_query($sqldetail)or die("Query line " . __LINE__ . " Error<hr>".mysql_error());
while($rs_detail = mysql_fetch_assoc($result_detail)){
echo"<li> $rs_detail[stime] - $rs_detail[etime] งาน $rs_detail[event_name] </li>";
}
mysql_free_result($result_detail);
echo"</ul>";
}
mysql_free_result($result_h );
if ($limit=='limit'){
echo"<br><br><div class=\"showall\"><a href=\"#\" onclick=\"showall('$conedate')\">ดูทั้งหมด</a><div>";
}
echo"</div>";
}
else {echo"error";}
?>
<title>ปฏิทิน นัดหมายผู้บริหาร</title>