เช็คสถนะของห้องเพื่อทำการอนุมัติด่วนมากกกกกกกกกกกกกเลยค่ะเพราะใกล้สอบละอีกไม่กี่วันนรี่ค่ะติดตรงนี่ค
พี่แอดมินค่ะ
ด่วนมากเลยค่ะไฟจี้เลยค่ะเพราะจะสอบละคะแต่ติดปัญกาตรงนี่อะคะช่วยด้วยนะคะตอนนี้น้องติดปัญหาการอนุติค่ะ
ถ้าอนุมัติแบบปกติคือไม่เปลี่ยนแปลงข้อมุลห้องอนุมัติได้แล้วค่ะ
แต่ถ้ามีการเปลี่ยนแปลงห้อง
เช่นคนจองขอจองห้องเอ1
แต่ผู้อนุมัติอนุญาติให้ใช้ห้อง เอ2
อยากจะเช้คว่า
ห้องนี้ (เอ2)มีคนจองหรืออนุมัติไปยังค่ะ
ถ้ายังไม่มีก้อนุมัติได้
ถ้ามีให้แสดงข้อความว่าห้อง
แสดงว่าห้องนี้ถูกจองอยู่หรือถูกอนุมัติไปแล้วค่ะ
เพื่อความรวดเร้วของผู้อนุมัติการจองของน้องจองจากปฏิทินนะคะ
ข้อมุลการจองคงไม่ซ้ำกันแน่นอนค่ะแจ่ว่าเปลี่ยนห้องที่อนุมัติอาจจะด้วยกรณีอื่นหรือกรณีใดๆๆค่ะ
พี่ๆๆคงไม่งงนะคะที่เขียนมาถหรือถ้ามีวิธีอื่นช่วยแนนำด้วยค่ะด่วนสุดๆๆค่ะยิ่งกว่า1112อีกค่ะ
นี่คือโคดหน้าอนุมัตินะคะ
ฟาย bookingroomProfiles.php
<?php
require_once("../include/chkSession.php");
require_once("../include/connectdb.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=tis620" />
<link href="../include/css.css" rel="stylesheet" type="text/css" />
<title>bookingroomProfiles.php</title>
<?php
$objDB =mysql_select_db($dbname1);
$charset = "SET NAMES 'tis620'";
mysql_query($charset);
$booking_id=$_GET[booking_id];
$user_id=$_GET[user_id];
$user_name=$_GET[user_name];
$sqlBooking=mysql_query("select *from booking where booking_id='$booking_id' limit 1");
$resultBooking=mysql_fetch_object($sqlBooking);
$date_start=explode("-",$resultBooking->date_start);
$date_end=explode("-",$resultBooking->date_end);
//echo $resultBooking->room_id;
// echo $resultBooking->date_start;
// echo $resultBooking->date_end;
// echo $resultBooking->spec_requirement;
// echo $resultBooking->reason_reserve;
// echo $resultBooking->amount_person_attend;
// echo $resultBooking->room_name;
/*echo "เลขที่การจอง=" .$booking_id ."<br>" ;
echo " รหัส =".$user_id ."<br>" ;
echo "ชื่อ =" .$user_name."<br>" ;
*/
?>
<script language="javascript" type="text/javascript">
function chkForm(){
var spec_requirement=document.getElementById("spec_requirement").value;
var reason_reserve=document.getElementById("reason_reserve").value;
// var date_start=document.getElementById("date_start").value;
// var date_end=document.getElementById("date_end").value;
var room_id=document.getElementById("room_id").selectedIndex;
var approve=document.getElementById("approve_id").value;
//var booking_date=document.getElementById("booking_date").value;
var room_name=document.getElementById("room_name").value;
if(spec_requirement==null||reason_reserve==null){
alert("กรุณาตรวจสอบข้อมูลก่อนการจอง");
return false;
}else if(room_id==0&&approve!=""){
alert("กรุณาเลือกห้อง");
return false;
}else{
document.getElementById("booking_id").disabled=false;
// document.getElementById("booking_date").disabled=false;
document.getElementById("user_id").disabled=false;
// document.getElementById("approve_date").disabled=false;
return true;
}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function confDel(pk,variable,page){
if(confirm("คุณต้องการที่จะยกเลิกการจองนี้")==true){
window.location="deleteData.php?PK_ID="+pk+"&variable="+variable+"&p="+page;
}
}
</script>
<style type="text/css">
<!--
.style2 {color: #ECE9D8}
.style3 {font-size: 14px; }
-->
</style>
<div align="center">
<table width="943" height="403" border="0">
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"><?php require_once("thempHead.php"); ?></td>
</tr>
<tr>
<p>
<td width="165"> <?php require_once("thempMenu.php"); ?></td>
<td width="20"> <img src="mm_spacer.gif" alt="" width="15" height="1" border="0" /></td>
<td width="831" colspan="3">
<fieldset>
<legend><h3>ฟร์อมบันทึกข้อมูลอนุมัติจองห้อง</h3></legend>
<form name="frmbookingroomProfile" action="bookingUpdate.php?booking_id=<? echo $booking_id; ?>&user_id=<?php echo $user_id; ?>&user_name=<?php echo $user_name; ?>" method="post" enctype="multipart/form-data" onSubmit="javascript:return chkForm();" >
<textarea name="textfield" id="textfield"></textarea>
<table width="617" height="532" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFCC">
<tr>
<td> </td>
<td height="40"><div align="left"></div></td>
<td> </td>
<td height="40" colspan="2"> </td>
<td height="40"> </td>
<td height="40" colspan="2"> </td>
<td height="40"> </td>
<td height="40"> </td>
</tr>
<tr>
<td> </td>
<td height="20"> <h5 align="left">รหัสห้อง</h5></td>
<td> </td>
<td height="20" colspan="2"><div align="left"><input name="room_id" type="text" class="textbox" id="room_id" value="<?php echo $resultBooking->room_id; ?>" size="5" readonly="true" /> </div></td>
<td height="20"> </td>
<td height="20" colspan="2"> </td>
<td height="20"> </td>
<td height="20"> </td>
</tr>
<tr>
<td width="37"> </td>
<td width="119" height="20"> <h5 align="left">เลขที่การจอง</h5></td>
<td width="10"> </td>
<td height="20" colspan="2"><div align="left"> <input name="booking_id" type="text" disabled="disabled" class="textbox" id="booking_id" value="<? echo $booking_id; ?>" size="30" maxlength="30" /> </div></td>
<td width="71" height="20"> </td>
<td height="20" colspan="2"> </td>
<td width="3" height="20"> </td>
<td width="72" height="20"> </td>
</tr>
<tr>
<td> </td>
<td height="20"><h5 align="left">วันที่ทำการจอง</h5></td>
<td> </td>
<td height="20" colspan="4"><div align="left">
<input name="booking_date" type="text" class="textbox" id="booking_date" value="<?php echo $resultBooking->booking_date; ?> " size="23" readonly="readonly" />
</div></td>
<td height="20"> </td>
<td height="20"> </td>
<td height="20"> </td>
</tr>
<tr>
<td width="37"> </td>
<td width="119" height="20"> <h5 align="left">รหัสผู้จอง</h5></td>
<td width="10"> </td>
<td width="61" height="20"><div align="left"> <input name="user_id" type="text" disabled="disabled" class="textbox" id="user_id" value="<?php echo $user_id; ?>" size="10" maxlength="10"> </div></td>
<td height="20" colspan="3"><div align="left"><?php echo $user_name; ?></div></td>
<td width="10" height="20"><div align="left"></div></td>
<td width="3" height="20"> </td>
<td width="72" height="20"> </td>
</tr>
<tr>
<td> </td>
<td height="37"> <h5 align="left">ช่วงเวลาใช้ห้อง</h5></td>
<td> </td>
<td height="37" colspan="5"><label>
<div align="left">
<select name="booking_time" id="booking_time">
<?php
$input = $resultBooking->book_time_id;
$objDB =mysql_select_db($dbname1);
$charset = "SET NAMES 'tis620'";
mysql_query($charset);
$sqlBooking_time=mysql_query("select *from booking_time ");
while($resultBooking_time=mysql_fetch_object($sqlBooking_time)){
if($resultBooking_time->book_time_id == $input){
echo "<option value='$resultBooking_time->book_time_id' selected='selected'>$resultBooking_time->book_time_name</option>";
}else{
echo "<option value='$resultBooking_time->book_time_id'>$resultBooking_time->book_time_name</option>";
}
}
?>
</select>
</div>
</label></td>
<td height="37" colspan="3"> </td>
</tr>
<tr>
<td> </td>
<td height="20"> <h5 align="left">วันที่ใช้ห้อง</h5></td>
<td> </td>
<td width="61"><script language="JavaScript" src="../calendering/calendar.js"></script>
<link href="../calendering/calendar-mos.css" rel="stylesheet" type="text/css" />
<div align="left">
<input name="date_start" class="textbox" id="date_start" type="text" size="10" value="<?php echo $resultBooking->date_start ?>" />
</div></td>
<td width="192" ><div align="left"><img src="../images/cal.gif" width="20" height="20" border="0" onclick="showCalendar('date_start','YYYY-MM-DD')" /></div></td>
<td height="20" colspan="3"></td>
<td height="20" colspan="3"><div align="left" id="st_div2">
</div></td>
</tr>
<tr>
<td> </td>
<td height="20"> <h5 align="left">วันที่กำหนดคืนห้อง</h5></td>
<td> </td>
<td width="61"><script language="JavaScript" src="../calendering/calendar.js"></script>
<link href="../calendering/calendar-mos.css" rel="stylesheet" type="text/css" />
<div align="left">
<input name="date_end" id="date_end" class="textbox" type="text" size="10" value="<?php echo $resultBooking->date_end ?>" />
</div></td>
<td width="192"><div align="left"><img src="../images/cal.gif" width="20" height="20" border="0" onclick="showCalendar('date_end','YYYY-MM-DD')" /></div></td>
<td height="20" colspan="3"><div align="left" id="end_div2"></div></td>
<td height="20"> </td>
<td height="20"> </td>
</tr>
<tr>
<td> </td>
<td height="83"> <h5 align="left">เหตุผลที่จอง</h5></td>
<td> </td>
<td height="83" colspan="4">
<div align="left">
<textarea name="reason_reserve" id="reason_reserve" cols="57" rows="5" ><?php echo $resultBooking->reason_reserve; ?>
</textarea>
</div></td>
<td height="83"> </td>
<td height="83"> </td>
<td height="83"> </td>
</tr>
<tr>
<td width="37"> </td>
<td width="119" height="70"> <h5 align="left">อุปกรณ์เพิ่มเติม</h5></td>
<td width="10"> </td>
<td height="70" colspan="4"><div align="left">
<label>
<textarea name="spec_requirement" cols="57" rows="4" id="spec_requirement"><?php echo $resultBooking->spec_requirement;
?></textarea>
</label>
</div></td>
<td width="10" height="70"><div align="left"></div></td>
<td width="3" height="70"> </td>
<td width="72" height="70"> </td>
</tr>
<tr>
<td> </td>
<td height="20">boo
<label for="checkbox_row_16">booking_comment</label></td>
<td> </td>
<td height="20" colspan="5"><label>
<textarea name="booking_comment" cols="57" rows="4" id="booking_comment"><?php echo $resultBooking->booking_comment; ?></textarea>
</label></td>
<td height="20"> </td>
<td height="20"> </td>
</tr>
<tr>
<td width="37"> </td>
<td width="119" height="20"> <h5 align="left">จำนวนผู้เข้าร่วม</h5></td>
<td width="10"> </td>
<td height="20" colspan="5"><div align="left">
<input name="amount_person_attend" type="text" id="amount_person_attend" value="<?php echo $resultBooking->amount_person_attend; ?>" />
</div></td>
<td width="3" height="20"> </td>
<td width="72" height="20"> </td>
</tr>
<tr>
<td width="37"> </td>
<td width="119" height="20"> <h5 align="left">วันที่อนุมัติ</h5></td>
<td width="10"> </td>
<td height="20" colspan="2"><div align="left">
<input name="approve_date" type="text" class="textbox" id="approve_date" value="<?php echo date("Y-m-d"); ?>" size="15" disabled="disabled" />
</div></td>
<td width="71" height="20"><div align="left"></div></td>
<td width="49" height="20"><div align="left"> </div></td>
<td width="10" height="20"> </td>
<td width="3" height="20"> </td>
<td width="72" height="20"> </td>
</tr>
<tr>
<td width="37"> </td>
<td width="119" height="20"> <h5 align="left">ผลการอนุมติ</h5></td>
<td width="10"> </td>
<td height="20" colspan="5">
<div align="left">
<select name="approve" id="approve">
<?php
$input = $resultBooking->approve_id;
$objDB =mysql_select_db($dbname1);
$charset = "SET NAMES 'tis620'";
mysql_query($charset);
$sqlApprove=mysql_query("select * from approve order by approve_id asc");
while($resultApprove=mysql_fetch_object($sqlApprove)){
if($resultApprove->approve_id == $input){
echo "<option value='$resultApprove->approve_id' selected='selected'>$resultApprove->approve_name</option>";
}else{
echo "<option value='$resultApprove->approve_id'>$resultApprove->approve_name</option>";
}
}
?>
</select>
</div></td>
<td width="3" height="20"> </td>
<td width="72" height="20"> </td>
</tr>
<tr>
<td> </td>
<td height="20"> <h5 align="left">ห้องที่อนุมัติ</h5></td>
<td> </td>
<td height="20" colspan="3">
<div align="left">
<select name="room" id="room">
<?php
$input = $resultBooking->room_id;
$objDB =mysql_select_db($dbname1);
$charset = "SET NAMES 'tis620'";
mysql_query($charset);
$sqlRoom=mysql_query("select * from room order by room_id asc");
while($resultRoom=mysql_fetch_object($sqlRoom)){
if($resultRoom->room_id == $input){
echo "<option value='$resultRoom->room_id' selected='selected'>$resultRoom->room_name</option>";
}else{
echo "<option value='$resultRoom->room_id'>$resultRoom->room_name</option>";
}
}
?>
</select>
</div></td>
<td height="20" colspan="2"> </td>
<td height="20"> </td>
<td height="20"> </td>
</tr>
<tr>
<td> </td>
<td height="20"><h5 align="left"> </h5></td>
<td> </td>
<td height="20"> </td>
<td height="20" colspan="3"> </td>
<td height="20" colspan="2"> </td>
<td height="20"> </td>
</tr>
<tr>
<td width="37"> </td>
<td width="119" height="20"><h5 align="left"> </h5></td>
<td width="10"> </td>
<td height="20" colspan="5">
<div align="left">
<input name="Submit" type="submit" class="button" id="button" value="อนุมัติข้อมูล" />
<input name="button2" type="reset" class="button" id="button2" value="ล้างข้อมูล" onclick="checkDateST()" />
<input name="button4" type="button" class="button" id="button4" value="ลบข้อมูล" onclick="confDel('<?php echo base64_encode(base64_encode("$booking_id")); ?>','booking_id','<?php echo base64_encode(base64_encode("../office/?p=concludeReport.php")); ?>')"/>
<?php if($resultBooking->approve_id!="04"){ ?>
<input name="button3" type="button" class="button" id="button3" onclick="MM_openBrWindow('../include/reportBooking.php?booking_id=<?php echo $resultBooking->booking_id; ?>','','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes')" value="พิมพ์รายงาน" />
<?php } ?>
</div>
<div align="left"></div>
<div align="left"></div></td><td width="3" height="20"> </td>
<td width="72" height="20"> </td>
</tr>
<tr>
<td width="37"> </td>
<td width="119" height="20"><h5 align="left"> </h5></td>
<td width="10"> </td>
<td width="61" height="20"><div align="left"></div></td>
<td width="192" height="20"><div align="left"></div></td>
<td width="71" height="20"><div align="left"></div></td>
<td width="49" height="20"><div align="left"></div></td>
<td width="10" height="20"><div align="left"></div></td>
<td width="3" height="20"><div align="left"></div></td>
<td width="72" height="20"> </td>
</tr>
</table>
</form>Tag : - - - -
Date :
2010-03-01 17:31:49
By :
tonlhiew
View :
753
Reply :
0
Load balance : Server 03