<?php include "chksession.php"; include "function.php"; include "connect.php"; include "header.php"; $suite_id=$_GET["suite_id"]; $sql="select * from suite where suite_id='$suite_id'"; $result=mysql_query($sql, $link); $row=mysql_fetch_array($result); $type_id=$row['type_id']; $suite_size=$row['suite_size']; $suite_image=$row['suite_image']; $suite_detail=$row['suite_detail']; $suite_price_rent=$row['suite_price_rent']; $suite_price_cut=$row['suite_price_cut']; $sql2="select * from suite_type where type_id='$type_id'"; $result2=mysql_query($sql2, $link); $row2=mysql_fetch_array($result2); $type_name=$row2["type_name"]; ?> <table width="1000" border="0" align="center" bgcolor="#FFFFFF"> <tr> <td width="10%" height="23" align="left" valign="top" bgcolor="#FF99FF"><?php include "menu1.php";?></td> <td width="81%" valign="top" bgcolor="#FFFFFF"><table width="68%" border="0" align="center" bgcolor=""> <tr> <td width="80%" valign="top"><p> </p> <center> <p><font face="Angsana New" size="5" color="#000000"><b>แก้ไขข้อมูลชุด</b></font></p> <table border="0" width="100%"> <tr align="center"> <td width="33%" height="46" valign="top"> </td> <img src="../image_suite/detail_edit/<? echo $row[suite_image];?>" /> </tr> </table> </center> <form method="post" action="frm_edit1.php"> <table border="1" align='center' cellspacing="0" bordercolor="#999999" bgcolor="#FFFFFF"> <tr> <td align="right"><p align="left">ประเภทชุด</p></td> <td> <select name="type_id"> <option value="">เลือกประเภทชุด</option> <? $sql = "select * from suite_type"; $result= mysql_query($sql); while($record = mysql_fetch_array($result)) { if($type_id == $record["type_id"]) { $sel = "selected"; } else { $sel = ""; } ?> <option value="<?=$record["type_id"];?>" <?=$sel;?>> <?=$record["type_name"];?> </option> <? } ?> </select> <font color="red">*</font> </td> </tr> <tr> <td align="right"><div align="left">รอบอก : </div></td> <td> <input type="text" name="suite_size" size="20" value="<?php echo $suite_size;?>"> <font color="red">*</font></td> </tr> <tr> <td align="right"><div align="left">รูปชุด : </div></td> <td> <input type="file" name="suite_image" class="txtbox" value="<?php echo $suite_image;?>"> <font color="#CC0000"> * </font></td> </tr> <tr> <td align="left">รายละเอียดชุด :</td> <td align="left"><textarea name="suite_detail" cols="20" rows="4" id="suite_detail"><?=$suite_detail?></textarea></td> </tr> <tr> <td align="right"><div align="left">ราคาเช่า : </div></td> <td> <input type="text" name="suite_price_rent" size="20" value="<?php echo $suite_price_rent;?>"> <font color="#CC0000"> * </font></td> </tr> <tr> <td align="right"><div align="left">ราคาตัด : </div></td> <td> <input name="suite_price_cut" type="text" size="20"value="<?php echo $suite_price_cut;?>"> <font color="#CC0000"> * </font></td> </tr> <tr> <td colspan='3' align="center"> <input type="submit" value="บันทึก"> <input type='button' value='ยกเลิก' onClick="javascript:location.href='addsuite.php';"> <input name="suite_id" type="hidden" id = "suite_id" value="<?php echo $suite_id;?>" /></td> </tr> </table> </form> </td> </tr> </table> </td> </tr> </table> <? include "footer.php"; ?>
<?php include "chksession.php"; include "connect.php"; $suite_id=$_POST['suite_id']; $type_id=$_POST['type_id']; $suite_size=$_POST['suite_size']; $suite_image=$_POST['suite_image']; $suite_detail=$_POST['suite_detail']; $suite_price_rent=$_POST['suite_price_rent']; $suite_price_cut=$_POST['suite_price_cut']; $suite_amount=$_POST['suite_amount']; $sql="update suite set type_id='$type_id',suite_size='$suite_size',suite_image='$suite_image' ,suite_detail='$suite_detail',suite_price_rent='$suite_price_rent',suite_price_cut='$suite_price_cut' ,suite_amount=$'suite_amount' where suite_id='$suite_id'"; $result=mysql_query($sql,$link); if($result) { include "header.php"; echo "<center>บันทึกข้อมูลเรียบร้อยแล้ว</center>"; echo "<meta http-equiv=\"refresh\" content=\"3; url=addsuite.php\"/>"; include "footer.php"; }else{ include "header.php"; echo "<center>ไม่สามารถบันทึกข้อมูลได้ !</center>"; echo "<meta http-equiv=\"refresh\" content=\"3; url=frm_edit.php\"/>"; include "footer.php"; } ?>
$result=mysql_query($sql,$link) or die (mysql_error());
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง