<table width="150" border="0" align="center"> <? while ($row_publisher = mysql_fetch_array($publisher)) { ?> <tr> <td><a href="publisher.php?id=<?=$row_publisher["id"]?>"><?=$row_publisher["name"]?></a></td> </tr> <? } ?> </table>
<? session_start(); include("lib/connect.php"); connect_db(); $pub_id = $_REQUEST["id"]; // Prepare Variables // Page Size $num_col = 3; $num_row = 1; $page_size = $num_col*$num_row; // Page No $page_no = isset($_REQUEST["page_no"]) ? $_REQUEST["page_no"] : 0; // Number of Product $sql = "SELECT COUNT(*) FROM product WHERE publisher_id='$pub_id'"; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result); $num_product = $row["COUNT(*)"]; // Number of Page $num_page = ceil($num_product/$page_size); // Start Record $start_record = $page_no*$page_size; // Action $sql = "SELECT * FROM product WHERE publisher_id='$pub_id'" . " ORDER BY id" . " LIMIT $start_record, $page_size"; $result = mysql_query($sql) or die(mysql_error()); ?> <!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" /> <link rel="stylesheet" href="css/style.css" type="text/css" /> <title>หมวดหนังสือ</title> </head> <body> <table width="1000" border="1" align="center" cellpadding="0" cellspacing="0"> <tr> <th scope="col"><table width="1000" border="0" cellpadding="0" cellspacing="0"> <tr> <!-- header --> <th colspan="3" align="center" valign="top" scope="col"><? require_once ("header.php"); ?></th> </tr> <tr> <!-- mennu_left --> <td width="150" valign="top"><? require_once ("menu_left.php"); ?></td> <!-- publisher --> <td width="700" valign="top"> <table width="80%" border="1" align="center" cellpadding="5" cellspacing="1"> <? for ($i = 0; $row = mysql_fetch_array($result); $i++) { if ($i%$num_col == 0) { ?><tr><? } ?> <td align="center"> <a href="show_product.php?id=<?=$row["id"]?>"> <img src="admin/images/<?=$row["id"]?>.jpg" border="0" /> </a><br /> <?=$row["name"]?><br /> <?=number_format($row["price"])?> บาท </td> <? if ($i%$num_col == $num_col-1) { ?></tr><? } } // Add <td></td> if ($i > $num_col) { for ($j = $i; $j%$num_col != 0; $j++) { ?><td align="center">จะมีมาในไม่ช้า</td><? } } // Add </tr> if ($i%$num_col != 0) { ?></tr><? } ?> </table><br /> <!-- Page No --> <div align="center"> <? if ($page_no > 0) {?> <a href="publisher.php?page_no=<?=$page_no-1?>">ก่อนหน้า</a> <? } ?> <? for ($i = 0; $i < $num_page; $i++) { if ($i == $page_no) { ?> <?=$i+1?> <? } else { ?> <a href="publisher.php?page_no=<?=$i?>"><?=$i+1?></a> <? } } ?> <? if ($page_no < $num_page-1) {?> <a href="publisher.php?page_no=<?=$page_no+1?>">ถัดไป</a> <? } ?> </div> </td> <!-- menu_right --> <td width="150" valign="top"><? require_once("menu_right.php"); ?></td> </tr> <tr> <!-- footer --> <td colspan="3"><? require_once ("footer.php"); ?></td> </tr> </table></th> </tr> </table> </body> </html>
<div align="center"> <? if ($page_no > 0) {?> <a href="publisher.php?page_no=<?=$page_no-1?>">ก่อนหน้า</a> <? } ?> <? for ($i = 0; $i < $num_page; $i++) { if ($i == $page_no) { ?> <?=$i+1?> <? } else { ?> <a href="publisher.php?page_no=<?=$i?>"><?=$i+1?></a> <? } } ?> <? if ($page_no < $num_page-1) {?> <a href="publisher.php?page_no=<?=$page_no+1?>">ถัดไป</a> <? } ?> </div> </td> <!-- menu_right --> <td width="150
<? session_start(); include("lib/connect.php"); connect_db(); $pub_id = $_REQUEST["id"];
<div align="center"> <? if ($page_no > 0) {?> <a href="publisher.php?page_no=<?=$page_no-1?>&pub_id=<?=$pub_id?>">ก่อนหน้า</a> <? } ?> <? for ($i = 0; $i < $num_page; $i++) { if ($i == $page_no) { ?> <?=$i+1?> <? } else { ?> <a href="publisher.php?page_no=<?=$i?>"><?=$i+1?>&pub_id=<?=$pub_id</a> <? } } ?> <? if ($page_no < $num_page-1) {?> <a href="publisher.php?page_no=<?=$page_no+1?>&pub_id=<?=$pub_id">ถัดไป</a> <? } ?> </div> </td> <!-- menu_right --> <td width="150
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง