<?php require_once"config.inc.php";?> <?php require_once"top.inc.php";?> <?php require_once"function_page.php";?> <div id="maincontainer"> <? require_once"text.top.php";?> <!--Content --> <div id="contentwrapper"> <div id="contentcolumn"> <div class="innertube"><?php require_once"menu_content.php"; ?> <ul class="showInColumn_product" border="0"> <img src="images/product.jpg" border="0"/><br /> <? //select images again //$sql="SELECT * FROM `tb_products_detail` WHERE `id_brand`='".$_GET['id_brand']."' AND `id`='".$_GET['ids']."'"; //$sql="SELECT * FROM `tb_products_detail` WHERE id_brand='".$_GET['brand_id']."' AND `id_type`='".$_GET['type_id']."'"; $sql="SELECT * FROM `tb_products_detail` WHERE id_brand='".$_GET['brand_id']."'";// select 3 image $q=mysql_query($sql)or die (mysql_error()); echo $sql; while($rec=mysql_fetch_assoc($q)){ ?> <!--image --> <li style="margin:1px; padding:2px;"> <span><a href="products_detail.php?brand_id=<?=$rec['id_brand']?>&type_id=<?=$rec['id_type']?>"><img src="uploads/products_detail/<?=$rec["images"];?>"/></a> <!--download_file --> <div style="float:left;"><a href="download/<?=$rec["download_file"];?>"><img src="images/ic_pdf.gif" /></a></div> <div style="text-align:right;"><a href="products_detail.php?brand_id=<?=$rec['id_brand']?>&type_id=<?=$rec['id_type']?>"><?=$rec["title"];?></a></div></span> <? }//while //echo $sql; ?> </ul><!--showInColumn_product --> <!--<img src="images/switch_plug.jpg" /> --> <ul class="showInColumn_product_detail"> <li style="background:#99FF00; text-align:center; "><span>Product Code</span></li> <li style="background:#99FF00; text-align:center; width:300px;"><span>Description</span></li> <li style="background:#99FF00; text-align:center; width:100px;"><span>Brand</span></li> <li style="background:#99FF00; text-align:center; width:50px;"><span>Price</span></li> <li style="background:#99FF00; text-align:center; width:95px;"><span>Discount</span></li> <? //gen page //$page=(isset($_GET['page']))? intval($_GET['page']) : 1; $page=(isset($_GET['page']))? intval($_GET['page']."&"."brand_id=".$_GET["brand_id"]."&"."id_type=".$_GET["type_id"]) : 1 ."&"."brand_id=".$_GET["brand_id"]."&"."id_type=".$_GET["type_id"]; $limit_end=25; $limit_start=($page-1)*$limit_end; $send =""; if(isset($_GET["brand_id"]) and $_GET["type_id"] !="") { $send = "brand_id=".$_GET["brand_id"]."&"."id_type=".$_GET["type_id"]; //$send = "action=showDetail"."&"."brand_id=".$_GET["brand_id"]."&"."id_type=".$_GET["type_id"]; //$condition= "WHERE id_brand= '".$_GET["brand_id"] ."' AND id_type='".$_GET['type_id']."'"; //$condition= "WHERE `id_brand`= '".$_GET["brand_id"] ."'"; } //echo $send; //$sqlcommand="SELECT * FROM `tb_products_details`".$condition."ORDER BY id DESC"; $sqlcommand="SELECT * FROM `tb_products_details` WHERE id_brand= '".$_GET["brand_id"]."' AND id_type= '".$_GET["type_id"]."' ORDER BY id DESC"; //$sqlcommand="SELECT * FROM `tb_products_details` WHERE id_brand= '".$_GET["brand_id"]."' AND id_type= '4' ORDER BY id DESC"; $result =mysql_query($sqlcommand." LIMIT ".$limit_start.",".$limit_end,$conn)or die(mysql_error()); echo $sqlcommand; //echo " type_id :".$_GET['type_id']; $count = mysql_num_rows($result); $total = mysql_num_rows(mysql_query($sqlcommand,$conn)); //echo $total; if($total > 0) { while($recs=mysql_fetch_assoc($result)){ ?> <li><span><?=$recs['product_code']?></span></li> <li style="width:300px;"><span><?=$recs['description']?></span></li> <li style="width:100px; text-align:center;"><span><?=$recs['brand']?></span></li> <li style="width:50px;"><span><?=$recs['price']?></span></li> <li style="width:95px;"><span><?=$recs['discount']?></span></li> <? }//while ?> <div style="float:left;"><span>Page : <?=page_navi($page, $limit_end, 4, $total, $send)?></span></div> <div style="float:right; width:100px; margin-right:25px;"><span>[ <?=($limit_start+1)?>-<?=($limit_start+$count)?> ] of <strong> <?=$total?> </strong> items</span></div> </ul> <!--showInColumn_product_detail --> <? }//if ?> </div> </div> </div> <!--Left --> <? require_once"leftmenu.php";?> <!--footer --> <? require_once"footer.php";?> </div><!--maincontainer --> </body> </html>
$page=(isset($_GET['page']))? intval($_GET['page']."&"."brand_id=".$_GET["brand_id"]) : 1."&"."brand_id=".$_GET["brand_id"];
$page=(isset($_GET['page']))? intval($_GET['page']."&".brand_id=".$_GET['brand_id']."."&".id_type=".$_GET['type_id'].") : 1
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง