/var/www/(Del)standraise.com/en/submenu.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
<div class="customGroup">
<?
        load
(001);

        function 
load($p$space$top)
        {
            
/*$sql = "SELECT * ";
            $sql .= "FROM productcat ";
            $sql .= "where parentid = $p ";
            $sql .= "order by sortby";*/
            
            
$sql "  select p.productcatid, sum(i.productimageid) as num, p.productcatname";
            
$sql .= " from  productcat p left join productimage i on p.productcatid = i.productcatid";
            
$sql .= " where p.parentid = $p ";            
            
$sql .= " group by p.productcatid, p.productcatname ";
            
$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))
            {
                    if (
$top==1
                        echo 
"<div class='customGroup_title'>";
                    else
                        echo 
"<li>";
                
                if (
$row{'num'} <> '')
                     echo 
"<a href='product.php?page=product.php&productcatid=".$row{'productcatid'}."'>"$row{'productcatname'} . "</a>";            
                else 
                    echo 
$row{'productcatname'}; 
                    
                
//echo "<a href='product.php?productcatid=".$row{'productcatid'}."'>". $row{'productcatname'} . "</a>";            

                
if ($top==1
                    echo 
"</div>";
                else
                    echo 
"</li>";                    
                
load($row{'productcatid'}, $space+12);
            }
            if ((
$top<>1) && ($num 0))
            {
                echo 
"</ul>";
            }

        }
?>
</div>