<? @ session_start(); ?> <!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"> <head> <title>Admin</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> <!-- body { background-color: #CCCCCC; } a:link { color: #FF9900; text-decoration: none; } a:visited { color: #FF6633; text-decoration: none; } a:hover { color: #FFCC66; text-decoration: none; } a:active { color: #FF9900; text-decoration: none; } .style1 { color: #FF0000; font-weight: bold; } .style2 {color: #660000} --> </style></head> <body> <? include( "../config.php"); if($_GET["RoomID"] != "") { $sql2 = " SELECT CategoryID ,CategoryName FROM room_category"; $sql1 = " SELECT r.RoomID ,r.RoomName ,r.RoomPrice ,rc.CategoryID ,rc.CategoryName ,r.RoomDescription ,r.RoomPicture FROM room r INNER JOIN room_category rc ON r.CategoryID = rc.CategoryID WHERE RoomID = ".$_GET["RoomID"] ; $result1 = mysql_query($sql1, $Connect) or die(mysql_error()); $result2 = mysql_query($sql2, $Connect) or die(mysql_error()); while($row1 = mysql_fetch_array($result1)) { $RoomID = $row1['RoomID'] ; $RoomName = $row1['RoomName'] ; $RoomPrice = $row1['RoomPrice'] ; $RoomDescription = $row1['RoomDescription'] ; $RoomPicture = $row1['RoomPicture'] ; } } else { $id =""; } ?> <form id="addroom" enctype="multipart/form-data" name="addroom" method="post" action="addroom_save_action.php<? echo "?edit=$id"?>"> <table width="1000" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="4"><img src="../images/aaa.jpg" width="228" height="105" /> </td> </tr> <tr> <td width="152" bgcolor="#666666"> </td> <td width="168" bgcolor="#666666"> </td> <td width="465" bgcolor="#666666"> </td> <td bgcolor="#666666"> </td> </tr> <tr> <td colspan="4" bgcolor="#FFFFFF"> <div align="center"><span class="AdminText style2" ><strong>เพิ่มรายการห้อง</strong></span></div> <table width="929" border="0"> <tr> <th width="75" scope="col"> </th> <th width="844" scope="col"> </th> </tr> <tr> <th scope="row"> </th> <td align="left"><table width="783" border="0" align="center" cellpadding="0" cellspacing="1" class="AdminText"> <tr> <td width="96">ชื่อห้อง *</td> <td width="660"> <div align="left"> <input name="txtRoomName" type="text" id="txtRoomName" value="<?=$RoomName; ?>" size="50"/> <input name="hiddenRoomID" type="hidden" id="hiddenRoomID" value="<?=$RoomID; ?>" /> </div></td> </tr> <tr> <td><div align="left">ราคา *</div></td> <td> <div align="left"> <input name="txtRoomPrice" onKeyPress="return checkIt(event)" type="text" id="txtRoomPrice" value="<?=$RoomPrice?>" size="50"/> </div></td></tr> <tr> <td><div align="left">ประเภท</div></td> <td> <div align="left"><select id="cboRoom_category" name="cboRoom_category"> <option>--- เลือก ---</option> <? while($result2 = mysql_fetch_array($sql2)) { ?> <option value="<?=$result2['CategoryID'];?>" ><?=$result2['CategoryName'];?></option> <? } ?> </select> </div></td></tr> <tr> <td><div align="left">รูป *</div></td> <td> <div align="left"> <input name="fileUpload[]" type="file" value="<?=$PicEdit?>" size="50"/> <? if($_GET["edit"] != "") { echo "<img width=\"50\" src=\"$PicEdit\">"; //<img width=\"50\" src=\"$picture\"> } ?> <input type="hidden" name="Pic_path" value="<?=$PicEdit?>"/></td> </tr> <tr> <td align=""> </td> <td><span class="style1">**รูปต้องเป็นไฟล์ JPG, JPEG เท่านั้น </span></td> </tr> <tr> <td align="">รายละเอียด</td> <td> <div align="left"> <textarea name="txtDescription" cols="55" rows="5" id="txtDescription" ><?=$RoomDescription; ?></textarea> </div></td> </tr> <tr> <td> </td> <td><div align="left"></div></td> </tr> </table></td> </tr> <tr> <th scope="row"> </th> <td><div align="center"> <input type="submit" name="saveproduct" id="saveproduct" value="ตกลง" /> <input type="reset" name="cancleproduct" id="cancleproduct" value="ยกเลิก" onclick="parent.location.href='../admin/edit_room.php'" /> </div></td> </tr> <tr> <th scope="row"><div align="center"></div></th> <td><div align="center"><a href="../admin/edit_room.php"><img src="../images/Back.png" width="15" height="15" /> กลับไปหน้าแก้ไข</a></div></td> </tr> </table></td> </tr> </table> <br /> <br /> </form> <? mysql_close($Connect); //ปิดการติดต่อฐานข้อมูล ?> </body> </html>
echo"<select id=\"txtjob_sta\" name=\"txtjob_sta\" style=\"width:160px;\">"; //echo"<option value=\"\" selected>-----------ไม่ระบุ----------</option>"; $sql="select * from tb_job_status order by job_sta_id"; mysql_query("SET NAMES utf8"); $rs=mysql_query($sql); while($row=mysql_fetch_array($rs)){ echo"<option value=\"".$row['job_sta_id']."\">".$row['job_sta_name']."</option>"; } echo"</select>";
<select id="cboRoom_category" name="cboRoom_category"> <option>--- เลือก ---</option> <? $sql2 = " SELECT CategoryID ,CategoryName FROM room_category"; $result2 = mysql_query($sql2, $Connect) or die(mysql_error()); while($result2 = mysql_fetch_array($sql2)) { ?> <option value="<?=$result2['CategoryID'];?>" ><?=$result2['CategoryName'];?></option> <? } ?> </select>
<option>--- เลือก ---</option> <? while($row2 = mysql_fetch_array($result2)){ ?> <option value="<?=$row2['CategoryID'];?>" ><?=$row2['CategoryName'];?></option> <? } ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง