<form method="post" name="form_test"> <? $type = $_POST['type']; if(!isset($start)){ $start = 0; } $limit = '10'; // แสดงผลหน้าละกี่หัวข้อ /* หาจำนวน record ทั้งหมด ปล. อันนี้ต้องใช้กับตัวแบ่งนะ ห้ามเอาออก*/ $Qtotal = mysql_query("select * from Product where ID_Type = '$type' "); //คิวรี่ คำสั่ง $total = mysql_num_rows($Qtotal); // หาจำนวน record /* คิวรี่ข้อมูลออกมาเพื่อแสดงผล */ $Query = mysql_query("select * from Product where ID_Type = '$type' ORDER BY ID_Pro DESC LIMIT $start,$limit"); //คิวรี่คำสั่ง $totalp = mysql_num_rows($Query); // หาจำนวน record ที่เรียกออกมา $intRows = 0; $sql = mysql_query("select * from typepro"); ?> <table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="right"><span class="normal13blueBold">เลือกประเภทสินค้า:</span> </td> <td colspan="2"> <select name="type" id="type" onChange="submit_click(this.form,'type')" > <option >---Choose Type---</option> <? while($result = mysql_fetch_array($sql)){?> <option value="<? echo $result['ID_Type'] ?>"><? echo $result['Name_Type']?></option> <? } ?> </select></td> </tr> <tr> <td> </td> <td align="left" valign="top"> </td> <td> </td> <td align="left" valign="top"> </td> </tr> <tr> <? while($arr = mysql_fetch_array($Query)){ $intRows++; echo "<td>"; ?> <table width="91" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="center"><a href="admin/Product/images_product/<?=$arr["Image_Pro"];?>" target="_blank"><img src="admin/Product/images_product/<?=$arr["Image_Pro"];?>" width="100" height="100" border="0"></a></div></td> </tr> <tr> <td><div align="left"><span class="narmal3old"><?=$arr["Name_Pro"];?></span></div></td> </tr> <tr> <td><div align="left"><span class="narmal3old">Price: <?=$arr["Price_Pro"];?> BATH</span></div></td> </tr> <tr> <td><div align="left"><span class="narmal3old">Color: <?=$arr["Color_Pro"];?></span></div></td> </tr> <tr> <td ><div align="left"><span class="narmal3old">Size: <?=$arr["Size_Pro"];?></span></div></td> </tr> </table> <? echo"</td>"; if(($intRows)%5==0) { echo"</tr>"; } else { echo "<td>"; } } //echo"</tr></table>"; ?> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> </table> <? $page = ceil($total/$limit); // เอา record ทั้งหมด หารด้วย จำนวนที่จะแสดงของแต่ละหน้า /* เอาผลหาร มาวน เป็นตัวเลข เรียงกัน เช่น สมมุติว่าหารได้ 3 เอามาวลก็จะได้ 1 2 3 */ for($i=1;$i<=$page;$i++){ if($_GET['page']==$i){ //ถ้าตัวแปล page ตรง กับ เลขที่วนได้ echo "[<a href='?start=".$limit*($i-1)."&page=$i'><B>$i</B></A>]"; //ลิ้งค์ แบ่งหน้า เงื่อนไขที่ 1 }else{ echo "[<a href='?start=".$limit*($i-1)."&page=$i'>$i</A>]"; //ลิ้งค์ แบ่งหน้า เงื่อนไขที่ 2 } } ?> </form> <Script language="javascript"> function submit_click(obj,s) { if(s=='type' & document.form_test.type.value!='<?=$type?>') { obj.action=""; obj.submit(); } } </Script>
<form method="post" name="form_test"> <? $type = $_REQUEST['type']; if(!isset($start)){ $start = 0; } $limit = '10'; // แสดงผลหน้าละกี่หัวข้อ /* หาจำนวน record ทั้งหมด ปล. อันนี้ต้องใช้กับตัวแบ่งนะ ห้ามเอาออก*/ $Qtotal = mysql_query("select * from Product where ID_Type = '$type' "); //คิวรี่ คำสั่ง $total = mysql_num_rows($Qtotal); // หาจำนวน record /* คิวรี่ข้อมูลออกมาเพื่อแสดงผล */ $Query = mysql_query("select * from Product where ID_Type = '$type' ORDER BY ID_Pro DESC LIMIT $start,$limit"); //คิวรี่คำสั่ง $totalp = mysql_num_rows($Query); // หาจำนวน record ที่เรียกออกมา $intRows = 0; $sql = mysql_query("select * from typepro"); ?> <table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="right"><span class="normal13blueBold">เลือกประเภทสินค้า:</span> </td> <td colspan="2"> <select name="type" id="type" onChange="submit_click(this.form,'type')" > <option >---Choose Type---</option> <? while($result = mysql_fetch_array($sql)){?> <option value="<? echo $result['ID_Type'] ?>"><? echo $result['Name_Type']?></option> <? } ?> </select></td> </tr> <tr> <td> </td> <td align="left" valign="top"> </td> <td> </td> <td align="left" valign="top"> </td> </tr> <tr> <? while($arr = mysql_fetch_array($Query)){ $intRows++; echo "<td>"; ?> <table width="91" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="center"><a href="admin/Product/images_product/<?=$arr["Image_Pro"];?>" target="_blank"><img src="admin/Product/images_product/<?=$arr["Image_Pro"];?>" width="100" height="100" border="0"></a></div></td> </tr> <tr> <td><div align="left"><span class="narmal3old"><?=$arr["Name_Pro"];?></span></div></td> </tr> <tr> <td><div align="left"><span class="narmal3old">Price: <?=$arr["Price_Pro"];?> BATH</span></div></td> </tr> <tr> <td><div align="left"><span class="narmal3old">Color: <?=$arr["Color_Pro"];?></span></div></td> </tr> <tr> <td ><div align="left"><span class="narmal3old">Size: <?=$arr["Size_Pro"];?></span></div></td> </tr> </table> <? echo"</td>"; if(($intRows)%5==0) { echo"</tr>"; } else { echo "<td>"; } } //echo"</tr></table>"; ?> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> <tr> <td height="10" colspan="4"></td> </tr> </table> <? $page = ceil($total/$limit); // เอา record ทั้งหมด หารด้วย จำนวนที่จะแสดงของแต่ละหน้า /* เอาผลหาร มาวน เป็นตัวเลข เรียงกัน เช่น สมมุติว่าหารได้ 3 เอามาวลก็จะได้ 1 2 3 */ for($i=1;$i<=$page;$i++){ if($_REQUEST['page']==$i){ //ถ้าตัวแปล page ตรง กับ เลขที่วนได้ echo "[<a href='?start=".$limit*($i-1)."&page=$i&type=".$type."'><B>$i</B></A>]"; //ลิ้งค์ แบ่งหน้า เงื่อนไขที่ 1 }else{ echo "[<a href='?start=".$limit*($i-1)."&page=$i&type=".$type."'>$i</A>]"; //ลิ้งค์ แบ่งหน้า เงื่อนไขที่ 2 } } ?> </form> <Script language="javascript"> function submit_click(obj,s) { if(s=='type' & document.form_test.type.value!='<?=$type?>') { obj.action=""; obj.submit(); } } </Script>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง