function getProdTypeList($DEPT_PARENT) { global $connection; $sql = "select DEPT_ID,DEPT_NAME,DEPT_PARENT from department where DEPT_PARENT='{$DEPT_PARENT}' order by DEPT_PARENT asc ,DEPT_NO asc"; $cursor = exequery($connection, $sql); while ($ROW = mysql_fetch_array($cursor)) { $DEPT_ID = $ROW['DEPT_ID']; $DEPT_NAME = $ROW['DEPT_NAME']; $DEPT_PARENT = $ROW['DEPT_PARENT']; $open = "false"; print "zNodes[zNodes.length]={id:{$DEPT_ID}, pId:{$DEPT_PARENT}, name:'{$DEPT_NAME}', ename:'{$DEPT_NAME}', open:{$open}};"; getProdTypeList($DEPT_ID); } }
function getProdTypeList($DEPT_PARENT) { global $db; $sql = "select rowid,name,parentid from producttype where parentid='{$DEPT_PARENT}' order by parentid asc ,id asc"; $rs = $db->Execute($sql); $rs_a = $rs->GetArray(); for ($i = 0; $i < sizeof($rs_a); $i++) { $DEPT_ID = $rs_a[$i]['rowid']; $DEPT_NAME = $rs_a[$i]['name']; $DEPT_PARENT = $rs_a[$i]['parentid']; $open = "false"; print "zNodes[zNodes.length]={id:{$DEPT_ID}, pId:{$DEPT_PARENT}, name:'{$DEPT_NAME}', ename:'{$DEPT_NAME}', open:{$open}};"; getProdTypeList($DEPT_ID); } }
function getProdTypeList($DEPT_PARENT) { global $db; $sql = "select DEPT_ID,DEPT_NAME,DEPT_PARENT from department where DEPT_PARENT='{$DEPT_PARENT}' order by orderno"; $rs = $db->Execute($sql); $rs_a = $rs->GetArray(); for ($i = 0; $i < sizeof($rs_a); $i++) { $DEPT_ID = $rs_a[$i]['DEPT_ID']; $DEPT_NAME = $rs_a[$i]['DEPT_NAME']; $DEPT_PARENT = $rs_a[$i]['DEPT_PARENT']; $open = "false"; if ($DEPT_PARENT == 0) { $open = "true"; } print "zNodes[zNodes.length]={id:{$DEPT_ID}, pId:{$DEPT_PARENT}, name:'{$DEPT_NAME}', ename:'{$DEPT_NAME}', open:{$open}};"; getProdTypeList($DEPT_ID); } }
if ($rs_a[$i]['standard'] != "") { $productName = $productName . "/" . $rs_a[$i]['standard']; } echo "{id:'{$productId}', pId:{$DEPT_PARENT}, name:'{$productName}', isParent:false}"; if ($i < sizeof($rs_a) - 1) { echo ","; } } } } ?> [<?php $pId = "0"; $pName = ""; if (array_key_exists('id', $_REQUEST)) { $pId = $_REQUEST['id']; } if (array_key_exists('name', $_REQUEST)) { $pName = $_REQUEST['name']; } if ($pId == null || $pId == "") { $pId = "0"; } if ($pName == null) { $pName = ""; } getProdTypeList($pId); ?> ]