{php}
$sql = "SELECT cat_id,cat_name,parent_id FROM ".$GLOBALS['eces']->table('category_zh')." WHERE FirmID = '". $GLOBALS['FrimID']."' AND parent_id = '0' ORDER BY `sort_order` ASC ";
$RS = $GLOBALS['dbes']->getAll($sql);
foreach($RS as $v){
$sql2 = "SELECT cat_id,cat_name FROM ".$GLOBALS['eces']->table('category_zh')." WHERE parent_id = '".$v[cat_id]."' AND FirmID = '". $GLOBALS['FrimID']."' ORDER BY `sort_order` ASC ";
$catarry = $GLOBALS['dbes']->getAll($sql2);
foreach($catarry as $tt){
$catid .= '
'.$tt[cat_name].'';
}
$contenall .='
';
}
echo $contenall;
{/php}