<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>แสดงรายการหนังสิอ</title> </head> <body> <p align="center"> <font size="3"><< <a href="index.htm">หน้าหลัก</a> >> <font size="3"><< <a href="showdatall.php">เรียกดูข้อมูลในฐานข้อมูล</a> >> << <a href="adddata.php">เพิ่มข้อมูลลงฐานข้อมูล</a> >> <<<a href="logout.php">ออกจากระบบ</a></font></p> <p align="center"><u><b><font size="5" color="#800000"> แสดงข้อมูลในฐานข้อมูล</font></b></u></p> <?php $objConnect = mysql_connect("localhost","root","admin") or die("Error Connect to Database"); $objDB = mysql_select_db("lib"); mysql_query("SET character_set_results=utf8"); mysql_query("SET character_set_client=utf8"); mysql_query("SET character_set_connection=utf8"); $objConnect = mysql_connect("localhost","root","admin") or die("Error Connect to Database"); $objDB = mysql_select_db("lib"); $strSQL = "SELECT * FROM member "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 50; // 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; } $strSQL .=" order by id ASC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); ?> <table width="100%" border="1"> <tr> <th width="10%"> <div align="center">เลขที่หนังสือ </div></th> <th width="15%">หมวดหนังสือ <select> <option value="คอมพิวเตอร์">คอมพิวเตอร์</option> <option value="หนังสือเรียน">หนังสือเรียน</option> <option value="สื่อภาษาอังกฤษ">สื่อภาษาอังกฤษ</option> <option value="อื่น ๆ " selected>อื่น ๆ </option> </select> </th> <th width="55%"> <div align="center">ชื่อหนังสือ </div></th> <th width="35%"> <div align="center">ชื่อผู้แต่ง </div></th> <th width="10%"> <div align="center">ปีที่พิมพ์ </div></th> <th width="5%"> <div align="center">สถานะ </div></th> <th width="25%"> <div align="center">ภาพตัวอย่าง </div></th> <th width="10%"> <div align="center">แก้ไข </div></th> <th width="10%"> <div align="center">ลบ </div></th> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td><div align="center"><?php echo $objResult["idbook"];?></div></td> <td align="right"><?php echo $objResult["kind"];?></td> <!-- <td><?php echo $objResult["namebook"];?></td> --> <td><a href="borrow.php?id=<?=$objResult['id'];?>"><?php echo $objResult["namebook"];?></a></td> <td><div align="center"><?php echo $objResult["author"];?></div></td> <td align="right"><?php echo $objResult["yearbook"];?></td> <td align="center"><?php echo $objResult["status"];?></td> <td align="center"><img src="myfile/<?=$objResult["pic"];?> " width="80" height= "100" ></td> <td align="center"><a href="editdata.php?id=<?=$objResult['id'];?>"><img src="edit.gif" width="15" height="15" border="0"></a></td> <td align="center"><a href="deletedata.php?id=<?=$objResult['id'];?>" OnClick="return Conf(this)"><img src="delete.jpg" width="15" height="15" border="0"></a></td> </tr> <? } ?> </table> <br> Total <?= $Num_Rows;?> Record : <?=$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($objConnect); ?> </body> </html>
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>แสดงรายการหนังสิอ</title> </head> <body> <p align="center"> <font size="3"><< <a href="index.htm">หน้าหลัก</a> >> <font size="3"><< <a href="showdatall.php">เรียกดูข้อมูลในฐานข้อมูล</a> >> << <a href="adddata.php">เพิ่มข้อมูลลงฐานข้อมูล</a> >> <<<a href="logout.php">ออกจากระบบ</a></font></p> <p align="center"><u><b><font size="5" color="#800000"> แสดงข้อมูลในฐานข้อมูล</font></b></u></p> <?php $objConnect = mysql_connect("localhost","root","admin") or die("Error Connect to Database"); $objDB = mysql_select_db("lib"); mysql_query("SET character_set_results=utf8"); mysql_query("SET character_set_client=utf8"); mysql_query("SET character_set_connection=utf8"); $objConnect = mysql_connect("localhost","root","admin") or die("Error Connect to Database"); $objDB = mysql_select_db("lib"); $strSQL = "SELECT * FROM member "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 50; // 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; } $strSQL .= isset($_POST["kind"])?" where kind='{$_POST["kind"]}' ":""; $strSQL .=" order by id ASC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); ?> <form method="post" action="" id="form_search"> <table width="100%" border="1"> <tr> <th width="10%"> <div align="center">เลขที่หนังสือ </div></th> <th width="15%">หมวดหนังสือ <select name="kind" onchange="document.forms[0].submit();"> <option value="คอมพิวเตอร์">คอมพิวเตอร์</option> <option value="หนังสือเรียน">หนังสือเรียน</option> <option value="สื่อภาษาอังกฤษ">สื่อภาษาอังกฤษ</option> <option value="อื่น ๆ " selected>อื่น ๆ </option> </select></th> <th width="55%"> <div align="center">ชื่อหนังสือ </div></th> <th width="35%"> <div align="center">ชื่อผู้แต่ง </div></th> <th width="10%"> <div align="center">ปีที่พิมพ์ </div></th> <th width="5%"> <div align="center">สถานะ </div></th> <th width="25%"> <div align="center">ภาพตัวอย่าง </div></th> <th width="10%"> <div align="center">แก้ไข </div></th> <th width="10%"> <div align="center">ลบ </div></th> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td><div align="center"><?php echo $objResult["idbook"];?></div></td> <td align="right"><?php echo $objResult["kind"];?></td> <!-- <td><?php echo $objResult["namebook"];?></td> --> <td><a href="borrow.php?id=<?=$objResult['id'];?>"><?php echo $objResult["namebook"];?></a></td> <td><div align="center"><?php echo $objResult["author"];?></div></td> <td align="right"><?php echo $objResult["yearbook"];?></td> <td align="center"><?php echo $objResult["status"];?></td> <td align="center"><img src="myfile/<?=$objResult["pic"];?> " width="80" height= "100" ></td> <td align="center"><a href="editdata.php?id=<?=$objResult['id'];?>"><img src="edit.gif" width="15" height="15" border="0"></a></td> <td align="center"><a href="deletedata.php?id=<?=$objResult['id'];?>" OnClick="return Conf(this)"><img src="delete.jpg" width="15" height="15" border="0"></a></td> </tr> <? } ?> </table> <br> Total <?= $Num_Rows;?> Record : <?=$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($objConnect); ?> </form> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง