/var/www/(Del)explorer-island.com/old/en/gallery_detail.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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<?php require_once('../webadmin/configure.php');
        
$gcatid         = (int)$_GET['gcatid'];
        
$offset            $_GET["offset"];
        
$where            $_GET["where"]; ?>
<!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></title>
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<link rel="stylesheet" type="text/css" href="menu/jqueryslidemenu.css" />

<!--[if lte IE 7]>
<style type="text/css">
html .jqueryslidemenu{height: 1%;} /*Holly Hack for IE7 and below*/
</style>
<![endif]-->

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript" src="menu/jqueryslidemenu.js"></script>

<script type="text/javascript">
function AutoResizeImage(maxWidth,maxHeight,objImg){
if (typeof(objImg)=='string'){
objImg = $(objImg);
}
var img = new Image();
img.onload = function(){
var hRatio;
var wRatio;
var Ratio = 1;
var w = img.width;
var h = img.height;
wRatio = maxWidth / w;
hRatio = maxHeight / h;
wRatio = wRatio>1?1:wRatio;
hRatio = hRatio>1?1:hRatio;
if (maxWidth ==0 && maxHeight==0){
Ratio = 1;
}else if (maxWidth==0){//
if (hRatio<1) Ratio = hRatio;
}else if (maxHeight==0){
if (wRatio<1) Ratio = wRatio;
}else {
Ratio = (wRatio<=hRatio?wRatio:hRatio);
}
if (Ratio<1){
w = w * Ratio;
h = h * Ratio;
}
objImg.height = h;
objImg.width = w;
this.onload = function(){}
}
img.src = objImg.src;
}
</script>
<link rel="stylesheet" type="text/css" href="lightbox/css/jquery.lightbox-0.5.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="lightbox/js/jquery.lightbox-0.5.pack.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>

<body>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <!-- Start Header -->
  <tr>
    <td align="center" valign="top"><table width="1000" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="150" valign="top"><img src="../images/headerleft.jpg" width="150" height="225" /></td>
        <td width="700" align="left" valign="top" bgcolor="#FFFFFF"><table width="700" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="225" background="../images/header_bg.jpg" align="left" valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="180" align="left" valign="top"><div style="float:right; clear:both;"><a href="../en/gallery_detail.php?gcatid=<?=$gcatid;?>"><img src="../images/lang_en.jpg" width="43" height="26" border="0" /></a></div><a href="index.php"><img src="../images/logo.jpg" width="196" height="107" border="0" /></a></td>
              </tr>
              <tr>
                <td align="center" valign="top"><div id="myslidemenu" class="jqueryslidemenu">
                    <ul>
                        <?php
                            $sql 
"SELECT * ";
                            
$sql .= "FROM about ";
                            
$sql .= "ORDER BY pref ASC ";
                            
$result mysql_query($sql);
                            
$row mysql_fetch_array($result,MYSQL_ASSOC);
                            if (
mysql_num_rows($result) > ){
                                echo 
"<li><a href='about.php?aboutid="$row{'aboutid'} ."'>"$row{'abouttitleen'} ."</a>";
                                echo 
"<ul>";
                                
$sql "SELECT * ";
                                
$sql .= "FROM about ";
                                
$sql .= "ORDER BY pref ASC ";
                                
$sql .= "LIMIT 1,99 ";
                                
$result mysql_query($sql);
                                while (
$row mysql_fetch_array($result,MYSQL_ASSOC))
                                    {
                                    echo 
"<li><a href='about.php?aboutid="$row{'aboutid'} ."'><span>"$row{'abouttitleen'} ."</span></a></li>";
                                    }
                                echo 
"</ul></li>";
                            } else if (
mysql_num_rows($result) == ){                        
                                echo 
"<li><a href='about.php?aboutid="$row{'aboutid'} ."'>"$row{'abouttitleen'} ."</a></li>";
                            } 
                        
?>                        
                        <li><a href="whatsnew.php">What's New</a></li>
                        <li><a>Course</a>                            
                            <ul>
                            <?php
                                $sql 
"SELECT * ";
                                
$sql .= "FROM coursecat ";
                                
$sql .= "ORDER BY pref ASC ";
                                
$result1 mysql_query($sql);                    
                                while (
$row mysql_fetch_array($result1,MYSQL_ASSOC))
                                {
                                    echo 
'<li><a href="course.php?ccatid='$row{'ccatid'} .'"><span>'$row{'ccatnameen'} .'</span></a>';
                                    
$sqlx "SELECT * ";
                                    
$sqlx .= "FROM coursesub ";
                                    
$sqlx .= "WHERE ccatid = ".$row{'ccatid'};
                                    
$sqlx .= " ORDER BY pref ASC ";
                                    
$result2 mysql_query($sqlx);
                                    
//echo mysql_error();
                                    
if (mysql_num_rows($result2) > ){
                                        echo 
"<ul>";                
                                        while (
$row2 mysql_fetch_array($result2,MYSQL_ASSOC))
                                        {
                                        echo 
'<li><a href="course_detail.php?ccatid='$row{'ccatid'} .'&csubid='$row2{'csubid'} .'"><span>'$row2{'csubnameen'} .'</span></a></li>';
                                        }
                                        echo 
"</ul>";
                                    }
                                    echo 
'</li>';
                                }
                             
?>
                             </ul>
                        </li>
                        <?php
                            $sql 
"SELECT * ";
                            
$sql .= "FROM gallerycat ";
                            
$sql .= "ORDER BY gcatdate DESC, gcatid DESC ";
                            
$result2 mysql_query($sql);
                            
$row mysql_fetch_array($result2,MYSQL_ASSOC);
                            if (
mysql_num_rows($result2) >= ){
                                echo 
"<li><a href='gallery.php'>Gallery</a>";
                                echo 
"<ul>";
                                
$sql "SELECT * ";
                                
$sql .= "FROM gallerycat ";
                                
$sql .= "ORDER BY gcatdate DESC, gcatid DESC ";
                                
$result mysql_query($sql);
                                while (
$row mysql_fetch_array($result,MYSQL_ASSOC))
                                    {
                                    echo 
"<li><a href='gallery_detail.php?gcatid="$row{'gcatid'} ."'><span>"$row{'gcatnameen'} ."</span></a></li>";
                                    }
                                echo 
"</ul></li>";
                            } else if (
mysql_num_rows($result2) == ) {
                                echo 
"<li><a href='gallery.php'>Gallery</a></li>";
                            }
                        
?>                             
                        
                        <?php
                            $sql 
"SELECT * ";
                            
$sql .= "FROM policies ";
                            
$sql .= "ORDER BY pref ASC ";
                            
$result2 mysql_query($sql);
                            
$row mysql_fetch_array($result2,MYSQL_ASSOC);
                            if (
mysql_num_rows($result2) > ){
                                echo 
"<li><a href='policies.php?pid="$row{'pid'} ."'>"$row{'ptitleen'} ."</a>";
                                echo 
"<ul>";
                                
$sql "SELECT * ";
                                
$sql .= "FROM policies ";
                                
$sql .= "ORDER BY pref ASC ";
                                
$sql .= "LIMIT 1,99 ";
                                
$result mysql_query($sql);
                                while (
$row mysql_fetch_array($result,MYSQL_ASSOC))
                                    {
                                    echo 
"<li><a href='policies.php?pid="$row{'pid'} ."'><span>"$row{'ptitleen'} ."</span></a></li>";
                                    }
                                echo 
"</ul></li>";
                            } else if (
mysql_num_rows($result2) == ) {
                                echo 
"<li><a href='policies.php?pid="$row{'pid'} ."'>"$row{'ptitleen'} ."</a></li>";
                            }
                        
?><li><a href="career.php">Career</a></li>
                        <li><a href="contactus.php">Contact Us</a></li>
                    </ul>
                </div></td>
              </tr>
            </table></td>
          </tr>

        </table></td>
        <td width="150" valign="top"><img src="../images/headerright.jpg" width="150" height="225" /></td>
      </tr>
    </table></td>
  </tr>
  <!-- End Header -->
  <tr>
    <td align="center" valign="top"><table width="1000" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="150" valign="top" background="../images/leftbg.gif"><img src="../images/left.gif" width="150" height="535" /></td>
        <td align="left" valign="top" bgcolor="#FFFFFF" id="body"><table width="660" border="0" cellspacing="0" cellpadding="0">
          <?php
                  $sql 
"SELECT * ";
                
$sql .= "FROM galleryimg INNER JOIN gallerycat ";
                
$sql .= "ON galleryimg.gcatid = gallerycat.gcatid ";
                
$sql .= "WHERE gallerycat.gcatid = "$gcatid " ";
                
$result mysql_query($sql);
                
$row mysql_fetch_array($result,MYSQL_ASSOC);
          
?>
          <tr>
            <td height="60" class="title"><?=$row{'gcatnameen'};?></td>
          </tr>
          <tr>
            <td align="left" valign="top">&nbsp;</td>
          </tr>
          <tr>
            <td align="left" valign="top"><!-- Gallery -->
            <table border="0" cellpadding="0" cellspacing="0">
            <?php                                
            $limit
=12
            if (!isset(
$_GET["page"]) || $_GET["page"]== 1){
                
$offset=0;
            }
            else{
                
$offset= ($_GET["page"]-1) *$limit;
            }

            if (
strlen($where)==0)
            {
                if (
strlen($gcatid)<>0)
                {
                    
$query_where .= "and gallerycat.gcatid = '$gcatid' ";
                }                                        
            }
            else
            {
                
$query_where $where;
            }
            if (!
$where) {
                if (empty(
$one) || empty($two)) {
                }
                
$where=$query_where;
            }

            
$sqlx "select count(*) ";
            
$sqlx .= "FROM galleryimg INNER JOIN gallerycat ";
            
$sqlx .= "ON galleryimg.gcatid = gallerycat.gcatid ";
            
$sqlx .= "$query_where ";
            
$sqlx .= "ORDER BY galleryimg.pref ASC ";
            
$sqlx str_replace('\\','',$sqlx);
            
$result=mysql_query($sqlx);
            list(
$numrec)=mysql_fetch_row($result);

            
$numpage=ceil($numrec/$limit);

            if (
$numrec%$limit) {
                
$numpage++; // add one page if remainder
            
}
            
//echo $numcnt;
            
            
?>            
                  <!--start here-->
                  <?php
                    $sqly 
"SELECT * ";
                    
$sqly .= "FROM galleryimg inner join gallerycat ";
                    
$sqly .= "on galleryimg.gcatid = gallerycat.gcatid ";
                    
$sqly .= "$query_where ";
                    
$sqly .= "order by galleryimg.pref ASC ";
                    
$sqly .= "limit $offset,$limit";

                    
$x 1;
                    
$y 1;

                    echo 
"<tr>";
                    
$result1 mysql_query($sqly);

                    while (
$row mysql_fetch_array($result1,MYSQL_ASSOC))
                    {
                        if (
$y == 1)
                        {
                        }
                        elseif (
$y == 4)
                            echo 
"<tr>";
                        elseif (
$y == 7)
                            echo 
"<tr>";
                        elseif (
$y == 10)
                            echo 
"<tr>";
                
?>
                <td width="220" valign="top" align="center"><table width="200" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="200" height="150" align="center" valign="top" style="border:1px dotted #D1D1D1;" class="pic"><a href="../webadmin/gallery/<?=$row{'gimgfile'}?>" target="_blank"><img src="../webadmin/gallerythumb/<?=$row{'gimgfile'}?>" border='0' width='0' height='0' onload='AutoResizeImage(200,150,this)' /></a></td>
                  </tr>
                  <tr>
                    <td width="200" height="10" align="center" valign="top"></td>
                  </tr>
                </table></td>
                  <?
                            
if ($y == 3)
                                echo 
"</tr>";
                            elseif (
$y == 6)
                                echo 
"</tr>";
                            elseif (
$y == 9)
                                echo 
"</tr>";
                            elseif (
$y == 12)
                                echo 
"</tr>";
                            
$y $y 1;
                        }
                        
?>
                  <!--end here-->
                </table></td>
          </tr>
          <tr>
              <td align="left" valign="top" class="course">&nbsp;<?php  


        
if( $numpage 1){
            if( isset(
$_GET["page"]) && $_GET["page"]> 1){
                echo 
"<a href='gallery_detail.php?gcatid=$gcatid&page=".($_GET["page"]-1)."'><</a> ";
            }
            for(
$i=1$i<=$numpage$i++){
                if( 
$i == $_GET["page"]|| ($i==&& !isset($_GET["page"]) )){
                    echo 
"<font style='color:#BCD553;'>".$i." </font>";
                }
                else{
                    echo 
"<a href='gallery_detail.php?gcatid=$gcatid&page=$i'>$i</a> ";
                }
            }
            if(  
$_GET["page"]< $numpage){
                if(isset(
$_GET["page"])){
                    
$i_go $_GET["page"]+1;
                }
                else{
                    
$i_go 2;
                }
                echo 
" <a href='gallery_detail.php?gcatid=$gcatid&page=".$i_go."'>></a> ";
            }
        }
 
?></td>
           </tr>
          <!-- Eng Gallery -->
         
        </table></td>
        <td width="150" valign="top" background="../images/rightbg.gif"><img src="../images/right.gif" width="150" height="535" /></td>
      </tr>
    </table></td>
  </tr>
  <!-- Footer -->
  <tr>
    <td align="center" valign="top" id="footer"><table width="660" height="200" border="0" cellpadding="0" cellspacing="0">
    <?php
         $sql 
"SELECT * ";
        
$sql .= "FROM contactus ";
        
$result mysql_query($sql);
        
$row mysql_fetch_array($result,MYSQL_ASSOC);
    
?>
      <tr>
        <td align="center" valign="middle" class="footertxt">Tel: <?=$row{'cphone'};?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fax: <?=$row{'cfax'};?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Email: <a href="mailto:<?=$row{'cemail'};?>"><?=$row{'cemail'};?></a><br />
          <br />
          Copyright © 2010 Explorer Island. All rights reserved. | Powered by <a href="http://www.onesolution.com.hk" target="_blank">One Solution   Limited</a> </td>
        </tr>
      
    </table></td>
  </tr>
  <!-- End Footer -->
</table>
</body>
</html>