<? include "connect.php"; $id=$_GET[id]; $sql= "select * from tb_product where sup_id ='$id' "; $sqlquery=mysql_db_query($dbname,$sql); while($result= mysql_fetch_array($sqlquery)){ if($bg == "#F8FAEF") { //ส่วนของการ สลับสี $bg = "#D2DDD2"; } else { $bg = "#F8FAEF"; } $id=$result['p_id']; $code=sprintf("P%04d",$id); $name=$result['p_name']; $name2=$result['p_name2']; $qty=$result['p_qty']; $cost=$result['p_cost']; $type=$result['p_type']; $sqltype= "select * from tb_type where t_id='$type' "; $sqlquerytype=mysql_db_query($dbname,$sqltype); $result4= mysql_fetch_array($sqlquerytype); $tname=$result4['t_name']; $detail=$result['p_detail']; $spechee=$result['p_spechee']; $sqlspechee= "select * from tb_spechee where s_id='$spechee' "; $sqlqueryspechee=mysql_db_query($dbname,$sqlspechee); $rs1= mysql_fetch_array($sqlqueryspechee); $specheename=$rs1['s_name']; $price=$result['p_price']; $qty=$result['p_qty']; $img=$result['p_images']; $size=$result['p_size']; $supplier=$result['sup_id']; $sqlsup= "select * from tb_supplier where sup_id='$supplier' "; $sqlquerysup=mysql_db_query($dbname,$sqlsup); $rs= mysql_fetch_array($sqlquerysup); $supname=$rs['sup_name']; ?> <tr align="center" bgcolor="<?=$bg?>" class="normal_font"> <td height="25" scope="row"><span class="style29"> <?=$code;?> </span></td> <td align="center" scope="row"><span class="style29"> <?=$name;?> ( <?=$name2;?> ) </span></td> <td width="121" scope="row"><span class="style29"> <?=$tname;?> </span></td> <td scope="row"><span class="style29"> <?=$supplier;?> </span></td> <td width="113" scope="row"><span class="style29"> <?=$specheename;?> </span></td> <td align="center" scope="row"><span class="style29"> <?=$qty;?> </span></td> <td align="center" scope="row"><span class="style29"> <?echo number_format($cost,2,'.',',');?> </span><span class="style29"></a></span></td> <th scope="row"><a href="buy.php?id=<?=$id;?>?supid=<?=$supplier?>"><img src="icon/basket_full.gif" width="20" height="20" border="0" /></a></th> <? } ?>
<? session_start(); $id=$_GET['id']; $sid=$_GET['sid']; .........ค่า id ของ ตัวแทนจำหน่ายสินค้า ผมจะเก็บยังไงดีให้ไปทำงานต่ออีกที่หน้า cart if(count($sess_id1)=="0"){ $check=1; }else if (!in_array($id,$sess_id1)){ $check=1; } if($check==1){ include "connect.php"; $sql="select * from tb_product where p_id='$id' "; $result=mysql_db_query($dbname,$sql); $rs=mysql_fetch_array($result); $_SESSION['sess_id1'][]=$rs[p_id]; $_SESSION['sess_name1'][]=$rs[p_name]; $_SESSION['sess_sup1'][]=$rs[sup_id]; $_SESSION['sess_cost1'][]=$rs[p_cost]; $_SESSION['sess_num1'][]=1; $_SESSION['sess_vat']; } echo"<meta http-equiv=\"refresh\"content=\"0;URL=cart.php\" />"; ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง