<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <p><a href="IP_Reg.php">เพิ่มข้อมูลการยื่นคำร้องขอ IP</a></p> <p><a href="IP_List_save.php">SAVE</a></p> <h2 align="center">แสดงข้อมูลการยื่นคำร้องขอ IP</h2> <form id="form1" name="form1" method="post" action=""> <p style="text-align: center"><span style="font-weight: bold">ค้นหาข้อมูลจาก</span> <label for="s"></label> <select name="s" id="s"> <option value="" selected="selected">All</option> <option>192.168.100</option> <option>192.168.101</option> <option>192.168.102</option> <option>192.168.103</option> <option>192.168.104</option> <option>192.168.105</option> <option>192.168.208</option> <option>192.168.209</option> <option>192.168.210</option> <option>192.168.211</option> </select> <input type="submit" name="button" id="button" value="ค้นหา" /> </p> </Form> </p> <form id="form1" name="form1" method="post" action=""> <div align="center"> <div align="center"> <?php $strSort = $_GET["sort"]; if($strSort == "") { $strSort = "ip"; } @$s=$_POST[s]; include("connectdb.php"); include("function.php"); $sql = "select * from ip_reguest where ip LIKE '%$s%' order by ".$strSort." ASC"; // DESC// $rs = mquery($conn,$sql); ?> <table width="1233" border="1"> <tr> <td width="168" align="center" bgcolor="#FF0000" style="color: #FFF; font-weight: bold;"><a href="<?php echo $_SERVER["PHP_SELF"];?>?sort=re_name">Reguester name</a></td> <td width="135" align="center" bgcolor="#FF0000" style="color: #FFF; font-weight: bold;"><a href="<?php echo $_SERVER["PHP_SELF"];?>?sort=dept">Department name</td> <td width="135" align="center" bgcolor="#FF0000" style="color: #FFF; font-weight: bold;"><a href="<?php echo $_SERVER["PHP_SELF"];?>?sort=ip">IP Address</td> <td width="148" align="center" bgcolor="#FF0000" style="color: #FFF; font-weight: bold;">Computer name</td> <td width="125" align="center" bgcolor="#FF0000" style="color: #FFF; font-weight: bold;">Mac address</td> <td width="85" align="center" bgcolor="#FF0000" style="color: #FFF; font-weight: bold;">From</td> <td width="86" align="center" bgcolor="#FF0000" style="color: #FFF; font-weight: bold;">To</td> <td width="139" align="center" bgcolor="#FF0000" style="color: #FFF; font-weight: bold;">Remark</td> <td width="74" align="center" bgcolor="#FF0000" style="color: #FFF; font-weight: bold;">Edit</td> <td width="74" align="center" bgcolor="#FF0000" style="color: #FFF; font-weight: bold;">Delete</td> </tr> <?php while($result = marray($rs)) { ?> <tr> <td><center><?php echo $result["re_name"];?></center></td> <td><center><?php echo $result["dept"];?></center></td> <td><center><?php echo $result["ip"];?></center></td> <td><center><?php echo $result["com_name"];?></center></td> <td><center><?php echo $result["mac"];?></center></td> <td><center><?php echo $result["start"];?></center></td> <td><center><?php echo $result["finished"];?></center></td> <td><center><?php echo $result["remark"];?></center></td> <td><center><a href='IP_Edit.php?id=<?php echo $result["id"];?>'><แก้ไข></a></center></td> <td><center><a href='IP_Del.php?id=<?php echo $result["id"];?>'"title="ลบข้อมูล"onclick="return confirm('คุณต้องการลบข้อมูล ใช่ หรือ ไม่?')"><ลบ></a></center></td> </tr> <?php } ?> </table> </div> </form> <p align="center"> </p> </body> </html>
ORDER BY CAST(REPLACE(IP,'.','') AS INTEGER) ASC
$sql = "select * from ip_reguest where ip LIKE '%$s%' order by CAST(REPLACE(IP,'.','') AS INTEGER) ASC";
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง