<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head><title>stock</title> <meta http-equiv=Content-Type content="text/html; charset=utf8"> <link rel="stylesheet" type="text/css" href="../style.css" /> <style type="text/css"> </style> <script type="text/JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> </head> <body> <?php ini_set('display_errors', 1); error_reporting(~0); $strKeyword = null; if(isset($_POST["txtKeyword"])) { $strKeyword = $_POST["txtKeyword"]; } ?> <?php require_once("../lib/config.php");?> <?php $sql = "SELECT * FROM product WHERE Name LIKE '%".$strKeyword."%' "; $query = mysql_query($sql,$conn); $num_rows = mysql_num_rows($query); $per_page = 10; // Per Page $page = 1; if(isset($_GET["Page"])) { $page = $_GET["Page"]; } $prev_page = $page-1; $next_page = $page+1; $row_start = (($per_page*$page)-$per_page); if($num_rows<=$per_page) { $num_pages =1; } else if(($num_rows % $per_page)==0) { $num_pages =($num_rows/$per_page) ; } else { $num_pages =($num_rows/$per_page)+1; $num_pages = (int)$num_pages; } $row_end = $per_page * $page; if($row_end > $num_rows) { $row_end = $num_rows; } $sql .= " ORDER BY ProductID ASC LIMIT $row_start ,$row_end "; $query = mysql_query($sql); ?> <table width="731" border="0" valign="top"> <form name="frmSearch" method="post" action="<?php echo $_SERVER['SCRIPT_NAME'];?>"> <table border="0" align="right"> <tr> <td></td> <td><th>Search From Name <input name="txtKeyword" type="text" id="txtKeyword" value="<?php echo $strKeyword;?>"> <input type="submit" value="Search"></th></td> </tr> </table> </form> <table class="three" cellspacing="0"> <br><br><tr> <th width="7%"> <div align="center">รหัสครุภัณฑ์ </div></th> <th width="15%"> <div align="center">รายละเอียด </div></th> <th width="5%"> <div align="center">ยี่ห้อ </div></th> <th width="7%"> <div align="center">รุ่น </div></th> <th width="10%"> <div align="center">วันที่ได้มา</div></th> <th width="15%"> <div align="center">สถานที่ตั้งของอุปกรณ์</div></th> </tr> <?php while($result=mysql_fetch_array($query)) { ?> <tr> <td><div align="center"><?php echo $result["ProductID"];?></div></td> <td><div align="center"><a href="#" onClick="window.open('detail_pi.php?ProductID=<?php echo $result["ProductID"];?>','','width=600,height=600'); return false;" target = "_blank"><?php echo $result["name"];?></a></div></td> <td><div align="center"><?php echo $result["brand"];?></div></td> <td align="right"><?php echo $result["model"];?></td> <td align="right"><?php echo $result["num_machine"];?></td> <td align="right"><?php echo $result["startdate"];?></td> <td align="right"><?php echo $result["location"];?></td> </tr> <?php } ?> </table> <br> Total <?php echo $num_rows;?> Record : <?php echo $num_pages;?> Page : <?php if($prev_page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$prev_page'><< Back</a> "; } for($i=1; $i<=$num_pages; $i++){ if($i != $page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($page!=$num_pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$next_page'>Next>></a> "; } mysql_close($conn); ?> </body> </html>
$bg = strtotime(' + 10 year', strtotime($startdate))<time()? 'red' : 'blue';
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง