/home/bjcompany/domains/benjabhorn.com/public_html/BJconcrete/control/product.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
  <?php include("phpconfig.php")?>
  <?php
                
if(($_GET['MainCate']!="")&&($_GET['product']!="")){ 
                
                        echo 
"<!--<script> LoadDetail(".$_GET['product'].")</script> -->";    
                            
$_GET['id']=$_GET['product'];
                }else  if((
$_GET['MainCate']!="")&&($_GET['product']=="")){
                        
$query="SELECT * FROM tbl_product_data WHERE  mainCateId='".$_GET['MainCate']."' ORDER BY RAND() LIMIT 1  ";
                        
//echo $query." << 2";
                        
$result=mysql_query($query);
                        
$data=mysql_fetch_assoc($result);
                        
$_GET['id']=$data['id'];
                        
                }else  if((
$_GET['MainCate']=="")&&($_GET['product']=="")){ 
                        
                        
$query="SELECT * FROM tbl_product_data WHERE 1 ORDER BY RAND() LIMIT 1  ";
                        
$result=mysql_query($query);
                        
$data=mysql_fetch_assoc($result);
                        
                        
$_GET['id']=$data['id'];
                }
                 
$query="SELECT * FROM `tbl_product_data` WHERE id = '".$_GET['id']."' ";
                
$result=mysql_query($query);
                
$currentData=mysql_fetch_assoc($result);    
                
        
?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
<title><?php echo $currentData['product_name_th']?></title>
<meta property="og:url" content="http://www.bj.co.th/BJconcrete/product.php?MainCate=<?php echo $_GET['MainCate']?>&product=<?php echo $_GET['product']?>"/>


<meta property="og:site_name" content="เบญจพร คอนกรีต โปรดักส์"/>
<meta property="og:title" content="<?php echo $currentData['product_name_th']?> "/>
<meta property="og:image" content="http://www.bj.co.th/BJconcrete/images/bj_share.jpg"/>
<meta property="og:description" content="เบญจพร คอนกรีต โปรดักส์ ส่งมอบตรงเวลา  ลูกค้าพึงพอใจ  ใส่ใจในมาตรฐาน  มุ่งมั่นพัฒนางานและบุคลากรอย่างต่อเนื่อง "/>
 <!--------- code menu -------->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" href="css/font-awesome.css">
    <link rel="stylesheet" type="text/css" href="css/menu.css">
    
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/function.js"></script>
 <!--------- code menu -------->

 <!--------- code slide to top -------->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>

    <style>
    body {
    background: url(images/bg-top-detail.jpg) no-repeat top center; background-color:f5f5f5;  /* background-color:#2f2f2f;*/
    }
        div#page {
            max-width: 900px;
            margin-left: auto;
            margin-right: auto;
            padding: 2px;
        }
        
        .back-to-top {
            position: fixed;
            bottom: 0em;
            right: 0px;
            text-decoration: none;
            color: #000000;
/*            background-color: rgba(235, 235, 235, 0.80);
*/            font-size: 12px;
            padding: 0em;
            display: none;
        }

        .back-to-top:hover {    
/*            background-color: rgba(135, 135, 135, 0.50);
*/        }    
    </style>
 <!--------- code slide to top -------->

<script >
            function LoadDetail(productID){
                    if(productID!=""){  
                           $("#content").hide();
                        $("#content").load("showdetail.php?id="+productID , function(){
                            $(this).fadeIn(900);
                        });
                    }
                }
</script>

<title>asdf</title>
</head>

<body>
<center>
  <table width="1000" border="0" cellspacing="0" cellpadding="0" align="center" class="bg-content">
    <tr>
    <td width="700" align="left" valign="top" style="padding-left:10px;"><?php include("menu.php"); ?></td>
    <td width="223" align="right" valign="top"><img src="images/index/index_04.png" width="223" height="68" alt="" /></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top" width="1000" height="532" ><table width="1000" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="20" colspan="2" align="center" valign="bottom" >&nbsp;</td>
      </tr>
      <tr>
        <td height="20" colspan="2" align="center" valign="bottom" ><iframe src="SlideProduct/index-slide.php" width="800" height="260" frameborder="0" scrolling="no"></iframe></td>
        </tr>
      <tr>
        <td width="300" align="right" valign="bottom" class="txt-header     LR20">ผลิตภัณฑ์ | Products</td>
        <td width="700" align="center" valign="top">&nbsp;</td>
        </tr>
      <tr>
        <td align="left" valign="top" class="L40">&nbsp;</td>
        <td align="left" valign="top" class="txt-product-red">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="top" class="L30"  ><table width="250" border="0" cellspacing="0" cellpadding="0" c="c">
          <tr>
            <td height="5" bgcolor="#f92f00"></td>
          </tr>
         <?php mysql_data_seek($resultList,0);
         
                     while(
$menu=mysql_fetch_assoc($resultList)){  
                              
$countProduct CountProductInCate($menu['id']); ?>
          <tr>
            <td align="left" class="menu-left"><i class="icon-file-alt"></i><strong>&nbsp;<a href="product.php?MainCate=<?php echo $menu['id']?>"  id="white"><?php echo $menu['cate_name']." ";?></a></strong></td>
          </tr>
                     <?php  if($countProduct 0) { 
                                      
$query="SELECT id , product_name_th  FROM  `tbl_product_data` WHERE mainCateId='".$menu['id']."' ORDER BY   id DESC  ";
                                    
$result=mysql_query($query);
                                    
                                     while(
$data=mysql_fetch_assoc($result)) { 
                  
?> 
                                  <tr>
                                    <td align="left" class="menu-left"><ul>
                                      <a href="product.php?MainCate=<?php echo $menu['id']?>&product=<?php echo $data['id']?>"><li><?php echo $data['product_name_th']?></li></a>
                                    </ul></td>
                                  </tr>
                                  <?php }?>
                     <?php }?>
          <tr>
            <td height="5" bgcolor="#f92f00"></td>
          </tr>
          <?php }?>
          
        </table></td>
        <td align="left" valign="top" class="txt-product-red" >
        
        <!-- vvvvvvvvvvvvvvvvvvvv -->
<?php if($currentData['product_name_th']){  ?>
 <table width="700" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="5" bgcolor="#f92f00"></td>
          </tr>
          <tr>
            <td align="left" class="menu-left"><i class="icon-file-alt"></i><strong class="txt-product-red LRTB10"><?php echo $currentData['product_name_th']?></strong></td>
          </tr>
          <tr>
            <td align="center" bgcolor="#333333" class="LRTB20">
            <?php echo $currentData['product_detail_th']?>
            </td>
          </tr>
          <tr>
            <td bgcolor="#333333" align="center">
              <?php if($currentData['product_image']){?>

           <a href="<?php echo $uploadfolder.$currentData['product_image'];?>" target="_blank">
          <img src="<?php echo $uploadfolder.$currentData['product_image'];?>" alt="" /></a><br />
          <?php  ?>
            </td>
          </tr>
           <tr>
    <td bgcolor="#FFFFFF" style="padding-left:30px; padding-top:10px; padding-bottom:10px;">
    <div id="fb-root"></div>
      <script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/th_TH/sdk.js#xfbml=1&version=v2.3";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
      <div class="fb-share-button" data-href="http://www.bj.co.th/BJconcrete/product.php?MainCate=<?php echo $_GET['MainCate']?>&product=<?php echo $_GET['product']?>" data-layout="button"></div></td>
  </tr>
          <tr>
            <td   align="center">&nbsp;</td>
          </tr>
        </table>
       <?php } else {  ?>
 <table width="700" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="5" bgcolor="#f92f00"></td>
          </tr>
          <tr>
            <td align="left" class="menu-left"><i class="icon-file-alt"></i><strong class="txt-product-red LRTB10"><?php echo $currentData['product_name_th']?></strong></td>
          </tr>
        
          <tr>
            <td height="50" align="center" valign="middle" bgcolor="#333333"><h3 style="color:#FFF">ยังไม่มีผลิตภัณฑ์ในหมวดนี้</h3></td>
   </tr>
          <tr>
            <td bgcolor="#333333" align="center">&nbsp;</td>
          </tr>
 </table>       
       <?php mysql_close(); ?>
        
        <!-- vvvvvvvvvvvvvvvvvvvv -->
        </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top" >&nbsp;</td>
  </tr>
</table>
<?php include("footer.php"); ?>
<!--------- code slide to top -------->
         
        <div><a href="#" class="back-to-top"><img src="images/gotop01a.png" alt="" width="104" height="73" /></a></div>
       

  <script>            
            jQuery(document).ready(function() {
                var offset = 220;
                var duration = 500;
                jQuery(window).scroll(function() {
                    if (jQuery(this).scrollTop() > offset) {
                        jQuery('.back-to-top').fadeIn(duration);
                    } else {
                        jQuery('.back-to-top').fadeOut(duration);
                    }
                });
                
                jQuery('.back-to-top').click(function(event) {
                    event.preventDefault();
                    jQuery('html, body').animate({scrollTop: 0}, duration);
                    return false;
                })
            });
        </script>
 <!--------- code slide to top -------->

</center>
</body>
</html>