<? include("config.php"); ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> .simply{ font:14px Verdana; margin: 45px; width: 480px; border-collapse: collapse; text-align: left; } .simply th{ font:normal 16px Verdana; color: #222; background:#cbeffd; padding: 10px 8px; border-bottom: 2px solid #ccc; } .simply td{ border-bottom: 1px solid #ccc; color: #666; background: #fff; padding: 5px; } .simply tbody tr:hover td{ color: #222; background: #eee; } </style> </head> <body> <?php $strSQL = "SELECT * FROM application ORDER BY ApplyID DESC"; $objQuery = mssql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mssql_num_rows($objQuery); $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; } $Page_End = $Per_Page * $Page; IF ($Page_End > $Num_Rows) { $Page_End = $Num_Rows; } ?> <table class="simply" summary="PremierShip Top5"> <thead> <tr> <th scope="col">#</th> <th scope="col">Name</th> <th scope="col">ตำแหน่งที่1</th> <th scope="col">ตำแหน่งที่2</th> <th scope="col">เงินเดือนที่ต้องการ</th> <th scope="col">aaa</th> </tr> </thead> <? for($i=$Page_Start;$i<$Page_End;$i++) { ?> <tbody> <tr> <td><?=mssql_result($objQuery,$i,"ApplyID");?></td> <td><?=mssql_result($objQuery,$i,"Name");?></td> <td><?=mssql_result($objQuery,$i,"Position1ID");?></td> <td><?=mssql_result($objQuery,$i,"Position2ID");?></td> <td><?=mssql_result($objQuery,$i,"NeedSalary");?></td> <td></td> </tr> </tbody> <? } ?> </table> <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> "; } mssql_close($objConnect); ?> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง