<script type="text/javascript"> function doSubmit(frm){ if(frm.ข้อมูลอื่นๆ.value == ""){ alert("กรอก ข้อมูลอื่นๆ"); return false; }else if(frm.hdn_status.value == "ไม่ว่าง"){ alert("ไม่สามารถ update ข้อมูลได้"); return false; }else{ return true; } } </script> <? $host="localhost"; $username="root"; $password=""; $db="hotelmis"; $tb="rooms"; $connect= mysql_connect( $host,$username,$password) or die ("?????????????????? Mysql ?????? "); mysql_select_db($db) or die("????????????????????"); $sql="select * from $tb where roomid=$roomid"; mysql_query("SET NAMES 'tis620'"); $db_query=mysql_db_query($db,$sql); $result = mysql_fetch_array($db_query); $roomid=$result[roomid]; $roomno=$result[roomno]; $floor=$result[floor]; $value_room=$result[value_room]; $aircondition =$result[aircondition ]; $fun =$result[fun ]; $status =$result[status ] ?> </p> <table width="95%" align="center"> <tr> <td colspan="2"><span class="style4">rooms <?echo"<b>$roomno</b>"; ?></span> <span class="style14"> <input name="roomid" type="hidden" id="roomid" value="<? echo"$roomid"; ?>" /> </span></td> </tr> <tr> <td width="118">หมายเลขห้อง</td> <td width="323"><input name="roomno" type="text" id="roomno" value='<? echo"$roomno";?>' /></td> </tr> <tr> <td><label onClick="return (document.getElementById('checkbox_row_2') ? false : true)" for="checkbox_row_2"></label> <label onClick="return (document.getElementById('checkbox_row_3') ? false : true)" for="checkbox_row_3">ชั้น</label></td> <td><input name="floor" type="text" id="floor" value="<? echo"$floor ";?>" /></td> </tr> <tr> <td><label onClick="return (document.getElementById('checkbox_row_3') ? false : true)" for="checkbox_row_3">ค่าห้อง</label></td> <td><input name="value_room" type="text" id="value_room" value="<? echo"$value_room ";?>" /></td> </tr> <tr> <td><p>แอร์</p> <p> พัดลม</p></td> <td><p align="left"> <input name="aircondition" type="checkbox" id="article" value="Y" <?echo $aircondition==Y? "checked":""?> /> </p> <p> <input name="fun" type="checkbox" id="article" value="Y" <?echo $fun==Y? "checked":""?> /> </p></td> </tr> <tr> <td>สถานะ</td> <td><table width="90%" border="0" cellpadding="1"> <tr> <td ><input name="status" type="radio" value="V" checked="checked" <?echo $status==V? "checked":""?> /> ว่าง ( V )</td> <td><input name="status" type="radio" value="B" <?echo $status==B? "checked":""?> /> ล็อก ( B )</td> </tr> </table></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><input name=" onsubmit" type="submit" id=" onsubmit" value="แก้ไขข้อมูล"> <input type="reset" name="Submit2" value="ยกเลิก"></td> </tr> <tr> <td colspan="2"><div id="RequestDetails"> <input type="button" name="Submit3" value="รายการห้องเช่า" onClick="loadHTML('room_list.php','RequestDetails','room')"/> </div></td> </tr> </table> <p> </p> <p> </p></td> </tr> </table> <p> </p> </form>
<script type="text/javascript"> function doSubmit(frm){ var status=getCheckedValue(frm.status); if(status == "B"){ alert("สถานะตอนนี้คือไม่ว่าง "); return false; } /* if(frm.ข้อมูลอื่นๆ.value == ""){ // comment: ชื่อ ข้อมูลๆอื่น หมายความว่าไง alert("กรอก ข้อมูลอื่นๆ"); return false; } if(rm.hdn_status.value == "ไม่ว่าง"){ // comment: ชื่อ hdn_status อยู่ไหนไม่เห็นมีเลย alert("ไม่สามารถ update ข้อมูลได้"); return false; } */ return true; } /*ฟังก์ชันตรวจสอบ radio ที่ถูกเลือก*/ function getCheckedValue(radioObj) { if(!radioObj) return ""; var radioLength = radioObj.length; if(radioLength == undefined) if(radioObj.checked) return radioObj.value; else return ""; for(var i = 0; i < radioLength; i++) { if(radioObj[i].checked) { return radioObj[i].value; } } return ""; } </script> <? $host="localhost"; $username="root"; $password=""; $db="hotelmis"; $tb="rooms"; $connect= mysql_connect( $host,$username,$password) or die ("?????????????????? Mysql ?????? "); mysql_select_db($db) or die("????????????????????"); $sql="select * from $tb where roomid=$roomid"; mysql_query("SET NAMES 'tis620'"); $db_query=mysql_db_query($db,$sql); $result = mysql_fetch_array($db_query); $roomid=$result[roomid]; $roomno=$result[roomno]; $floor=$result[floor]; $value_room=$result[value_room]; $aircondition =$result[aircondition ]; $fun =$result[fun ]; $status =$result[status ] ?> <form name="myfrm" method="post" action="" onSubmit="return doSubmit(document.myfrm)"> <table width="95%" align="center"> <tr> <td colspan="2"><span class="style4">rooms <?echo"<b>$roomno</b>"; ?></span> <span class="style14"> <input name="roomid" type="hidden" id="roomid" value="<? echo"$roomid"; ?>" /> </span></td> </tr> <tr> <td width="118">หมายเลขห้อง</td> <td width="323"><input name="roomno" type="text" id="roomno" value='<? echo"$roomno";?>' /></td> </tr> <tr> <td><label onClick="return (document.getElementById('checkbox_row_2') ? false : true)" for="checkbox_row_2"></label> <label onClick="return (document.getElementById('checkbox_row_3') ? false : true)" for="checkbox_row_3">ชั้น</label></td> <td><input name="floor" type="text" id="floor" value="<? echo"$floor ";?>" /></td> </tr> <tr> <td><label onClick="return (document.getElementById('checkbox_row_3') ? false : true)" for="checkbox_row_3">ค่าห้อง</label></td> <td><input name="value_room" type="text" id="value_room" value="<? echo"$value_room ";?>" /></td> </tr> <tr> <td><p>แอร์</p> <p> พัดลม</p></td> <td><p align="left"> <input name="aircondition" type="checkbox" id="article" value="Y" <?echo $aircondition==Y? "checked":""?> /> </p> <p> <input name="fun" type="checkbox" id="article" value="Y" <?echo $fun==Y? "checked":""?> /> </p></td> </tr> <tr> <td>สถานะ</td> <td><table width="90%" border="0" cellpadding="1"> <tr> <td ><input name="status" type="radio" value="V" checked="checked" <?echo $status==V? "checked":""?> /> ว่าง ( V )</td> <td><input name="status" type="radio" value="B" <?echo $status==B? "checked":""?> /> ล็อก ( B )</td> </tr> </table></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><input name=" onsubmit" type="submit" id=" onsubmit" value="แก้ไขข้อมูล"> <input type="reset" name="Submit2" value="ยกเลิก"></td> </tr> <tr> <td colspan="2"><div id="RequestDetails"> <input type="button" name="Submit3" value="รายการห้องเช่า" onClick="loadHTML('room_list.php','RequestDetails','room')"/> </div></td> </tr> </table> <p> </p> <p> </p></td> </tr> </table> <p> </p> </form>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง