<? $id_type_select=$_GET[id_type]; ?> <html><head><title>ร้านค้าออนไลน์</title></head> <body> ร้านค้าออนไลน์ <p> [<a href="index.php" >หน้าแรก</a>] [<a href="basket.php" >ดูตะกร้า</a>] </p> <table width="770" border="0"> <tr> <td width="174" height="200" valign="top" bgcolor="#eaeaea"> <center><b>ประเภทสินค้า</b></center> <? include "connect.php"; include "type_list.php"; ?> </td> <td width="580" valign="top"><div align="center"> <table width="100%" border="0" cellspacing="4"> <? $sql="select * from tb_product where ref_id_type='$id_type_select'"; $result=mysql_db_query ($dbname ,$sql); $result=mysql_db_query($dbname,$sql); while($rs=mysql_fetch_array($result)){ $id_prd=$rs[id_prd]; $code=sprintf("%05d",$id_prd); $name_prd=$rs[name_prd]; $detail_prd=$rs[detail_prd]; $ref_id_type=$rs[ref_id_type]; $price_prd=$rs[price_prd]; $photo_prd=$rs[photo_prd]; if ($photo_prd==""){ $photo_prd="temp.jpg"; } echo "<tr> <td width='20%' valign='top'> <img src='photo/$photo_prd' width='200'> </td> <td width='80%' valign='top'> <b>รหัสสินค้า :</b>$code<br> <b>ชื่อสินค้า :</b>$name_prd<br> <b>ราคา :</b>$price_prd บาท<br><br> [<a href='prd_view.php?id_prd=$id_prd'>แสดงรายละเอียด</a>] [<a href='basket_add.php?id_prd=$id_prd'>หยิบใส่ตะกร้า</a>]<br> </td> </tr>"; } ?> </table> </td> </tr> </table> </body> </html>
<TABLE cellSpacing=0 cellPadding=0 width="95%" border=0> <TBODY> <TR> <TD align=left width=18 rowSpan=2></TD> <TD width="9" vAlign=top> </TD> <TD width="408" height="22" valign="top"> <span class="style1"><?="$catalogs[name]"?>.</span></TD> <TD width="418" vAlign=top> </TD> <TD align=right width=22 rowSpan=2></TD> </TR> <TR> <TD colspan="3" vAlign=top> <?PHP include("connect.php"); $table="tbl_web_news"; echo "<table><tr>"; $sql = "select * From $table;"; $Per_Page =4; /* ตั้งค่า แสดงผลต่อหน้า $Per_Page */ if(!$Page) $Page=1; $Prev_Page = $Page-1; $Next_Page = $Page+1; $result = mysql_query($sql); $Page_start = ($Per_Page*$Page)-$Per_Page; $Num_Rows = mysql_num_rows($result); 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; if(($Page>$Num_Pages) || ($Page<0)) print "<center><b>จำนวน $Page มากกว่า $Num_Pages เกิดการผิดพลาด<b></center>"; $sql = "select * From $table WHERE is_show=1 AND status=1 order by id asc LIMIT $Page_start , $Per_Page"; //ส่วนแสดงผล $result = mysql_query($sql); While($row= mysql_fetch_array($result)) { $icon[]=$row["icon"]; $news_id[] = $row["id"]; $topic[] = $row["topic"]; $time[]=$row["time"]; } echo"<table><tr>"; for($i=0;$i<count($news_id);$i++) { if($i%2==1) { // กรณี้มีตัวเดียว echo "<td>"; ?> <table width="280" cellspacing="0" cellpadding="0"> <tr> <td width="50" valign="middle"> <div align="center"><img src="admin/content/files/news/<?="$icon[$i]"?>" width="50" height="50"/> </div></td> <td width="5" valign="top"><a href="#"><strong> </strong></a></td> <td width="188" valign="top"><a href="?modul=news&id=<?="$news_id[$i]"?>"><?="$topic[$i]"?></a><br>[<?="$time[$i]"?>]</td> </tr> </table> <? echo"</td></tr>"; } else { //กรณีมี 2 ตัว echo "<td>"; ?> <table width="280" cellspacing="0" cellpadding="0"> <tr> <td width="54" valign="middle"> <div align="center"><img src="admin/content/files/news/<?="$icon[$i]"?>" width="50" height="50"/> </div></td> <td width="5" valign="top"><a href="#"><strong> </strong></a></td> <td width="188" valign="top"><a href="?modul=news&id=<?="$news_id[$i]"?>"><?="$topic[$i]"?></a><br>[<?="$time[$i]"?>]</td> </tr> </table> <? echo"</td>"; } } echo"</tr></table>"; mysql_close(); ?> <br> <div align="right"><br> <? if($Num_Rows>4){ print("<a href=\"?status=news\">ข่าวอื่นๆ >></a>"); } ?> </div></TD> </TR> <TR vAlign=bottom> <TD height=13 colspan="5"> </TD> </TR> </TBODY> </TABLE>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง