示例#1
0
<link href="../css/css.css" rel="stylesheet" type="text/css">
<table width="98%"  border="0" cellspacing="0" cellpadding="0">	
<?php 
$catinfo = getRecord("tbl_new_category", "id=" . $cat);
$parentCode = $_lang == 'vn' ? 'vn' : 'vn';
$sqlParent = "select * from tbl_new_category where status=0 and parent=(select id from tbl_new_category where code='" . $parentCode . "') order by sort, date_added";
$resultParent = @mysql_query($sqlParent, $conn);
$i = 1;
while ($rowParent = mysql_fetch_assoc($resultParent)) {
    $isHaveChild = isHaveChild("tbl_new_category", $rowParent['id']) ? 0 : 1;
    ?>
	<tr onClick="return showhideProduct('menu_cat'+<?php 
    echo $rowParent['id'];
    ?>
,<?php 
    echo $isHaveChild;
    ?>
);">
		<td valign="middle"><div class="sub_tab"><?php 
    echo $i++;
    ?>
&divide; &nbsp;<?php 
    echo $rowParent['name'];
    ?>
</div></td>
	</tr>	
	 <tr>
         <td height="1"></td>
     </tr>
<?php 
    if ($_REQUEST['frame'] == 'news') {
示例#2
0
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<table width="195"  border="0" cellspacing="0" cellpadding="0">	
<?php 
$catinfo = getRecord("tbl_product_category", "id=" . $cat);
$parentCode = $_lang == 'vn' ? 'vn' : 'en';
$sqlParent = "select * from tbl_product_category where status=0 and parent=(select id from tbl_product_category where code='" . $parentCode . "') order by sort, date_added";
$resultParent = mysql_query($sqlParent, $conn);
while ($rowParent = mysql_fetch_assoc($resultParent)) {
    $isHaveChild = isHaveChild("tbl_product_category", $rowParent['id']) ? 0 : 1;
    if ($_REQUEST['frame'] == 'product_detail') {
        $catinfo = getRecord("tbl_product_category", "id = (select parent from tbl_product where id=" . $_REQUEST['id'] . ")");
    }
    ?>
	<tr id="menu_cat<?php 
    echo $rowParent['id'];
    ?>
" <?php 
    echo $catinfo['parent'] != $rowParent['id'] ? '' : '';
    ?>
>
		<td valign="middle">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">				
<?php 
    $sqlChild = "select * from tbl_product_category where status=0 and parent='" . $rowParent['id'] . "' order by sort, date_added";
    $resultChild = mysql_query($sqlChild, $conn);
    while ($rowChild = mysql_fetch_assoc($resultChild)) {
        ?>
				
	<tr>
        <td class="style6"><img src="images/icon_1.gif" width="25" height="9" /><a href="./?frame=product&cat=<?php 
        echo $rowChild['id'];