<html xmlns="http://www.w3.org/1999/xhtml"> <HEAD> <TITLE></TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-874" /> <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script> </HEAD> <BODY> <table width="341" border="0" align="center"> <tr> <td width="521" colspan="3" align="center" valign="top"><img src="1.gif" width="316" height="59"></td> </tr> <tr> <td colspan="3"> </td> </tr> <? $search = (isset($_REQUEST['search']) ? $_REQUEST['search'] : ''); $cat_id = (isset($_REQUEST['cat_id']) ? $_REQUEST['cat_id'] : ''); if ($cat_id==''){ $condition = ''; $parameter = ''; if ($search!=''){ $condition = "WHERE ((t1.pro_id LIKE '%$search%') OR (t1.pro_title LIKE '%$search%'))"; $parameter = "&search=$search"; } // if ($search!=''){ }else{ $condition = "WHERE t1.cat_id='$cat_id' "; $parameter = "&cat_id=$cat_id"; if ($search!=''){ $condition = "AND ((t1.pro_id LIKE '%$search%') OR (t1.pro_title LIKE '%$search%'))"; $parameter = "&search=$search"; } // if ($search!=''){ } // if ($cat_id==''){ // ¤ÓÊÑ觹Ѻ¨Ó¹Ç¹ÃÒ¡Ò÷Ñé§ËÁ´à¾×èͤӹdz¡ÒÃáºè§Ë¹éÒ $sql = "SELECT COUNT(t1.pro_id) FROM product AS t1 {$condition};"; $rs = mysql_query($sql) or die(mysql_error()); $cols = mysql_fetch_array($rs); $Rows = intval($cols[0]); mysql_free_result($rs); // ¨Ó¹Ç¹Ë¹éÒ·Õè¡ÓÅѧáÊ´§ if (isset($_REQUEST['page'])) $page = $_REQUEST['page']; else $page = 1; // ¨Ó¹Ç¹µèÍ˹éÒ·ÕèáÊ´§ $perPage = 3; // ¤Ó¹Ç³¨Ó¹Ç¹Ë¹éÒ·Ñé§ËÁ´ if ($Rows>0) $totalPage = ceil($Rows/$perPage); else $totalPage = 0; // µÃǨÊͺ¢éÍÁÙÅ˹éÒ·ÕèáÊ´§ »éͧ¡Ñ¹ error if ($page<1) $page = 1; else if ($page>$totalPage) $page = $totalPage; // ¨Ó¹Ç¹ÃÒ¡ÒÃàÃÔèÁµé¹·Õè¨Ð¹Óä»´Ö§¨Ò¡°Ò¹¢éÍÁÙÅ ´éǤÓÊÑè§ LIMIT $startRecord = ($page-1) * $perPage; if ($startRecord<0) $startRecord = 0; $sql = "SELECT t1.pro_id, t1.pro_title, t2.cat_id, t2.cat_name, t1.pro_image, t1.pro_weight FROM product AS t1 INNER JOIN category AS t2 ON t1.cat_id = t2.cat_id {$condition} ORDER BY t1.pro_id LIMIT {$startRecord}, {$perPage};"; $rs = mysql_query($sql) or die(mysql_error()); if ($Rows==0){ echo"<tr><td><font color= \"red\" size\"4\"><div align = \"center\">******äÁèÁÕ¢éÍÁÙÅÊÔ¹¤éÒ******<div></font></td></tr>"; }else{ $iCount = 0; while ($cols=mysql_fetch_array($rs)){ $pro_id = $cols['pro_id']; $cat_name = $cols['cat_name']; $pro_image = $cols['pro_image']; $pro_title = $cols['pro_title']; $pro_weight = $cols['pro_weight']; ?> <tr> <td align="center"> <table width="76%" border="0" cellpadding="2" cellspacing="2"> <tr> <td valign="top" width=85><a href = "showdetail.php?pro_id=<?=$pro_id?>"><img src="images/<?=$pro_image?>" width=75 height=100 border=0></td> <td width="298" valign="top"> <table border="0" cellpadding="2" cellspacing="2"> <tr> <td><font color="blue" size="2">»ÃÐàÀ·ÊÔ¹¤éÒ :</font></td> <td><font color="red" size="2"><b><?=$cat_name?></b></font></td> </tr> <tr> <td><font color="blue" size="2">ª×èÍÊÔ¹¤éÒ :</font></td> <td><font color="red" size="2"><b><?=$pro_title?></b></font></td> </tr> <tr> <td><font color="blue" size="2">¹éÓ˹ѡ :</font></td> <td><font color="red" size="2"><b><?=$pro_weight?></b></font></td> </tr> <tr> <td colspan='2'><a href = "showdetail.php?pro_id=<?=$pro_id?>">ÃÒÂÅÐàÍÕ´</a></td> </tr> </table> </td> </tr> </table> </td> </tr> <?php ++$iCount; } // while ($cols==mysql_fetch_array($rs)){ // áºè§Ë¹éÒ if ($Rows>0){ echo "<TR><TD align='center' valign='middle'>"; $pageSelf = $_SERVER['PHP_SELF']; echo "áÊ´§¢éÍÁÙÅ {$iCount} / {$Rows} ÃÒ¡Òà áÊ´§Ë¹éÒ·Õè {$page} / {$totalPage} : "; if ($page>1) echo "<a href='{$pageSelf}?page=" . ($page-1) . "{$parameter}'><font color=black>Âé͹¡ÅѺ</a> "; for($i=1; $i<=$totalPage; ++$i){ if ($i==$page) echo " <b>[{$i}]</b> "; else echo "<a href='{$pageSelf}?page={$i}{$parameter}'>{$i}</a> "; } // for($i=1; $i<=$totalPage; ++$i){ if ($page<$totalPage) echo "<a href='{$pageSelf}?page=" . ($page+1) . "{$parameter}'><font color=black>¶Ñ´ä»</a> "; echo "</TD></TR>"; } // if ($Rows>0){ } // if ($Rows==0){ ?> </table> </BODY> </HTML>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง