<? $id_edit=$_GET[id_edit]; include"connect.php"; $sql="select * from department where dep_id='$id_edit'"; $result=mysql_db_query($dbname,$sql); $rs=mysql_fetch_array($result); $dep_id=$rs[dep_id]; $dep_name=$rs[dep_name]; ?> <? include"connect.php"; $sql="select * from department ORDER BY dep_id ASC"; $result=mysql_db_query($dbname,$sql); $number=mysql_num_rows($result); $no=1; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Abhaibhubejhr Data Center</title> <link rel="shortcut icon" href="picture.ico"/> <meta name="keywords" content="" /> <meta name="description" content="" /> </head> <body> <FORM NAME="forml" METHOD="post" ACTION="manage_department_edit2.php"> <!------------------------ Add department ----------------------------> <table style="width: 400px" align="center"> <tr> <td style="width: 140px">แก้ไขแผนก</td> <td style="width: 210px"><INPUT TYPE="text" NAME="dep_name" VALUE="<?=$dep_name;?>" style="width: 200px; height: 30px"></td> <td style="width: 50px"><input type="image" src="images/manage/1440933588_ok.png" height="40px" name="pic" width="40px"></td> </tr> </table> <!--------------------------------------------------------------------> <br><br> <!--------------------------------------------------------------------> <table width="800px" align="center"> <tr> <td> <? if($number <> 0){ echo"<center><P><B>แสดงแผนก</B></P></center> <TABLE width='500px' align='center'> <TR BGCOLOR='#FFFF66'; height='40px';> <TD width='50px' align='center'><B>ลำดับ</B></TD> <TD width='300px' align='center'><B>แผนก</B></TD> <TD width='75px' align='center'><B>Edit</B></TD> <TD width='75px' align='center'><B>Delete</B></TD> </TR>"; While($rs=mysql_fetch_array($result)){ $dep_id=$rs[dep_id]; $dep_name=$rs[dep_name]; echo" <TR BGCOLOR='#FFFFCC'; height='40px'; onMouseover=this.style.backgroundColor='yellow' onMouseout=this.style.backgroundColor='';> <TD><CENTER>$dep_id</CENTER></TD> <TD> $dep_name</TD> <TD><A HREF=\"manage_department_edit.php?id_edit=$dep_id\"><center><img src='images/manage/1440760655_edit.png' width='40' height='40' /></center></A></TD> <TD><A HREF=\"manage_department_del.php?id_del=$dep_id\" Onclick=\"return confirm('ยืนยันลบหน่วยงาน $dep_name ออกจากระบบ')\"><center><img src='images/manage/1440760644_delete.png' width='40' height='40' /></center></A></TD> </TR>"; $no++; } echo"</TABLE>"; mysql_close(); } ?> </td> </tr> </table> </FORM> </body> </html>
<? $id_edit=$_POST[id_edit]; $dep_name=$_POST[dep_name]; include"connect.php"; $sql="UPDATE department SET dep_name='$dep_name' where dep_id='$id_edit'"; $result=mysql_db_query($dbname,$sql); if($result){ echo"<H3>Successful</H3>"; echo"<META HTTP-EQUIV=refresh CONTENT=\"1; URL=manage_department\">"; }else{ echo"<H3>ERROR:Can not fix</H3>"; } Mysql_close(); ?>
<!------------------------ Add department ----------------------------> <table style="width: 400px" align="center"> <tr> <td style="width: 140px">แก้ไขแผนก</td> <td style="width: 210px"> <INPUT TYPE="text" NAME="dep_name" VALUE="<?=$dep_name;?>" style="width: 200px; height: 30px"> <INPUT TYPE="hidden" NAME="id_edit" VALUE="<?=$dep_id;?>"> </td> <td style="width: 50px"><input type="image" src="images/manage/1440933588_ok.png" height="40px" name="pic" width="40px"></td> </tr> </table> <!-------------------------------------------------------------------->
<INPUT TYPE="submit" NAME="btnSubmit" VALUE="บันทึกป่าว ? บันทึกก็กดดิ">
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง