<? } else if($type!='') { $cmd = "select * from product where cate_id = '$type' and pro_status !='del' LIMIT $offset,$rowsPerPage "; $result_pro = mysql_query($cmd,$link); $number=mysql_num_rows($result_pro) ; } else if($type=='') { $cmd = "select * from product where pro_status !='del' ORDER BY pro_auto DESC LIMIT $offset,$rowsPerPage"; $result_pro = mysql_query($cmd,$link); $number=mysql_num_rows($result_pro) ; } if($type != ""){$query = "SELECT COUNT(pro_auto) AS numrows FROM product where cate_id = '$type' and pro_status !='del' ORDER BY pro_auto ASC ";} else{$query = "SELECT COUNT(pro_auto) AS numrows FROM product where pro_status !='del' ORDER BY pro_auto ASC ";} if($word != ""){$query = "SELECT COUNT(pro_auto) AS numrows FROM product where pro_name like '%$word%' and pro_status !='del' ORDER BY pro_auto ASC ";} $result = mysql_query($query) or die('Error, query failed'); $row = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; $maxPage = ceil($numrows/$rowsPerPage);//หน้าสุดท้าย $self = $_SERVER['PHP_SELF']; if ($pageNum > 1) { $page = $pageNum - 1; $prev = " <a href=\"index?menu=&page=$page&word=$word&index=$index&y=1&pname=$pname \">[ย้อนกลับ]</a> "; $first = " <a href=\"index?menu=&page=1&word=$word&index=$index&y=1&pname=$pname \">[หน้าแรก]</a> "; } else { $prev = ' [ย้อนกลับ] '; // we're on page one, don't enable 'previous' link $first = ' [หน้าแรก] '; // nor 'first page' link } if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " <a href=\"index?menu=&page=$page&word=$word&index=$index&y=1&pname=$pname \">[ถัดไป]</a> "; $last = " <a href=\"index?menu=&page=$maxPage&word=$word&index=$index&y=1&pname=$pname \">[หน้าสุดท้าย]</a> "; for($i=0;$i<4;$i++) { $lastz[$i] = $pageNum-$i; } } else { $next = ' [ถัดไป] '; // we're on the last page, don't enable 'next' link $last = ' [หน้าสุดท้าย] '; // nor 'last page' link } for($i=$pageNum;$i<=($pageNum+5);$i++) { if($i<$maxPage){$firstz[$i] = "<a href=\"index?menu=&page=$i&word=$word&index=$index&y=1&pname=$pname \">[$i]</a> ";} else if($i==$maxPage){ for($j=$maxPage;$j>=($maxPage-5);$j--) { if($j>0){$firstz[$j] = "<a href=\"index?menu=&page=$j&word=$word&index=$index&y=1&pname=$pname \">[$j]</a> ";} } } } echo $first . $prev."--- "; for($i=0;$i<=1000;$i++) { echo $firstz[$i]; } echo " ---".$next . $last; echo"<BR>หน้าที่ <strong>$pageNum</strong> จาก <strong>$maxPage</strong> หน้า ( จำนวน<strong> $number </strong> รายการ )"; ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง