|
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 : |
<?
//include("chk_permission.php");
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
################ HARD FIX
#$_SESSION[session_staffid] = 49 ;
################
/*
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 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);
return $rx[staffname];
}
# Check ตั้งค่าแสดงผล Columb
$sql_setting_list="
select * from reserve_setting;
";
$result = mysql_query($sql_setting_list)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
while($srs = mysql_fetch_assoc($result)){
$c_select[$srs [colump]]=$srs [status];
}
?>
<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" >
//==================================================
// 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">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE" >
<tr>
<td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#666666">
<tr align="center" bgcolor="#466A8E" class="headerTB_white" >
<td height="20" colspan="6" ><strong>รายการใช้งานห้องประชุม</strong></td>
</tr>
<tr align="center" bgcolor="#466A8E" class="headerTB_white" >
<? if($c_select['c1'] || $c_select['std'] ==1 ){ ?>
<td height="20" >วัน</td>
<? }?>
<? if($c_select['c2'] || $c_select['std'] ==1 ){ ?>
<td height="20">เวลา</td>
<? }?>
<? if($c_select['c3'] || $c_select['std'] ==1 ){ ?>
<td height="20" >ห้อง</td>
<? }?>
<? if($c_select['c5'] || $c_select['std'] ==1 ){ ?>
<td height="20" >หัวข้อการประชุม</td>
<? }?>
<? if($c_select['c4'] || $c_select['std'] ==1 ){ ?>
<td height="20">ประธานที่ประชุม</td>
<? }?>
<? if($c_select['c6'] || $c_select['std'] ==1 ){ ?>
<td height="20">จำนวนผู้เข้าร่วมประชุม</td>
<? }?>
</tr>
<?
if($_GET[all] != 1)
{
$sqlx = "SELECT * FROM meeting_reserve WHERE daterent >= CURDATE() ORDER BY daterent LIMIT 5";
}else
{
$sqlx = "SELECT * FROM meeting_reserve WHERE daterent >= CURDATE() ORDER BY daterent ";
}
$qx = mysql_query($sqlx) or die(mysql_error());
while($rx = mysql_fetch_assoc($qx)) {
if ($bgcolor1 == "DDDFFF"){ $bgcolor1 = "EFEFEF" ; } else {$bgcolor1 = "DDDFFF" ;}
?>
<tr valign="middle" bgcolor="#<?=$bgcolor1?>" height="25" >
<? if($c_select['c1'] || $c_select['std'] ==1 ){ ?>
<td align="center" >
<?php
$nextdatemysql2=explode("-",$rx[daterent]);
$iday = $nextdatemysql2[2];
$month = $nextdatemysql2[1];
$year = $nextdatemysql2[0];
$roomid = $rx[roomid];
$nextdatemysql2=array_reverse($nextdatemysql2);
$nextdatemysql2=implode("/",$nextdatemysql2);
$date = jump_daythai($nextdatemysql2);
?>
<?=$date?> </td>
<? }?>
<? if($c_select['c2'] || $c_select['std'] ==1 ){ ?>
<td align="center" >
<?
$str = substr($rx[time_start],0,5);?><? $str .= "-".substr($rx[time_end],0,5);
echo $str;
?></td>
<? }?>
<? if($c_select['c3'] || $c_select['std'] ==1 ){ ?>
<td align="left" >
<?
$ss = "SELECT * FROM meeting_room WHERE rid=$rx[roomid] ";
$qq = mysql_query($ss) or die(mysql_error());
if($rr = mysql_fetch_assoc($qq))
{
$str = $rr[rname];
}else
{
$str = "ไม่ระบุห้อง";
}
echo $str;
?> </td>
<? }?>
<? if($c_select['c5'] || $c_select['std'] ==1 ){ ?>
<td align="left" >
<?
$str = $rx[meeting_topic];
echo "<a href='#' onClick=\"popUpWindow('pop_detail.php?day=$iday&month=$month&year=$year&room_id=$roomid', 'SH1', 450, 180, 'yes') \">$str</a>";
?> </td>
<? }?>
<? if($c_select['c4'] || $c_select['std'] ==1 ){ ?>
<td align="left" >
<?
$str = $rx[meeting_chairman];
echo $str;
?> </td>
<? }?>
<? if($c_select['c6'] || $c_select['std'] ==1 ){ ?>
<td align="center" >
<?
$str = $rx[meeting_person];
echo $str;
?> </td>
<? }?>
</tr>
<? } ?>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<div align="right">
<?
if($_GET[all] != 1)
{
echo '<a href="?all=1" target="_blank">more</a></div>';
}
?>
</body>
</html>
<?
//insert timeQuery
$time_end = getmicrotime();
writetime2db($timestart,$timeend);
//insert timeQuery
?>