| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/(Del)wah-tung.com/html/sc/ |
Upload File : |
<tr>
<td height="40" align="center" valign="top" background="../images/menubg.jpg"><div class="colMenu">
<div id="myslidemenu" class="jqueryslidemenu">
<ul>
<li><a href="index.php">主页</a></li>
<?php
function getLowerLevelFirstProd( $id ){
$sqlCmd ="select p.productId, sum(i.productimageId) as num, p.productcatnamesc";
$sqlCmd .= " from product p inner join productimage i on p.productId = i.productId";
$sqlCmd .= " where p.parentid = $id ";
$sqlCmd .= " group by p.productId, p.productcatnamesc ";
$sqlCmd .= " order by p.sortby";
//check does it have a product
$tmprst = mysql_query($sqlCmd);
if( mysql_num_rows($tmprst) > 0){
$row=mysql_fetch_assoc($tmprst);
return $row;
}
//check if there are child product
else{
$sqlCmd= "SELECT productId FROM product WHERE parentid=$id ORDER BY sortby ASC";
$tmprst = mysql_query($sqlCmd);
// there are child product in this category
if(mysql_num_rows($tmprst) > 0)
{
$row= mysql_fetch_assoc($tmprst);
return getLowerLevelFirstProd($row{'productId'});
}
else
{
return array("productId"=>$id);
}
}
}
function getLowerLevelFirstSpec( $id ){
$sqlCmd ="select p.specialId, sum(i.specialimageId) as num, p.specialcatnamesc";
$sqlCmd .= " from special p left join specialimage i on p.specialId = i.specialId";
$sqlCmd .= " where p.parentid = $id ";
$sqlCmd .= " group by p.specialId, p.specialcatnamesc";
$sqlCmd .= " order by p.sortby";
//check does it have a product
$tmprst = mysql_query($sqlCmd);
if( mysql_num_rows($tmprst) > 0){
$row=mysql_fetch_assoc($tmprst);
return $row;
}
//check if there are child product
else{
$sqlCmd= "SELECT specialId FROM special WHERE parentid=$id ORDER BY sortby ASC";
$tmprst = mysql_query($sqlCmd);
// there are child product in this category
if(mysql_num_rows($tmprst) > 0)
{
$row= mysql_fetch_assoc($tmprst);
return getLowerLevelFirstProd($row{'specialId'});
}
else
{
return array("specialId"=>$id);
}
}
}
$cmd = "SELECT aboutusId FROM aboutus WHERE parentId=0 ORDER BY sortby ASC LIMIT 1";
$result = mysql_query($cmd);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$menu_aboutus = $row{'aboutusId'};
?>
<li><a href="aboutus.php?aboutusId=<?= $menu_aboutus?>">关於我们</a>
<ul>
<!-- SubMenu -->
<?
loadm1(0, 0, 1);
function loadm1($p, $space, $top)
{
$sql = "SELECT * ";
$sql .= "FROM aboutus ";
$sql .= "where parentid = $p ";
$sql .= "order by sortby";
$result1 = mysql_query($sql);
$n=1;
$count = mysql_num_rows($result1);
$num = mysql_num_rows($result1);
if (($top<>1) && ($num > 0))
{
echo "<ul>";
}
while ($row = mysql_fetch_array($result1,MYSQL_ASSOC))
{
echo "<li>";
if ($row{'aboutusdescsc'} == "") {
// test and get if there are child underhood
$sql_child = "SELECT aboutusId FROM aboutus WHERE parentid=".$row{'aboutusId'}." ORDER BY sortby ASC";
$child_res = mysql_query($sql_child);
if(mysql_num_rows($child_res) ==0)
echo "<a>". $row{'aboutusnamesc'} . "</a>";
else{
$a_child = mysql_fetch_array($child_res, MYSQL_ASSOC);
$childid= $a_child{'aboutusId'};
echo "<a href='aboutus.php?aboutusId=$childid'>". $row{'aboutusnamesc'} . "</a>";
}
} else {
echo "<a href='aboutus.php?aboutusId=".$row{'aboutusId'}."'>". $row{'aboutusnamesc'} . "</a>";
}
loadm1($row{'aboutusId'}, $space+1, 2);
echo "</li>";
}
if (($top<>1) && ($num > 0))
{
echo "</ul>";
}
}
?>
</ul>
</li>
<?php
$cmd = "SELECT productId FROM product WHERE parentId>0 ORDER BY parentId ASC, sortby ASC LIMIT 1";
$result = mysql_query($cmd);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$menu_product = $row{'productId'};
?>
<li><a href="product.php?productId=<?=$menu_product?>">产品</a>
<ul>
<?
loadm2(0, 0, 1);
function loadm2($p, $space, $top)
{
$sql = " select p.productId, sum(i.productimageId) as num, p.productcatnamesc";
$sql .= " from product p left join productimage i on p.productId = i.productId";
$sql .= " where p.parentid = $p ";
$sql .= " group by p.productId, p.productcatnamesc ";
$sql .= " order by p.sortby";
$result1 = mysql_query($sql);
$n=1;
$count = mysql_num_rows($result1);
$num = mysql_num_rows($result1);
if (($top<>1) && ($num > 0))
{
echo "<ul>";
}
while ($row = mysql_fetch_array($result1,MYSQL_ASSOC))
{
echo "<li>";
if ($row{'num'} <> '')
echo "<a href='product.php?productId=".$row{'productId'}."'>". $row{'productcatnamesc'} . "</a></li>";
else {
$a_child = getLowerLevelFirstProd($row{'productId'});
$childid= $a_child{'productId'};
echo "<a href='product.php?productId=$childid'>". $row{'productcatnamesc'}. "</a>";
}
loadm2($row{'productId'}, $space+1, 2);
}
if (($top<>1) && ($num > 0))
{
echo "</ul>";
}
}
?>
</ul>
</li>
<?php
$cmd = "SELECT specialId FROM special WHERE parentId>0 ORDER BY parentId DESC, sortby ASC LIMIT 1";
$result = mysql_query($cmd);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$menu_special = $row{'specialId'};
if ($menu_special == "")
{
echo "<li><a href='#'>特別推介</a><ul>";
}else{
?>
<li><a href="special.php?specialId=<?=$menu_special?>">特別推介</a>
<ul>
<?
}
loadm3(0, 0, 1);
function loadm3($p, $space, $top)
{
$sql = " select p.specialId, sum(i.specialimageId) as num, p.specialcatnamesc";
$sql .= " from special p left join specialimage i on p.specialId = i.specialId";
$sql .= " where p.parentid = $p ";
$sql .= " group by p.specialId, p.specialcatnamesc ";
$sql .= " order by p.sortby";
$result1 = mysql_query($sql);
$n=1;
$count = mysql_num_rows($result1);
$num = mysql_num_rows($result1);
if (($top<>1) && ($num > 0))
{
echo "<ul>";
}
while ($row = mysql_fetch_array($result1,MYSQL_ASSOC))
{
echo "<li>";
if ($row{'num'} <> '')
echo "<a href='special.php?specialId=".$row{'specialId'}."'>". $row{'specialcatnamesc'} . "</a>";
else {
$a_spec = getLowerLevelFirstSpec( $row{'specialId'} );
$sqlt = "SELECT specialcatnamesc FROM special WHERE parentId=0";
$rowt = mysql_fetch_array(mysql_query($sqlt));
$s_name= $rowt[0];//$a_spec{'specialcatname'};
echo "<a href='special.php?specialId=".$a_spec{'specialId'}."'>". $s_name . "</a>";
// echo "<a href='special.php?specialId=".$a_spec{'specialId'}."'>". $a_spec{'specialcatnamesc'} . "</a></li>";
}
loadm3($row{'specialId'}, $space+1, 2);
echo "</li>";
}
if (($top<>1) && ($num > 0))
{
echo "</ul>";
}
}
?>
</ul>
</li>
<li><a href="news.php">最新消息</a></li>
<li><a href="contactus.php">联系我们</a></li>
</ul>
<br style="clear: left" />
</div>
</div></td>
</tr>