<? include_once"connect.php"; $Per_Page = 2; // Per Page $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_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; } $sql =(" select * from stock order by id ASC LIMIT $Page_Start , $Per_Page"); $rs=mysql_query($sql) ?> <table id="mytable" border="1" align="center" width="1280" class="fix" > <a href="stock_show1">Inventory</a> Aaset Non-Inven </br><tr > <td height="51" align="center" ><font color="#CCCCCC" size="+1">Insert</font></td> <td height="51" align="center" ><font color="#CCCCCC" size="+1">No.</font></td> <td align="center"><font color="#CCCCCC" size="+1">Product P/N</font></td> <td align="center"><font color="#CCCCCC" size="+1"><p>Product Description</p> </font></td> <td align="center"><font color="#CCCCCC" size="+1">Start</font></td> <td align="center"><font color="#CCCCCC" size="+1">End</font></td> <td align="center"><font color="#CCCCCC" size="+1">Transaction Details</font></td> <td align="center"><font color="#CCCCCC" size="+1">Serial</font></td> <td align="center"><font color="#CCCCCC" size="+1">Project</font></td> <td align="center"><font color="#CCCCCC" size="+1">Transaction Code</font></td> <td height="51" align="center" ><font color="#CCCCCC" size="+1">Amount</font></td> <td align="center" ><font color="#CCCCCC" size="+1">Image</font></td> <td align="center"><font color="#CCCCCC" size="+1">Edit</font></td> <td align="center"><font color="#CCCCCC" size="+1">Delete</font></td> <td align="center"><font color="#CCCCCC" size="+1">Select</font></td> </tr> <tbody> <? while($show = mysql_fetch_array($rs)) { ?> <tr > <td title="Insert" ><a href="stock3.php?id=<?=$show['id'];?>"><center><img src="images/home/add.png" /></center></a></td> <td align="center" ><? echo ++$n ?></td> <td width="200" ><?=$show['product_id'];?></td> <td class="fix"><?=$show['product_des'];?></td> <td width="180" align="center"><?=$show['start_date'];?></td> <td width="180" align="center"><?=$show['end_date'];?></td> <td width="800" class="fix" ><?=$show['detail'];?> </td> <td class="fix"><?=$show['serial'];?></td> <td class="fix" ><a href="stock.php"><?=$show['project'];?></a></td> <td width="25" align="center"><?=$show['trans_code'];?></td> <td width="25" align="center"><?=$show['amount'];?></td> <td ><a href="../myproject/storeimage/<?=$show['image'];?>"><center><img src='<?=$show['image'];?>' /></center></a></td> <td title="Edit" ><a href="stock.php?id=<?=$show['id'];?>"><img src="images/home/edit2.png" /></a></td> <td align="center" title="Delete" ><a href="stock_delete.php?id=<?=$show['id'];?>" onclick="return confirm('ยืนยันการลบ')"><img src="images/home/dele.gif" /></a></td> <td align="center" title="Export"> <a href="select.php?id=<?=$show['id'];?>"> <input type="checkbox" name="id[]" id="id[]" value="<?=$show['id'];?>" /></a></td> </tr> <? }?> </table></form> <br> Total <?= $Num_Rows;?> Record : <?=$Num_Pages;?> Page : <? 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> "; } ?> </table> </body> </html>
$select =mysql_query(" select * from stock"); $Num_Rows=mysql_num_rows($select);
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง