<?php function back() { mysql_close(); echo "<p /><a href=\"reportprinter.php\">ดูรายการทั้งหมด</a></body></html>"; exit; } include("Connections/docconnection.php"); $tb="printer_profile"; if(isset($_POST['printer_ID'])) { unset($_POST['Submit']); $values = implode("', '", $_POST); $values = "'" . $values . "'"; $sql = "REPLACE INTO printer_profile VALUES($values);"; $result = mysql_query($sql); if(!$result) { echo mysql_error(); } else { echo "ข้อมูลถูกบันทึกแล้ว"; back(); } } $printer_ID = ""; $com_name=""; $printer_brand=""; $printer_model=""; $printer_serial=""; $printer_purchase=""; $printer_status=""; if(isset($_GET['action'])) { $action = $_GET['action']; if($action == "insert") { echo ">> เพิ่มข้อมูล"; } else { $printer_ID = $_GET['printer_ID']; if($action == "delete") { $delete = mysql_query("DELETE FROM printer_profile WHERE printer_ID = $printer_ID;"); if(!$delete) { echo mysql_error(); } else { echo "ข้อมูลถูกลบแล้ว"; } back(); } else if($action == "update") { echo ""; $result = mysql_query("SELECT * FROM printer_profile WHERE printer_ID = $printer_ID;"); list($printer_ID, $com_name, $printer_brand, $printer_model, $printer_serial, $printer_purchase, $printer_status) = mysql_fetch_row($result); } } } mysql_close(); ?> <td width="773" height="21" align="center" valign="top"> <form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <table width="590" height="430" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="middle" background="img/images/bgad.jpg"><table width="550" border="0"> <tr> <td width="139"><span class="style4">printer_ID</span></td> <td width="269"><span class="style4"><?php echo $printer_ID; ?> <input name="printer_ID" type="hidden" size="11" value="<?php echo $printer_ID;?>" /></span></td> </tr> <tr> <td><span class="style4">com_name</span></td> <td><select name="com_name" size="1" class="Txttext" id="com_name" style="width:200px"> <option value="" selected="selected">- <?php echo $com_name; ?>-</option> <?php include("Connections/docconnection.php"); $objDB = mysql_select_db("notebook"); $strSQL = "SELECT com_name FROM com_profile"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); while($rs=mysql_fetch_array($objQuery)){ echo "<option value>" . $rs["com_name"] . "</option>"; } ?> </select> </td> </tr> <tr> <td><span class="style4">printer_brand</span></td> <td><input name="printer_brand" type="text" value="<?php echo $printer_brand; ?>" size="30" /></td> </tr> <tr> <td><span class="style4">printer_model</span></td> <td><input name="printer_model" type="text" value="<?php echo $printer_model; ?>" size="30" /></td> </tr> <tr> <td><span class="style4">printer_serial</span></td> <td><input name="printer_serial" type="text" value="<?php echo $printer_serial; ?>" size="30" /></td> </tr> <tr> <td><span class="style4">printer_purchase</span></td> <td><input name="printer_purchase" type="text" value="<?php echo $printer_purchase; ?>" size="30" /></td> </tr> <td><span class="style4">printer_status</span></td> <td><input name="printer_status" type="text" value="<?php echo $printer_status; ?>" size="30" /></td> </tr> </table> <table width="117" height="80" border="0"> <tr> <td width="55"><input name="Submit" type="submit" value="ตกลง" /></td> <td width="332" align="center" valign="top"><input name="reset" type="reset" id="reset" value="ยกเลิก" /></td> </tr> <tr> </tr> <tr> </tr> <td><a href="reportprinter.php" class="style1"><br /> </a></td> </tr><tr> <td> </td> </tr> </table> </form> <body> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง