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/reserve_room_bk2.php
<?
//include("chk_permission.php");
session_start();
include("../../config/config.inc.php");
include("../../common/function.php");
include("var.inc.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>
<script type="text/javascript">
function noNumbers(e)
{
	var keynum;
	var keychar;
	var numcheck;
	
	if(window.event) // IE
		{
		keynum = e.keyCode;
		}
	else if(e.which) // Netscape/Firefox/Opera
		{
		keynum = e.which;
		}
	keychar = String.fromCharCode(keynum);
	numcheck = /\d/;
	return numcheck.test(keychar);
}
<?
				$sql = " SELECT  rid,rname,rdetail,rfloor,rsize,rrent,rper   FROM  meeting_room WHERE rid='$roomid'";
				$result = mysql_query($sql) ; 
				$rs = mysql_fetch_assoc($result);
				$rs_roomname =  $rs[rname] ;
				$rs_roomsize =  $rs[rsize] ;
				$rs_roomrfloor =  $rs[rfloor] ;				
				$rs_roomrrent =  $rs[rrent] ;				
				$rs_roomrper =  $rs[rper] ;												
?>
function checkForm() {
	missinginfo = "";
	missinginfo1 = "";
	var val = document.post.meeting_person.value;
	var xformhh1 = document.post.formhh1.value;
	var xformmm1 = document.post.formmm1.value;
	var xformhh2 = document.post.formhh2.value;
	var xformmm2 = document.post.formmm2.value;
	if (document.post.pdate.value == "")  {	missinginfo1 += "\n        -  วันที่ประชุม "; }
//	if ((xformhh1 >= xformhh2)  & (xformmm1 >= xformmm2)){missinginfo1 += "\n        -   เวลาสิ้นสุดการฝึกอบรมต้องมากกว่าเวลาเริ่มต้นการฝึกอบรม  "; }	

	if ((xformhh1 >  xformhh2) || ((xformhh1==  xformhh2) & (!(xformmm1 < xformmm2)))){
		missinginfo1 += "\n        -   เวลาสิ้นสุดการฝึกอบรมต้องมากกว่าเวลาเริ่มต้นการฝึกอบรม  "; 
//		missinginfo1 += "\n        -   (("+xformhh1+" > "+ xformhh2+" ) || (("+xformhh1+"==  "+xformhh2+") & (!("+xformmm1+" < "+xformmm2+"))))  "; 		
	}
//	if (xformhh1 >  xformhh2)	{ missinginfo1 += "\n        -   กรณีที่ 1  "; } 
//	if ((xformhh1==  xformhh2) & (!(xformmm1 <= xformmm2)))	{ missinginfo1 += "\n        -   กรณีที่ 2  "; } 
//alert(xformhh1 +" xxxxxx "+ xformhh2 );		

	if (document.post.meeting_chairman.value == "")  {	missinginfo1 += "\n        -  ประธานที่ประชุม  "; }
	if (document.post.meeting_topic.value == "")  {	missinginfo1 += "\n        -  หัวข้อการประชุม  "; }
	if (document.post.contactpoint.value == "")  {	missinginfo1 += "\n        -  ผู้ประสานงาน  "; }
	if (document.post.contactpointtel.value == "")  {	missinginfo1 += "\n        -  เบอร์โทรผู้ประสานงาน  "; }
	if (document.post.meeting_person.value == "")  {	missinginfo1 += "\n        -  จำนวนผู้เข้าร่วมประชุม  "; }
	if (document.post.meeting_person.value > <?=$rs_roomsize?>)  {	missinginfo1 += "\n        -  จำนวนผู้เข้าร่วมประชุมต้องไม่เกิน <?=$rs_roomsize?> คน"; }
	if (missinginfo1 != "") { 
		missinginfo += "ท่านกรอกข้อมูลผิดพลาดหรือไม่ถูกต้อง ดังนี้ \n";
		missinginfo +=" _____________________________\n";
		missinginfo = missinginfo + missinginfo1;
		missinginfo += "\n_____________________________";
		missinginfo += "\n               กรุณาตรวจสอบ ";
		alert(missinginfo);
		return false;
	} // if (missinginfo1 != "") { 
		
		return false;
		
			
//	if (val><?=$rs_roomsize?>) {
//		alert("จำนวนผู้เข้าร่วมประชุม มีมากกว่าจำนวนที่ห้องประชุมสามารถรองรับได้");
//		val.focus();
//		return false;
//	}else if (val==0) {
//		alert("กรอกจำนวนผู้เข้าร่วมประชุม");
//		val.focus();
//		return false;
//	}
//	else { return true; }
}
</script>
<style type=text/css>
BODY {OVERFLOW: scroll; OVERFLOW-X: hidden}
.DEK {POSITION: absolute; VISIBILITY: hidden; Z-INDEX: 200}
.style1 {color: #FF0000}
</style> 
</head>
<body topmargin="0">
<? 			 	
$title_label = "ระบบจองห้องประชุม";
include "header.php";   
include "menu_bar.php";  
include "../../common/tag_alt.txt";   
?>
<? 	
$table_var1 = " <br><table width='300' border='0' cellspacing='0' cellpadding='0' align='center'   ><tr>
                <td width='51'><img src='../../images/alert.gif'  width=31 height=32></td>
                <td width='349'  valign=middle align='center' > ";
$table_var2 = "  &nbsp;</td> </tr></table> <br>";		
	  
if ($save_reserve != "" AND $editid == ""){ 
	############################# while (list ($key, $val) = each ($_POST)) { echo " <br>  $key  ::::::::: $val  "; 	}
	$mysql_date = convert_2mysql($pdate) ;
	$time_start = $formhh1 .":". $formmm1 ; $frm_start 	= $time_start  ; 
	$time_end = $formhh2 .":". $formmm2 ; $frm_end = $time_end ; 
	#------------------------------------------------------------------------------------------------------------------------------------Start ตรวจสอบการจองห้องซ้ำ
	$sql = "  SELECT * FROM meeting_reserve WHERE 
		(('$frm_start'   BETWEEN  time_start  AND  time_end  AND ('$frm_start'   >time_end)) OR 
		('$frm_end'   BETWEEN  time_start  AND  time_end  AND ('$frm_end' >time_start))) 
		AND  daterent = '$mysql_date'  	 AND roomid = '$roomid'  "; 
		
	$result = mysql_query($sql) ; 
	if (@mysql_num_rows($result)){
		$rs = @mysql_fetch_assoc($result) ;
		$roomid = $frm_oldroomid ; 
		$echostr =  "$table_var1 <b>  ห้องที่เลือกในช่วงเวลา $time_start -  $time_end ไม่ว่าง  <br> กรุณาเลือกห้องหรือช่วงเวลาอีกครั้ง  </b>  $table_var2";
		$echostr = str_replace( ":0 ",":00 "  ,$echostr ) ; 
		$rs_meeting_chairman = $meeting_chairman ; 
		$rs_meeting_topic = $meeting_topic ; 
		$rs_contactpoint = $contactpoint ; 
		$rs_contactpointtel = $contactpointtel ; 
		$rs_meeting_person = $meeting_person ; 		
	}else{ 	
		$sql = " INSERT INTO meeting_reserve ( roomid,daterent,time_start,time_end,staff_regis,contactpoint,
		contactpointtel,meeting_topic,meeting_chairman,meeting_person , admin_confirm  ) VALUES ( 
		'$roomid','$mysql_date','$time_start','$time_end','$user','$contactpoint',
		'$contactpointtel','$meeting_topic','$meeting_chairman' ,'$meeting_person' , 10 )  "; 
		$result = mysql_query($sql) ; #-------------------------------------------บันทึก
		echo mysql_error() ; 
		$mysql_insertid = mysql_insert_id()   ; 
		# บันทึก log การจองห้องประชุม
		addlog("จองห้องประชุม $frm_roomid ",$m_id,$logid7,$mysql_insertid); // add log
		
		while (list ($key, $val) = each ($_POST)) { ################# เริ่มบันทึก อุปกรณ์โสต 
			if (eregi('frmaccid_', $key))  {	
				$post_runid =  str_replace("frmaccid_","",$key) ; 
				$frm_bath1 = "frmpricebath_" . $post_runid  ;eval("\$frm_bath1  = \"$frm_bath1\";");  $frm_bath =  $$frm_bath1 ; 
				$sql0 = "REPLACE INTO meeting_reserve_access ( reserve_id,accid,costbath) VALUES ( '$mysql_insertid','$post_runid','$frm_bath')";  
				mysql_query($sql0) ;
			}	############# if (eregi('frmaccid_', $key))  {		
		} ################ END while (list ($key, $val) = each ($_POST)) {
		
	} ############  if (mysql_num_rows($result)){ 
#SELECT * FROM meeting_reserve WHERE (('10:0' BETWEEN time_start AND time_end AND ('10:0' >time_end)) OR ('10:0' BETWEEN time_start AND time_end AND ('10:0' >time_start))) AND daterent = '2009-03-14' AND roomid = '3' 	
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx frmaccid_
# UPDATE meeting_reserve_access SET reserve_id='3' WHERE (runid='16')  
# INSERT INTO meeting_reserve_access ( reserve_id,accid,costbath) VALUES ( '3','2','200')

#---------------------------------------------------------------------------------------------------------------------------------------END ตรวจสอบการจองห้องซ้ำ
} ############# if ($save_reserve != ""){
if ($save_reserve != "" AND $editid != ""){ 
	$mysql_date = convert_2mysql($pdate) ;
	$time_start = $formhh1 .":". $formmm1 ; $frm_start 	= $time_start  ; 
	$time_end = $formhh2 .":". $formmm2 ; $frm_end = $time_end ; 

	if ($frm_roomid != ""){ $updateroomid = $frm_roomid ; }else{ $updateroomid = $roomid; } 
	$roomid = $updateroomid ; 
	#---------------------------------------------------------------------------------------------------------------------------------------Start ตรวจสอบการจองห้องซ้ำ
#	(time_start >= '$time_start' AND  time_end <= '$time_start') or
	$sql = "  SELECT * FROM meeting_reserve WHERE 

		(('$frm_start'   BETWEEN  time_start  AND  time_end  AND ('$frm_start'   >time_end)) OR 
		('$frm_end'   BETWEEN  time_start  AND  time_end  AND ('$frm_end' >time_start))) 
				
		AND  daterent = '$mysql_date'  	 AND roomid = '$roomid'  
		AND  refid != $editid  
		"; 
	$result = mysql_query($sql) ; 
	if (@mysql_num_rows($result)){
		$rs = @mysql_fetch_assoc($result) ;
		$roomid = $frm_oldroomid ; 
		$echostr =  "$table_var1<center><b>  ห้องที่เลือกในช่วงเวลา $time_start -  $time_end ไม่ว่าง  <br> กรุณาเลือกห้องหรือช่วงเวลาอีกครั้ง  </b></center> $table_var2";
		$echostr = str_replace( ":0 ",":00 "  ,$echostr ) ; 
	}else{ 	
		$sql = " UPDATE meeting_reserve SET 
		roomid='$updateroomid',daterent='$mysql_date',time_start='$time_start',time_end='$time_end',staff_regis='$user',
		contactpoint='$contactpoint',contactpointtel='$contactpointtel',meeting_topic='$meeting_topic',
		meeting_chairman='$meeting_chairman',meeting_person='$meeting_person'
		WHERE   (refid='$editid')   ";   
		$result = mysql_query($sql) ;  #-------------------------------------------บันทึก
		echo mysql_error() ; 
		addlog("แก้ไขรายการจองห้องประชุม $updateroomid ",$m_id,$logid9,$editid); // add log
		$sql = " DELETE FROM  meeting_reserve_access  WHERE ( reserve_id='$editid')    ";
		$result = mysql_query($sql) ; 	echo mysql_error() ; 		
		while (list ($key, $val) = each ($_POST)) { ################# เริ่มบันทึก อุปกรณ์โสต 
			if (eregi('frmaccid_', $key))  {	
				$post_runid =  str_replace("frmaccid_","",$key) ; 
				$frm_bath1 = "frmpricebath_" . $post_runid  ;eval("\$frm_bath1  = \"$frm_bath1\";");  $frm_bath =  $$frm_bath1 ; 
				$sql0 = "REPLACE INTO meeting_reserve_access ( reserve_id,accid,costbath) VALUES ( '$editid','$post_runid','$frm_bath') ";  
				mysql_query($sql0) ;
			}	############# if (eregi('frmaccid_', $key))  {		
		} ################ END while (list ($key, $val) = each ($_POST)) {		
	} ############  if (mysql_num_rows($result)){ 
	#---------------------------------------------------------------------------------------------------------------------------------------END ตรวจสอบการจองห้องซ้ำ
} ########### END if ($save_reserve != "" AND $editid != ""){ 
?>
    <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"); 
?>
<br>
<br>
<table width="98%" border="0" cellpadding="2" cellspacing="0">
  <tr>
    <td>
      ชื่อห้อง : <?=$rs_roomname?><br/>
      ชั้น :
      <?=$rs_roomrfloor;?>
      <br/>
      ขนาดความจุห้อง :
      <?=$rs_roomsize?>
      <br/>
      ค่าเช่าห้อง :
      <?=$rs_roomrrent?>
      บาท/<? if($rs_roomrper==0){echo"ชั่วโมง";}elseif($rs_roomrper==1){echo"วัน";}?>    </td>
  </tr>
</table></td>
            <td colspan="3" rowspan="2" valign="top">
<?


$nowdatemysql  = convert_2mysql($jump) ; 
$roomstr =""; if ($roomid != "" and $editid == ""){ $roomstr = "  AND  rid = $roomid  "; } 
$sql = " 
SELECT rid, roomid , 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'      
$roomstr 
 "; 
$result = mysql_query($sql) ; 
while ($rs = mysql_fetch_assoc($result)){ 
	$xroomid = $rs[roomid] ; 
	$xrefid = $rs[refid] ; 
	$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[$xroomid]  = $arr_roomref[$xroomid] .",".  $xrefid ; 
	
	$arr_starthh[$xroomid][$xrefid] =   $starthh  ; 	$arr_startmin[$xroomid][$xrefid] =   $startmin  ; 	
	$arr_endhh[$xroomid][$xrefid] =   $endhh  ; 	$arr_endmin[$xroomid][$xrefid] =   $endmin  ; 
	$arr_confirm[$xroomid][$xrefid] = $rs[admin_confirm] ; 
#	echo "<br><br> ========== $xroomid $xrefid   $rs[meeting_topic]  ";
	$arr_meetingtopic[$xroomid][$xrefid] = $rs[meeting_topic] ."<br> <strong>ประธานการประชุม :</strong>". $rs[meeting_chairman] ." <br> <strong>contactpoint :</strong>". $rs[contactpoint]  ; 		
} ###### 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)){ 
####################################################################
$roomstr =""; if ($roomid != "" and $editid == ""){ $roomstr = "  WHERE  rid = $roomid  ";   } 
$sql = " SELECT  rid,rname,rdetail,rfloor,rsize,rrent   FROM  meeting_room   $roomstr  ";
$result = mysql_query($sql) ; 

?>
เลือกรูปแบบการแสดงผล [แบบตาราง] [<a href="reserve_list.php?jump=<?=$jump?>">แบบรายการ</a>]
<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="8" 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>
  </tr>
<?
while ($rs= mysql_fetch_assoc($result)){ 
	$nonm++; 	
	if ($bgcolor1 == "DDDDDD"){  $bgcolor1 = "EFEFEF"  ; } else {$bgcolor1 = "DDDDDD" ;}
	$xroomid = $rs[rid] ; 	
	$xrefid = $editid ; 
	$arr001 = $arr_starthh[$xroomid] ; 
	$xroomname = $rs[rname] ; 
	$arr_meetingroom[$xroomid] = $xroomname ; 
#	echo "<br><br> ==========ห้อง $xroomid ||  xrefid=$xrefid    ||   editid=$editid   ";
	while (list ($xrefid, $val) = @each($arr001)) {   ########## หาว่าห้อง   $roomid มีการประชุมกี่โมง 
		$val = (int)$val ; 
#		echo " ============= ห้อง $roomid || ลำดับ(key) $xrefid ||  เวลา $val  <br> ";  
		$admin_confirm = $arr_confirm[$xroomid][$xrefid] ; 
		$xtimestart =  (int)$arr_starthh[$xroomid][$xrefid] ; 
		$xtimeend =  (int)$arr_endhh[$xroomid][$xrefid] ; 
		$topicxx = $arr_meetingtopic[$xroomid][$xrefid]  ;  ########### ตั้งค่าสำหรับ popup
		
		$xtimestart_min = (int)$arr_startmin[$roomid][$xrefid];
		$xtimeend_min = (int)$arr_endmin[$roomid][$xrefid];

		
				$temp_time_end = "";
	//	if($xtimestart_min > 0 or $xtimeend_min > 0) // กรณีมีเศษเป็นนาที
			
			$temp_sm = cal_time_persen($xtimestart_min); // หาเปอร์เซ็นของเวลาเริ่มต้น
			// หา start loop เริ่มต้นของตัวแปร
if($temp_sm <= 25){$start_loop = 0;}else if($temp_sm > 25 and $temp_sm <= 50){ $start_loop = 1;}else if($temp_sm > 50 and $temp_sm <= 75){ $start_loop = 2; }else if($temp_sm > 75 and $temp_sm <= 100){ $start_loop = 3;}

		if($xtimeend_min > 0){			// หา end loop 
			$temp_em = cal_time_persen($xtimeend_min); // หาเปอร์เซ็นของเวลาสิ้นสุด
if($temp_em <= 25){ $end_loop = 1;}else if($temp_em > 25 and $temp_em <= 50){ $end_loop = 2; }else if($temp_em > 50 and $temp_em <= 75){ $end_loop = 3;}else if($temp_em > 75 and $temp_em <= 100){ $end_loop = 4;}
		}else{
			$end_loop = 4;
		} // end if($xtimeend_min > 0){

			if($xtimeend_min > 0){ $temp_time_end = $xtimeend+1;  }else{ $temp_time_end = $xtimeend;} // กรณีเวลาสิ้นสุดมีเศษนาทีให้บวกเพิ่มไปอีก 1
			
			$n = 0;  // เช็ค loop
			$temp_check_loop = $temp_time_end - $xtimestart; // เช็คว่าจำนวน loop ทั้งหมดมีเท่าไหร่
			//echo "$xtimestart   == $temp_time_end<br>";
			for($j = $xtimestart ; $j < $temp_time_end ; $j++){
			$colorselect = $arr_colorselect[$admin_confirm] ; 
			$n++;
			if($n == 1){ // loop แรกเป็นเวลาเริ่มต้น
					for($k = $start_loop ; $k < 4; $k++){
						$varbgtmp = "bgcolor_c" . $j."_". $k;  $$varbgtmp = "bgcolor='$colorselect'" ;  ##### กำหนดสีให้ตัวแปร
					eval("\$varbgtmp  = \"$varbgtmp\";"); $varbg  = $$varbgtmp  ; 	
					if ($editid ==  $xrefid ){ $arrval[$xroomid]["$j"]["$k"] = "||||||||";  } 
					$arralt[$xroomid]["$j"]["$k"] =  "onmouseout=kill() onmouseover=\"popup('  $topicxx ','white')\";  " ; ## สำหรับ popup			

					}// end for
				} else if($n == $temp_check_loop){ // เช็คว่าเป็น loop สุดท้าย
						for($k = 0 ; $k < $end_loop; $k++){
						$varbgtmp = "bgcolor_c" . $j."_". $k;  $$varbgtmp = "bgcolor='$colorselect'" ;  ##### กำหนดสีให้ตัวแปร
					eval("\$varbgtmp  = \"$varbgtmp\";"); $varbg  = $$varbgtmp  ; 	
					if ($editid ==  $xrefid ){ $arrval[$xroomid]["$j"]["$k"] = "||||||||";  } 
					$arralt[$xroomid]["$j"]["$k"] =  "onmouseout=kill() onmouseover=\"popup('  $topicxx ','white')\";  " ; ## สำหรับ popup			

						
						}// end for
				}else{
						for($k = 0 ; $k < 4; $k++){
						$varbgtmp = "bgcolor_c" . $j."_". $k;  $$varbgtmp = "bgcolor='$colorselect'" ;  ##### กำหนดสีให้ตัวแปร
					eval("\$varbgtmp  = \"$varbgtmp\";"); $varbg  = $$varbgtmp  ; 	
					if ($editid ==  $xrefid ){ $arrval[$xroomid]["$j"]["$k"] = "||||||||";  } 
					$arralt[$xroomid]["$j"]["$k"] =  "onmouseout=kill() onmouseover=\"popup('  $topicxx ','white')\";  " ; ## สำหรับ popup			

						}// end for
				}// end 	if($n == 1){
					
//				eval("\$varbgtmp  = \"$varbgtmp\";"); $varbg  = $$varbgtmp  ; 	
//				if ($editid ==  $xrefid ){ $arrval[$xroomid]["$j"] = "||||||||";  } 
//				$arralt[$xroomid]["$j"] =  "onmouseout=kill() onmouseover=\"popup('  $topicxx ','white')\";  " ; ## สำหรับ popup			

			}// end for($j = $xtimestart ; $j < $temp_time_end ; $j++){

		
//		for ($ii = $xtimestart ; $ii < $xtimeend ; $ii++){ ########## start ทราบเวลาเิริ่มและเวลาจบ วนหาเวลาตรงกลาง
//			$colorselect = $arr_colorselect[$admin_confirm] ; 
//
//			$varbgtmp = "bgcolor_c" . $ii ;  $$varbgtmp = "bgcolor='$colorselect'" ;  ##### กำหนดสีให้ตัวแปร
//			eval("\$varbgtmp  = \"$varbgtmp\";"); 	$varbg  = $$varbgtmp  ; 
//			
//			if ($editid ==  $xrefid ){ $arrval[$xroomid]["$ii"] = "||||||||";  } 
//			$arralt[$xroomid]["$ii"] =  "onmouseout=kill() onmouseover=\"popup('  $topicxx ','white')\";  " ; ## สำหรับ popup			
//		}######end for  ########## end  ทราบเวลาเิริ่มและเวลาจบ วนหาเวลาตรงกลาง
	}################## end while (list ($name, $val) = each($arr001)) { 

?>
  <tr  bgcolor="#FFFFFF"  align="center" >
    <td height="25" bgcolor="#FFFFFF">
	<a href="reserve_room.php?roomid=<?=$rs[rid]?>&jump=<?=$jump?>"></a> 
	<img src="../../images/document_add.gif" alt="จอง <?=$rs[rname]?>" width="20" height="20" border="0"> </td>
    <td height="25" align="left"  bgcolor="#FFFFFF"><a href="room_detail.php?roomid=<?=$rs[rid]?>" target="_blank"  > </a>
        <?=$rs[rname]?></td>
    <td>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
      <tr>
        <td  <?=$bgcolor_c8_0?> <?=$arralt[$xroomid]["8"]["0"]?>  width="25%">&nbsp;</td>
        <td <?=$bgcolor_c8_1?> <?=$arralt[$xroomid]["8"]["1"]?>  width="25%">&nbsp;</td>
        <td <?=$bgcolor_c8_2?> <?=$arralt[$xroomid]["8"]["2"]?> width="25%">&nbsp;</td>
		<td <?=$bgcolor_c8_3?> <?=$arralt[$xroomid]["8"]["3"]?> width="25%">&nbsp;</td>
      </tr>
    </table>
	<?=$arrval[$xroomid]["8"]?></td>
    <td >
		<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
      <tr>
        <td  <?=$bgcolor_c9_0?>  <?=$arralt[$xroomid]["9"]["0"]?>  width="25%">&nbsp;</td>
        <td <?=$bgcolor_c9_1?>  <?=$arralt[$xroomid]["9"]["1"]?>  width="25%">&nbsp;</td>
        <td <?=$bgcolor_c9_2?>  <?=$arralt[$xroomid]["9"]["2"]?>  width="25%">&nbsp;</td>
		<td <?=$bgcolor_c9_3?>  <?=$arralt[$xroomid]["9"]["3"]?>  width="25%">&nbsp;</td>
      </tr>
    </table>
	<?=$arrval[$xroomid]["9"]?></td>
    <td >
			<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
      <tr>
        <td  <?=$bgcolor_c10_0?> <?=$arralt[$xroomid]["10"]["0"]?> width="25%">&nbsp;</td>
        <td <?=$bgcolor_c10_1?> <?=$arralt[$xroomid]["10"]["1"]?>  width="25%">&nbsp;</td>
        <td <?=$bgcolor_c10_2?>  <?=$arralt[$xroomid]["10"]["2"]?> width="25%">&nbsp;</td>
		<td <?=$bgcolor_c10_3?> <?=$arralt[$xroomid]["10"]["3"]?>  width="25%">&nbsp;</td>
      </tr>
    </table>

	
	<?=$arrval[$xroomid]["10"]?></td>
    <td  >
			<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
      <tr>
        <td  <?=$bgcolor_c11_0?>  <?=$arralt[$xroomid]["11"]["0"]?> width="25%">&nbsp;</td>
        <td <?=$bgcolor_c11_1?>  <?=$arralt[$xroomid]["11"]["1"]?>  width="25%">&nbsp;</td>
        <td <?=$bgcolor_c11_2?> <?=$arralt[$xroomid]["11"]["2"]?>  width="25%">&nbsp;</td>
		<td <?=$bgcolor_c11_3?>  <?=$arralt[$xroomid]["11"]["3"]?> width="25%">&nbsp;</td>
      </tr>
    </table>

	
	<?=$arrval[$xroomid]["11"]?></td>
    <td >
			<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
      <tr>
        <td  <?=$bgcolor_c12_0?> <?=$arralt[$xroomid]["12"]["0"]?> width="25%">&nbsp;</td>
        <td <?=$bgcolor_c12_1?>  <?=$arralt[$xroomid]["12"]["1"]?> width="25%">&nbsp;</td>
        <td <?=$bgcolor_c12_2?> <?=$arralt[$xroomid]["12"]["2"]?> width="25%">&nbsp;</td>
		<td <?=$bgcolor_c12_3?>  <?=$arralt[$xroomid]["12"]["3"]?> width="25%">&nbsp;</td>
      </tr>
    </table>
	<?=$arrval[$xroomid]["12"]?></td>
    <td >
		<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
      <tr>
        <td  <?=$bgcolor_c13_0?>  <?=$arralt[$xroomid]["13"]["0"]?>  width="25%">&nbsp;</td>
        <td <?=$bgcolor_c13_1?>  <?=$arralt[$xroomid]["13"]["1"]?> width="25%">&nbsp;</td>
        <td <?=$bgcolor_c13_2?>  <?=$arralt[$xroomid]["13"]["2"]?> width="25%">&nbsp;</td>
		<td <?=$bgcolor_c13_3?>  <?=$arralt[$xroomid]["13"]["3"]?> width="25%">&nbsp;</td>
      </tr>
    </table>
	
	<?=$arrval[$xroomid]["13"]?></td>
    <td  >
			<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
      <tr>
        <td  <?=$bgcolor_c14_0?> <?=$arralt[$xroomid]["14"]["0"]?>  width="25%">&nbsp;</td>
        <td <?=$bgcolor_c14_1?> <?=$arralt[$xroomid]["14"]["1"]?>  width="25%">&nbsp;</td>
        <td <?=$bgcolor_c14_2?> <?=$arralt[$xroomid]["14"]["2"]?>  width="25%">&nbsp;</td>
		<td <?=$bgcolor_c14_3?> <?=$arralt[$xroomid]["14"]["3"]?>  width="25%">&nbsp;</td>
      </tr>
    </table>

	<?=$arrval[$xroomid]["14"]?></td>
    <td  >
			<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
      <tr>
        <td  <?=$bgcolor_c15_0?> <?=$arralt[$xroomid]["15"]["0"]?> width="25%">&nbsp;</td>
        <td <?=$bgcolor_c15_1?> <?=$arralt[$xroomid]["15"]["1"]?>  width="25%">&nbsp;</td>
        <td <?=$bgcolor_c15_2?> <?=$arralt[$xroomid]["15"]["2"]?>  width="25%">&nbsp;</td>
		<td <?=$bgcolor_c15_3?> <?=$arralt[$xroomid]["15"]["3"]?>  width="25%">&nbsp;</td>
      </tr>
    </table>

	
	<?=$arrval[$xroomid]["15"]?></td>
  </tr>
  <?
					
 for ($ii = 1 ; $ii < 24 ; $ii++){
 	for($m = 0 ; $m < 4; $m++){
	$varbgtmp = "bgcolor_c" . $ii."_".$m  ;
	$$varbgtmp = "" ;
	} //end 
 }// end  for ($ii = 1 ; $ii < 24 ; $ii++){

}  ################## 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>
<? 
################################# jump=13/03/2009&editid=1 
if ($editid != ""){ 
	$poststr = "&jump=". $jump ."&editid=". $editid ; 
}else{
	$poststr = "";
} ########## END  if ($editid != ""){
?>

            <form name="post" method="post" action="reserve_room.php?roomid=<?=$roomid?><?=$poststr?>" onSubmit="return checkForm()" >
<?
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 != ""){ 
echo $echostr ;  $echostr  ="";
?>			

              <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>                  
<? ############ roomid  
if ($editid != ""){   ########if ($editid != ""){   เปิด List box เพื่อแก้ ห้องประชุมได้
?>					  
				<select name="frm_roomid">
<?  while (list($xmid, $xmname) = each($arr_meetingroom)){   
		if ($roomid == $xmid ){ $str_select = " selected "; }else{ $str_select= "";} 	
?>
					 <option value="<?=$xmid?>"  <?=$str_select?> ><?=$xmname?>  </option>
<? }  ## END while (list($xmid, $xmname) = each($arr_meetingroom)){ ?>						 
				 </select>
<?
}else{
	echo $xroomname  ;   
?>
	 <a href='main.php?jump=$jump'>เปลี่ยนห้องประชุม</a> 
<?   } ########if ($editid != ""){   ?>				 
					   </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>					  
                        <span class="style1"> *</span></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">เริ่มประชุมเวลา :</td>
                      <td width="77%"><?
						$nowhh = date("G") ; 
						$nowmin = date("i") ; 		
						$arr_xstart = @explode(":" , $rs_time_start ) ; 
						$arr_xend  = @explode(":" , $rs_time_end  ) ; 
						
						$xhh1 = (int)$arr_xstart[0] ; $xmm1 = (int)$arr_xstart[1] ; 
						$xhh2 = (int)$arr_xend[0] ; $xmm2 = (int)$arr_xend[1] ; 						  				  
						  ?>
                        <select name="formhh1">
                          <? for ($ii = 8; $ii <= 16 ; $ii++){ 
					  			#if ($nowmin==$ii){$str_select = " selected "; }else{ $str_select= "";} 
					  			if ($ii==8 and $editid =="" ){$str_select = " selected "; }else{ 
									$str_select= ""; if ($ii==$xhh1 and $editid !="" ){$str_select = " selected "; }else{ $str_select= "";} 	
								}##############################end if ($ii==8 and $editid =="" ){ .................
                           		echo " <option value=\"$ii\"   $str_select >$ii</option> "; 
							  } ?>
                        </select>
                        <select name="formmm1">
                          <? for ($ii = 0; $ii < 56 ; $ii = $ii + 5){ 
#						  			if ($nowmin==$ii){$str_select = " selected "; }else{ $str_select= "";} 
									if ($ii==0 and $editid =="" ){$str_select = " selected "; }else{ 
										$str_select= ""; if ($ii==$xmm1 and $editid !="" ){$str_select = " selected "; }else{ $str_select= "";} 	
									}##############################end if ($ii==8 and $editid =="" ){ .................
                           	echo " <option value=\"$ii\"   $str_select >$ii</option> "; 
							  } ?>
                        </select>
						
						เลิกประชุมเวลา
                        <select name="formhh2">
                          <? for ($ii = 8; $ii <= 16 ; $ii++){ 
					  			#if ($nowmin==$ii){$str_select = " selected "; }else{ $str_select= "";} 
									if ($ii==8 and $editid =="" ){$str_select = " selected "; }else{ 
										$str_select= ""; if ($ii==$xhh2 and $editid !="" ){$str_select = " selected "; }else{ $str_select= "";} 	
									}##############################end if ($ii==8 and $editid =="" ){ .................								
                           	echo " <option value=\"$ii\"   $str_select >$ii</option> "; 
							  } ?>
                        </select>
                        <select name="formmm2">
                          <? for ($ii = 0; $ii < 61 ;  $ii = $ii + 5 ){ 
#						  			if ($nowmin==$ii){$str_select = " selected "; }else{ $str_select= "";} 
									if ($ii==0 and $editid =="" ){$str_select = " selected "; }else{ 
										$str_select= ""; if ($ii==$xmm2 and $editid !="" ){$str_select = " selected "; }else{ $str_select= "";} 	
									}##############################end if ($ii==8 and $editid =="" ){ .................									
                           	echo " <option value=\"$ii\"   $str_select >$ii</option> "; 
							  } ?>
                        </select>
                        <span class="style1"> *</span>						</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" value="<?=$rs_meeting_chairman?>" size="80">
                        <span class="style1">                      *</span></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">หัวข้อการประชุม : </td>
                      <td><input name="meeting_topic" type="text" id="meeting_topic" value="<?=$rs_meeting_topic?>" size="80">
                        <span class="style1"> *</span></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">ผู้ประสานงาน : </td>
                      <td><input name="contactpoint" type="text" id="contactpoint" value="<?=$rs_contactpoint?>" size="80">
                        <span class="style1"> *</span></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">เบอร์โทรผู้ประสานงาน : </td>
                      <td><input name="contactpointtel" type="text" id="contactpointtel" value="<?=$rs_contactpointtel?>" size="80">
                        <span class="style1"> *</span></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">จำนวนผู้เข้าร่วมประชุม : </td>
                      <td><input name="meeting_person" type="text" id="meeting_person" value="<?=$rs_meeting_person?>" size="4" maxlength="4" onKeyPress="return noNumbers(event)">                        
                        คน ระบุข้อมูลเป็นตัวเลขเช่น &quot;241&quot;(สูงสุด  
                        <?=$rs_roomsize?>
                        คน)                        <span class="style1">*</span></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="right">อุปกรณ์โสต : </td>
                      <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
                        <tr>
                          <td width="6%" bgcolor="#EEEEEE">&nbsp; </td>
                          <td width="71%" align="center" bgcolor="#EEEEEE"><strong>อุปกรณ์</strong></td>
                          <td width="23%" align="center" bgcolor="#EEEEEE"><strong>ราคาต่อหน่วย</strong></td>
                        </tr>
<?
############ accid  accname  accdetail  accunit  accprice
$sql1 = " select * from  meeting_accessories  "; 
$result1 = mysql_query($sql1) ;
while ($rs1 = mysql_fetch_assoc($result1)){ 
?>					
                        <tr>
                          <td align="center" bgcolor="#EEEEEE">
<input name="frmaccid_<?=$rs1[accid]?>" type="checkbox" id="frmaccid_<?=$rs1[accid]?>" value="checkbox"></td>
                          <td bgcolor="#EEEEEE"><?=$rs1[accname]?>
<input name="frmpricebath_<?=$rs1[accid]?>" type="hidden" id="frmpricebath_<?=$rs1[accid]?>" value="<?=$rs1[accprice]?>">
</td>
                          <td align="center" bgcolor="#EEEEEE"><?=$rs1[accprice]?> บาท </td>
                        </tr>
<?
}
?>						
                        <tr>
                          <td bgcolor="#EEEEEE">&nbsp;</td>
                          <td bgcolor="#EEEEEE">&nbsp;</td>
                          <td bgcolor="#EEEEEE">&nbsp;</td>
                        </tr>
                      </table></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>
					 
					  <input name="roomid" type="hidden" id="roomid" value="<?=$roomid?>">
                        <input name="jump" type="hidden" id="jumpdate" value="<?=$jump?>">
                        <input name="editid" type="hidden" id="editid" value="<?=$editid?>">						
						<input name="frm_oldroomid" type="hidden" id="frm_oldroomid" value="<?=$roomid?>"></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 valign="top">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
</table>
</body>
</html>

Anon7 - 2021