<? $spare_type_id_select=$_GET[spare_type_id]; include "connect.php"; $count=0; ?> <html> <head> <title>SA AUTO</title> <style type="text/css"> <!-- .style1 {color: #FF0000} .style2 { color: #0066FF; font-weight: bold; } .style6 {color: #0099CC} .style5 { color: #3300CC; font-weight: bold; } --> </style> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"></head> <body> <blockquote> <blockquote> <blockquote> <blockquote> <div align="center"><a href="index.php">กลับหน้าหลัก</a></div> </blockquote> </blockquote> </blockquote> </blockquote> <table width=807 border=1 align="center" cellpadding="1" cellspacing="1" bordercolor="#0066CC"> <!--DWLayoutTable--> <tr> <td height=200 valign="top" bgcolor="#FFFFCC"><div align=center> <table width="100%" border=1 cellspacing=4> <? $sql = "select * from categories where ref_spare_type_id='$spare_type_id_select'"; $result=mysql_db_query($dbname,$sql); $count=0; echo "<TABLE width='800' border='1' BGCOLOR=#C2EAF1><TR>"; while ($rs=mysql_fetch_array($result)) { $id =$rs[id ]; $code_product=sprintf("%05d",$id ); $product_id=$rs[product_id]; $barcode_id =$rs[barcode_id]; $deception =$rs[deception ]; $unitname =$rs[unitname ]; $pro_pice =$rs[pro_pice ]; $ref_car_id =$rs[ref_car_id]; $ref_spare_type_id =$rs[ref_spare_type_id]; $photo_prd =$rs[photo_prd ]; if ($photo_prd ==""){ $photo_prd ="tmp.jpg"; } echo " <TD VALIGN='top'> <IMG SRC='picture/$photo_prd' WIDTH='150' hieght='100' align='center'></TD> <TD WIDTH='70%' VALIGN='top'> <B>บาร์โค้ดสินค้า :</B> $barcode_id <BR> <B>รหัสสินค้า :</B> $product_id <BR> <B>ชื่อสินค้า : </B>$deception <BR> <B>ราคา :</B> $pro_price บาท<BR><BR> [ <A HREF='product_view.php?id=$id'>รายละเอียด </A>] <BR> </TD>"; $count++; if($count%2==0) // ถ้าครบ 2 ตารางให้ไปต่อด้านล่าง echo"</TR>"; } echo "</TABLE>"; ?> </table></td> </tr> </table> </body> </html>
<html> <head> <title>ThaiCreate.Com Tutorial</title> </head> <body> <? $objConnect = mysql_connect("localhost","root","root") or die(mysql_error()); $objDB = mysql_select_db("mydatabase"); $strSQL = "SELECT * FROM gallery"; $objQuery = mysql_query($strSQL); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 4; // Per Page $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); 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; } $strSQL .=" order by GalleryID ASC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); echo"<table border=\"0\" cellspacing=\"1\" cellpadding=\"1\"><tr>"; $intRows = 0; while($objResult = mysql_fetch_array($objQuery)) { echo "<td>"; $intRows++; ?> <center> <img src="shotdev/<?=$objResult["Picture"];?>"><br> <?=$objResult["GalleryName"];?> <br> </center> <? echo"</td>"; if(($intRows)%2==0) { echo"</tr>"; } } echo"</tr></table>"; ?> <br> Total <?= $Num_Rows;?> Record : <?=$Num_Pages;?> Page : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> "; } ?> </body> </html> <? mysql_close($objConnect); ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง