/var/www/(Del)yuecreations.com.hk/en/products.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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<?php require_once('../webadmin/configure.php');
$ProductColourId     = (int)$_GET['ProductColourId'];
$ProductCatId         = (int)$_GET['ProductCatId'];
$ProductGradeId     = (int)$_GET['ProductGradeId'];
$Page                 = (int)$_GET['Page'];

if(!
$ProductColourId)
{
    
header('Location: home.php');
}
//echo ">".basename($_SERVER['PHP_SELF'])."?".$_SERVER['QUERY_STRING'];
?>
<!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" />
<title>Yue Creations International Limited</title>
<meta name="keywords" content="Yue Creations International Limited">
<meta name="description" content="Yue Creations International Limited" />
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<!-- Main Menu -->
<script type="text/javascript" src="dropdowntabfiles/dropdowntabs.js"></script>
<link rel="stylesheet" type="text/css" href="dropdowntabfiles/glowtabs.css" />
<!-- End Main Menu -->

<!-- Sub Menu -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="submenu/ddaccordion.js"></script>
<script type="text/javascript" src="submenu/ddaccordion-function.js"></script>
<link rel="stylesheet" type="text/css" href="submenu/ddaccordion.css" />
<!-- End Sub Menu -->
</head>

<body>
<table width="1000" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="60" id="frameleft">&nbsp;</td>
    <td width="880" align="left" valign="top" bgcolor="#FFFFFF"><table width="880" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="40" align="left" valign="top"><img src="../images/header_left.jpg" width="40" height="92" /></td>
        <td width="800" align="left" valign="top" id="header_bg"><div class="header_lang"><a >English</a>&nbsp;&nbsp;&#8226;&nbsp;&nbsp;<a href="../tc/<?=basename($_SERVER['PHP_SELF'])."?".$_SERVER['QUERY_STRING'];?>">中文</a></div><a href="index.php"><img src="../images/header_logo_en.jpg" width="461" height="92" border="0" /></a></td>
        <td width="40" align="left" valign="top"><img src="../images/header_right.jpg" width="40" height="92" /></td>
      </tr>
      <tr>
        <td align="left" valign="top"><img src="../images/mainmenu_left.jpg" width="40" height="33" /></td>
        <td align="left" valign="bottom" id="mainmenu_bg"><!-- Main Menu -->
        <div id="glowmenu" class="glowingtabs">
        <ul>
        <li><a href="home.php"><span>Home</span></a></li>        
        <li><a rel="aboutus_dropmenu"><span>About Us</span></a></li>        
        <li><a href="news.php"><span>News</span></a></li>        
        <li><a rel="product_dropmenu"><span>Product Catalogue</span></a>
        <li><a href="contactus.php"><span>Contact Us</span></a></li>
        </ul>
        </div>        
        
        <!--aboutus drop down menu -->                                                   
        <div id="aboutus_dropmenu" class="dropmenudiv_d">
        <?php
            $aboutResult 
mysql_query("SELECT * FROM Aboutus ORDER BY Aboutus.AboutusSort ASC  ");                
            while (
$aboutus mysql_fetch_array($aboutResult,MYSQL_ASSOC))
            {    
        
?>         
            <a href="aboutus.php?AboutusId=<?=$aboutus{'AboutusId'};?>"><?=$aboutus{'AboutusTitleen'};?></a>
            
        <?php ?></div>
        
        <!--product drop down menu-->  
        <div id="product_dropmenu" class="dropmenudiv_d">                 
        <?php
            $pcResult 
mysql_query("SELECT * FROM ProductColour ORDER BY ProductColour.Sort ASC ");                
            while (
$pc mysql_fetch_array($pcResult,MYSQL_ASSOC))
            {                    
        
?>       
            <a href="products.php?ProductColourId=<?=$pc{'ProductColourId'};?>"><?=$pc{'DescEN'};?></a>
        <?php ?></div>
        <script type="text/javascript">
        //SYNTAX: tabdropdown.init("menu_id", [integer OR "auto"])
        tabdropdown.init("glowmenu", "auto")
        </script>
        
        <!-- End Main Menu --></td>
        <td align="left" valign="top"><img src="../images/mainmenu_right.jpg" width="40" height="33" /></td>
      </tr>
      <tr>
        <td align="left" valign="top"><img src="../images/banner_left.jpg" width="40" height="300" /></td>
        <td align="left" valign="top" id="bannerimg"><img src="../images/banner_image.jpg" width="800" height="280" /></td>
        <td align="left" valign="top"><img src="../images/banner_right.jpg" width="40" height="300" /></td>
      </tr>
      <tr>
        <td height="350" align="left" valign="top"><img src="../images/submenu_left.jpg" width="40" height="200" /></td>
        <td align="left" valign="top"><table width="800" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="200" align="left" valign="top"><table width="200" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td><img src="../images/submenu_product.jpg" width="200" height="60" /></td>
              </tr>
              <tr>
                <td><div class="glossymenu">
                <?php
                $result1 
mysql_query("
                            SELECT * 
                            FROM ProductCat 
                            WHERE ProductCat.ProductColourId =  '"
.$ProductColourId."' 
                            ORDER BY ProductCat.Sort ASC, ProductCat.ProductCatId ASC"
);    
        
                while (
$row1 mysql_fetch_array($result1,MYSQL_ASSOC))    
                {                    
                    
//echo "SELECT * FROM ProductGrade WHERE ProductGrade.ProductCatId =  ".$row1{'ProductCatId'} ;
                    
if( mysql_num_rows(mysql_query("SELECT * FROM ProductGrade WHERE ProductGrade.ProductCatId =  ".$row1{'ProductCatId'} )) > 0)
                    {
                        echo 
'<a class="menuitem submenuheader" >'.$row1{'DescEN'}.'</a>';
                        echo 
'<div class="submenu"><ul>';
                        
                        
$result2 mysql_query("
                        SELECT * 
                        FROM ProductGrade 
                        WHERE ProductGrade.ProductCatId =  '"
.$row1{'ProductCatId'}."' 
                        ORDER BY ProductGrade.Sort ASC, ProductGrade.ProductGradeId ASC"
);    
                        
                        while (
$row2 mysql_fetch_array($result2,MYSQL_ASSOC))    {            
                        
                            echo 
'<li><a href="products.php?ProductColourId='.$ProductColourId.'&amp;ProductGradeId='.$row2{'ProductGradeId'}.'">'.$row2{'DescEN'}.'';
                            echo 
'</a></li>';
                        }
                        echo 
'</ul></div>';
                    }
                }
                
?>    
                </div>                </td>
              </tr>
            </table></td>
            <td width="50" align="left" valign="top"><img src="../images/submenu_right.jpg" width="50" height="200" /></td>
            <td width="550" align="left" valign="top"><table width="550" border="0" cellpadding="0" cellspacing="0">
              <tr>
                  <?php
                  
if($ProductColourId)
                  {
                      
//echo "ColourID=".$ProductColourId;
                      
$result3 mysql_query("SELECT * FROM ProductColour WHERE ProductColour.ProductColourId =  '".$ProductColourId."'");
                      
$row3 mysql_fetch_array($result3,MYSQL_ASSOC);
                  }
                  
                  
$result4 mysql_query("SELECT * FROM ProductGrade WHERE ProductGrade.ProductGradeId =  '".$ProductGradeId."'");    
                  
$row4 mysql_fetch_array($result4,MYSQL_ASSOC);        
                
?>
                <td align="left" valign="top" class="pathtxt">Location : <a href="home.php">Home</a> &gt; Product Catelogue &gt; <?=$row3{'DescEN'};?> </td>
              </tr>
              <tr>
                <td align="left" valign="top" class="pagetitle"><?=$row4{'DescEN'};?> <div align="right">
                <div class="pagetxt">&lt; 
                <?php
                    
//Page counter
                    
if ($ProductGradeId<>0)
                    {
                        
$sql "SELECT COUNT(*) 
                                FROM Product AS p
                                    Inner Join ProductGrade AS pg ON p.ProductGradeId = pg.ProductGradeId                                
                                WHERE pg.ProductGradeId = '"
.$ProductGradeId."'";
                    }
                    elseif (
$ProductCatId<>0)
                    {
                        
$sql "SELECT COUNT(*) 
                                FROM Product AS p
                                    Inner Join ProductGrade AS pg ON p.ProductGradeId = pg.ProductGradeId
                                    Inner Join ProductCat AS pc ON pg.ProductCatId = pc.ProductCatId
                                WHERE pc.ProductCatId = '"
.$ProductCatId."'";
                    }
                    elseif (
$ProductColourId<>0)
                    {
                        
$sql "SELECT COUNT(*)  
                                FROM Product AS p
                                    Inner Join ProductGrade AS pg ON p.ProductGradeId = pg.ProductGradeId
                                    Inner Join ProductCat AS pc ON pg.ProductCatId = pc.ProductCatId
                                    Inner Join ProductColour AS pcol ON pc.ProductColourId = pcol.ProductColourId
                                WHERE pcol.ProductColourId =  '"
.$ProductColourId."'";
                    }            
                    
//echo "<br>".$sql."<br>";
                    
$NumResult mysql_query($sql);    
                    
$NumEntryResult mysql_fetch_array($NumResult,MYSQL_ASSOC);
                    
$NumEntry $NumEntryResult{'COUNT(*)'};
                    
                    
$thumbnailPerPage 9;
                    
$currentPage 1;    
                    
                    if (
$Page == '' || $Page == '0'
                        
$Page=1
                        
                    
// Print PageNumber                
                    
do{
                        if (
$currentPage == $Page)
                        {
                            echo 
$currentPage++;
                            echo 
"&nbsp;";
                        }
                        else
                        {
                            echo 
'<a href="'.basename($_SERVER['PHP_SELF']).'?ProductColourId='.$ProductColourId.'&ProductGradeId='.$ProductGradeId.'&Page='.$currentPage.'"">';
                            echo 
$currentPage++;
                            echo 
"</a>&nbsp;";
                        }
                        
$NumEntry -= $thumbnailPerPage;
                    }while (
$NumEntry>0)                    
                
?>&gt; </div></td>
              </tr>
              <tr>
                <td height="25" align="left" valign="top"><img src="../images/line.jpg" width="550" height="10" /></td>
              </tr>
              <tr>
                <td align="left" valign="top" class="pagetxt"><!-- Product Image -->
                    
                <?php 
                    $PageIndex 
$Page 1;    
                    if (
$PageIndex<0)
                    {
                        
$PageIndex 0;
                    }
                    
                    
$thumbnailIndex $PageIndex $thumbnailPerPage;                    
                    
                    if (
$ProductGradeId)
                    {
                        
$sql "SELECT p.ProductId, p.NameEN, p.Sort, p.NameTC, p.DescEN, p.DescTC, p.Hotproduct, p.ImagePath 
                                FROM Product AS p
                                    Inner Join ProductGrade AS pg ON p.ProductGradeId = pg.ProductGradeId                                
                                WHERE pg.ProductGradeId = '"
.$ProductGradeId."' 
                                ORDER BY p.Sort ASC, p.ProductId ASC
                                LIMIT "
.$thumbnailIndex.", ".$thumbnailPerPage;
                    }
                    elseif (
$ProductCatId)
                    {
                        
$sql "SELECT p.ProductId, p.NameEN, p.Sort, p.NameTC, p.DescEN, p.DescTC, p.Hotproduct, p.ImagePath 
                                FROM Product AS p
                                    Inner Join ProductGrade AS pg ON p.ProductGradeId = pg.ProductGradeId
                                    Inner Join ProductCat AS pc ON pg.ProductCatId = pc.ProductCatId
                                WHERE pc.ProductCatId = '"
.$ProductCatId."' 
                                ORDER BY p.Sort ASC, p.ProductId ASC
                                LIMIT "
.$thumbnailIndex.", ".$thumbnailPerPage;
                    }
                    elseif (
$ProductColourId)
                    {
                        
$sql "SELECT p.ProductId, p.NameEN, p.Sort, p.NameTC, p.DescEN, p.DescTC, p.Hotproduct, p.ImagePath  
                                FROM Product AS p
                                    Inner Join ProductGrade AS pg ON p.ProductGradeId = pg.ProductGradeId
                                    Inner Join ProductCat AS pc ON pg.ProductCatId = pc.ProductCatId
                                    Inner Join ProductColour AS pcol ON pc.ProductColourId = pcol.ProductColourId
                                WHERE pcol.ProductColourId =  "
.$ProductColourId."
                                ORDER BY p.Sort ASC, p.ProductId ASC
                                LIMIT "
.$thumbnailIndex.", ".$thumbnailPerPage;
                    }
                
//echo $sql;
                
$result5 mysql_query($sql);    

                
$currentcol=0// value= [0,1,2]                
                
print'<table border="0" cellpadding="0" cellspacing="0">';                
                while (
$product mysql_fetch_array($result5,MYSQL_ASSOC))    {    
                    
//echo "current= ".$currentcol%3;
                    
if($currentcol == 0){ // new row
                        
print '<tr>';
                    }
                    print 
'<td align="center" valign="middle">';                
                    print
'<div class="producttable"><table border="0" cellpadding="0" cellspacing="0"> <tr>';
                    
$size getimagesize("../webadmin/product/".$product{'ImagePath'}) ;
                    
//echo"File = $size[0], $size[1] <br/>";
                    
if($size[0] >$size[1]){ // 0=w 1=h
                        
print '<td align="center" valign="middle" ><a href="products_detail.php?ProductId='.$product{'ProductId'}.'">';
                        print 
'<img src="../webadmin/product/'.$product{'ImagePath'}.'" width="170" /></a></td>';
                    }
                    else{
                        print 
'<td align="center" valign="middle" ><a href="products_detail.php?ProductId='.$product{'ProductId'}.'">';
                        print 
'<img src="../webadmin/product/'.$product{'ImagePath'}.'" height="170" /></a></td>';
                    }
                    print 
'</tr></table></div>';                    
                    print 
'</td>';                
                    
                    if(
$currentcol == 2){ //end of row
                        
print '</tr>';
                    }
                    
$currentcol++;                    
                }
                print 
'</table>';
                
?>                        

                <!-- End Product Image --></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td align="left" valign="top"><img src="../images/content_space.jpg" width="40" height="200" /></td>
      </tr>
      <tr>
        <td align="left" valign="top" id="footerleft">&nbsp;</td>
        <td align="center" valign="top" class="footer">© 2011 Yue Creations International Limited. All right reserved<br />
          Powered by <a href="http://www.onesolution.com.hk" target="_blank" /></a></a></a></a>One Solution Limited. <img src="../images/onesolutionlogo.jpg" width="90" height="15" align="absmiddle" /></td>
        <td align="left" valign="top" id="footeright">&nbsp;</td>
      </tr>
    </table></td>
    <td width="60" id="frameright">&nbsp;</td>
  </tr>
</table>
</body>
</html>