include_once('config/config.inc.php');
if($_GET['cat_id']){
$sql="select * from category where sub_id=".$_GET['cat_id']." and cat_status='A'";
///// title ///////////////////////////////////////////////////////////////////////////////////
$y=0;
$parentId = $_GET['cat_id'];
//echo $parentId ;
while ($parentId > 0)
{
if ($_GET['lang'] == "en"){
$sql11 = "select cat_id,sub_id,cat_name_en from category where cat_id=$parentId";
}else{
$sql11 = "select cat_id,sub_id,cat_name_th from category where cat_id=$parentId";
}
//echo $sql11."
"; $rs11 = mysql_query($sql11); $lineTitle = mysql_fetch_array($rs11); //echo $lineTitle['sub_id']; $b_name= $lineTitle['cat_name_th'].$lineTitle['cat_name_en']; $parentId = $lineTitle['sub_id']; //echo $parentId; //echo "y=".$y; $title=$lineTitle['cat_id']; $nameTitle[$y]= "".$b_name." > "; $y++; } //echo $nameTitle; if($y!=0){ //$y=$y-1; while($y>=0){ //echo $y; //echo $bid[$x]; $nameTitle1.= $nameTitle[$y]; $y--; } } //$traceStr=implode("/",$b_name); print "";
print "
";
}else{
$sql="select * from category where sub_id=0 and cat_status='A'";
echo "
";
}
$rs=mysql_query($sql);
/// row product
$line=mysql_num_rows($rs);
if($line==0){
////////////////////////////////////
$pagelen = 10; //จำนวนที่แสดงผลข้อมูลต่อหน้า
$range = 5 ; // ใส่จำนวนที่จะแสดงข้าง เลขปัจจุบัน ก็คือ ถ้าใส่ 2 แล้ว ตอนนี้แสดงอยู่หน้า 4 ก็จะเป็น 2 3 4 5 6 จะแสดงข้างเลข 4 อยู่ 2 จำนวน
$page = $_GET['page']; //รับค่าตัวแปร page แบบ get
if(empty($page)){
$page=1;
} //ถ้าตัวแปรเพจยังไม่มี ให้ค่าเริ่มต้นของ $page เป็น 1
$goto = ($page-1) * $pagelen; // หาหน้าที่จะกระโดดไป
//////////////////////////////////////////////////
$sql_row="select p_id from product where p_status='A' and cat_id=".$_GET['cat_id'];
//echo $sql_row;
$rs=mysql_query($sql_row);
$num_rows=mysql_num_rows($rs);
if($num_rows==0){
echo "
\n",1); $sql="select *,substring_index(p_desc_th,'
\n",1); $sql="select *,substring_index(p_desc_en,'
$c=0;
while($row=mysql_fetch_array($pro)){
//if($c%2==0){echo "";}
$data=$row['p_data'];
$data = explode("|", $data);
//echo $row['p_id'];
//echo $data[0]."
Page :
if($page > 1) {
$back = $page - 1;
echo "<<";
}
if ($page > 1) {
$back = $page - 1;
//echo ""."แรกสุด\n";
// echo "ก่อนหน้า";
if ($start > 1) {
echo " 1.. ";
}
}
For ($i=$start ; $i<=$end ; $i++) {
if ($i == $page ) {
echo "| $i |";
} else {
echo " $i ";
}
}
if ($page < $totalpage) {
$next = $page +1;
if ($end < $totalpage) {
echo ">>";
}
}
?>
}
}else{
$s=1;
while($row=mysql_fetch_array($rs)){
?>
&lang==$_GET['lang']?>'> if($_GET['lang']=='th') echo $row['cat_name_th']; else echo $row['cat_name_en']; ?>
if($_GET['lang']=='th') echo $row['cat_desc_th']; else echo $row['cat_desc_en'];?>
if($s%2==0){
?>
}
$s++;
}
}
?>
"; $rs11 = mysql_query($sql11); $lineTitle = mysql_fetch_array($rs11); //echo $lineTitle['sub_id']; $b_name= $lineTitle['cat_name_th'].$lineTitle['cat_name_en']; $parentId = $lineTitle['sub_id']; //echo $parentId; //echo "y=".$y; $title=$lineTitle['cat_id']; $nameTitle[$y]= "".$b_name." > "; $y++; } //echo $nameTitle; if($y!=0){ //$y=$y-1; while($y>=0){ //echo $y; //echo $bid[$x]; $nameTitle1.= $nameTitle[$y]; $y--; } } //$traceStr=implode("/",$b_name); print "
";
echo "![]() Category: $nameTitle1"; print " | ";
print "
![](\"images/titleproduct.jpg\")
Sorry ..No data !
If you want some information ,Please contact us.
";
}else{
$totalpage = ceil($num_rows / $pagelen);
//echo $num_rows;
$start = $page - $range;
$end = $page + $range;
if ($start <= 1) {
$start = 1;
}
if ($end >= $totalpage) {
$end = $totalpage;
}
if($_GET['lang']=='th') {
//echo wordwrap($row['substr'],60,"If you want some information ,Please contact us.
\n",1); $sql="select *,substring_index(p_desc_th,'
',1) as substr from product where cat_id=".$_GET['cat_id']." and p_status='A' order by p_id asc limit $goto,$pagelen"; }else{ //echo wordwrap($row['substr'],60,"
\n",1); $sql="select *,substring_index(p_desc_en,'
',1) as substr from product where cat_id=".$_GET['cat_id']." and p_status='A' order by p_id asc limit $goto,$pagelen"; } //echo $sql; $pro=mysql_query($sql); $proLine=mysql_num_rows($pro); ?>
&p_id==$row['p_id']?>&lang==$_GET['lang']?>'> if($_GET['lang']=='th') echo $row['p_name_th']; else echo $row['p_name_en'];?> | |
&p_id==$row['p_id']?>&lang==$_GET['lang']?>'> if($row['p_standard']!=""){ $gotStand=$row['p_standard']; $stan=explode(",",$gotStand); //echo sizeof($stan); for($i=1;$i<=sizeof($stan);$i++){ $x=$i-1; $sqlStandard="select * from standard where stan_id=".$stan[$x]; //echo $x.".".$sqlStandard; $rsStand=mysql_query($sqlStandard); $standImage=mysql_fetch_array($rsStand); $showStand[$i]=$standImage['stan_image']; //$showName[$i]=$standImage['stan_name']; } for($i=1;$i<=count($showStand);$i++){ echo " |
//if($_GET['lang']=='th') {
//echo wordwrap($row['substr'],60," \n",1); //echo $row['substr']; //}else{ //echo wordwrap($row['substr'],60," \n",1); echo $row['substr']; //} ?> &p_id==$row['p_id']?>&lang==$_GET['lang']?>'>
|
![](images/navimg.gif)
if($_GET['lang']=='th') echo $row['cat_desc_th']; else echo $row['cat_desc_en'];?>
-
3builders
3/3 Moo 2, Tiwanon Rd.,
Bangklang, A. Muang,
Pathumthani, Thailand,
12000. -
Fax : +66 (0) 2979 2984
Mobile : 089 444 8875
Email : 3builders@polysource.co.th
-
3builders
3/3 หมู่ 2, ถนนติวานนท์,
บ้านกลาง อ.เมือง,
ปทุมธานี 12000 -
แฟกซ์ : +66 (0) 2979 2984
มือถือ : 089 444 8875
อีเมลล์ : 3builders@polysource.co.th
3Builders - Reliability in Customer Engineering.
![](images/titlemix.jpg)
|
| ||||||
![](images/bottommix.jpg)