Exemplo n.º 1
0
function Show($id = 0, $i = 0)
{
    global $dosql, $cfg_siteid;
    $dosql->Execute("SELECT * FROM `#@__weblinktype` WHERE siteid='{$cfg_siteid}' AND parentid={$id} ORDER BY orderid ASC", $id);
    $i++;
    while ($row = $dosql->GetArray($id)) {
        //设置$classname
        $classname = '';
        //设置空格
        for ($n = 1; $n < $i; $n++) {
            $classname .= '&nbsp;&nbsp;';
        }
        //设置折叠
        if ($row['parentid'] == '0') {
            $classname .= '<span class="minusSign" id="rowid_' . $row['id'] . '" onclick="DisplayRows(' . $row['id'] . ');">';
        } else {
            $classname .= '<span class="subType">';
        }
        $classname .= $row['classname'] . '</span>';
        switch ($row['checkinfo']) {
            case 'true':
                $checkinfo = '显示';
                break;
            case 'false':
                $checkinfo = '隐藏';
                break;
            default:
                $checkinfo = '没有获取到参数';
        }
        ?>
	<div rel="rowpid_<?php 
        echo GetTopID($row['parentstr']);
        ?>
">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataTable">
			<tr align="left" class="dataTr">
				<td width="5%" height="36" class="firstCol"><input type="checkbox" name="checkid[]" id="checkid[]" value="<?php 
        echo $row['id'];
        ?>
" /></td>
				<td width="3%"><?php 
        echo $row['id'];
        ?>
					<input type="hidden" name="id[]" id="id[]" value="<?php 
        echo $row['id'];
        ?>
" /></td>
				<td width="40%"><?php 
        echo $classname;
        ?>
</td>
				<td width="20%" align="center"><a href="weblinktype_save.php?action=up&id=<?php 
        echo $row['id'];
        ?>
&parentid=<?php 
        echo $row['parentid'];
        ?>
&orderid=<?php 
        echo $row['orderid'];
        ?>
" class="leftArrow" title="提升排序"></a>
					<input type="text" name="orderid[]" id="orderid[]" class="inputls" value="<?php 
        echo $row['orderid'];
        ?>
" />
					<a href="weblinktype_save.php?action=down&id=<?php 
        echo $row['id'];
        ?>
&parentid=<?php 
        echo $row['parentid'];
        ?>
&orderid=<?php 
        echo $row['orderid'];
        ?>
" class="rightArrow" title="下降排序"></a></td>
				<td width="32%" class="action endCol"><span><a href="weblinktype_add.php?id=<?php 
        echo $row['id'];
        ?>
">添加下级</a></span> | <span><a href="weblinktype_save.php?id=<?php 
        echo $row['id'];
        ?>
&action=check&checkinfo=<?php 
        echo $row['checkinfo'];
        ?>
" title="点击进行显示与隐藏操作"><?php 
        echo $checkinfo;
        ?>
</a></span> | <span><a href="weblinktype_update.php?id=<?php 
        echo $row['id'];
        ?>
">修改</a></span> | <span class="nb"><a href="weblinktype_save.php?action=del&id=<?php 
        echo $row['id'];
        ?>
" onclick="return ConfDel(2);">删除</a></span></td>
			</tr>
		</table>
	</div>
	<?php 
        Show($row['id'], $i + 2);
    }
}
Exemplo n.º 2
0
function Show($siteid = 1, $id = 0, $i = 0)
{
    global $dosql;
    $dosql->Execute("SELECT * FROM `#@__infoclass` WHERE `siteid`={$siteid} AND `parentid`={$id} ORDER BY `orderid` ASC", $id);
    $i++;
    while ($row = $dosql->GetArray($id)) {
        switch ($row['infotype']) {
            case 0:
                $addurl = 'info_update.php?id=' . $row['id'];
                $infotype = ' <i title="栏目属于[单页]类型">[单页]</i>';
                break;
            case 1:
                $addurl = 'infolist_add.php?cid=' . $row['id'];
                $infotype = ' <i title="栏目属于[列表]类型">[列表]</i>';
                break;
            case 2:
                $addurl = 'infoimg_add.php?cid=' . $row['id'];
                $infotype = ' <i title="栏目属于[图片]类型">[图片]</i>';
                break;
            case 3:
                $addurl = 'soft_add.php?cid=' . $row['id'];
                $infotype = ' <i title="栏目属于[下载]类型">[下载]</i>';
                break;
            case 4:
                $addurl = 'soft_add.php?cid=' . $row['id'];
                $infotype = ' <i title="栏目属于[商品]类型">[商品]</i>';
                break;
            default:
                $r = $dosql->GetOne("SELECT * FROM `#@__diymodel` WHERE `id`=" . $row['infotype']);
                if (isset($r) && is_array($r)) {
                    $addurl = 'modeldata_add.php?m=' . $r['modelname'] . '&cid=' . $row['id'];
                    $infotype = ' <i title="栏目属于[' . $r['modeltitle'] . ']类型">[' . $r['modeltitle'] . ']</i>';
                } else {
                    $addurl = 'javascript:;';
                    $infotype = ' 没有获取到类型';
                }
        }
        //设置$classname
        $classname = '';
        //设置空格
        for ($n = 1; $n < $i; $n++) {
            $classname .= '&nbsp;&nbsp;';
        }
        //设置折叠
        if ($row['parentid'] == '0') {
            $classname .= '<span class="minusSign" id="rowid_' . $row['id'] . '" onclick="DisplayRows(' . $row['id'] . ');">';
        } else {
            $classname .= '<span class="subType">';
        }
        $classname .= $row['classname'] . '</span>';
        //信息类型
        $classname .= '<span class="infoTypeTxt">' . $infotype . '</span>';
        ?>
<div rel="rowpid_<?php 
        echo GetTopID($row['parentstr']);
        ?>
">
	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataTable">
		<tr align="left" class="dataTr">
			<td width="3%" height="32"><input type="checkbox" name="siteid[<?php 
        echo $siteid;
        ?>
]" value="<?php 
        echo $siteid;
        ?>
" onclick="SelRole(<?php 
        echo $siteid;
        ?>
,<?php 
        echo $row['id'];
        ?>
,this);" /></td>
			<td align="left"><?php 
        echo $classname;
        ?>
</td>
			<td width="30%" class="privTxt"><span>
				<input type="checkbox" name="priv[<?php 
        echo $siteid;
        ?>
][<?php 
        echo $row['id'];
        ?>
][]" value="list" />
				查看</span> <span>
				<input type="checkbox" name="priv[<?php 
        echo $siteid;
        ?>
][<?php 
        echo $row['id'];
        ?>
][]" value="add" />
				添加</span> <span>
				<input type="checkbox" name="priv[<?php 
        echo $siteid;
        ?>
][<?php 
        echo $row['id'];
        ?>
][]" value="update" />
				修改</span> <span>
				<input type="checkbox" name="priv[<?php 
        echo $siteid;
        ?>
][<?php 
        echo $row['id'];
        ?>
][]" value="del" />
				删除</span></td>
		</tr>
	</table>
</div>
<?php 
        Show($siteid, $row['id'], $i + 2);
    }
}
Exemplo n.º 3
0
function Show($id = 0, $i = 0)
{
    global $dosql, $cfg_siteid, $cfg_adminlevel, $catgoryListPriv, $catgoryAddPriv, $catgoryUpdatePriv, $catgoryDelPriv;
    $i++;
    $dosql->Execute("SELECT * FROM `#@__infoclass` WHERE `siteid`='{$cfg_siteid}' AND `parentid`={$id} ORDER BY `orderid` ASC", $id);
    while ($row = $dosql->GetArray($id)) {
        switch ($row['infotype']) {
            case 0:
                $addurl = 'info_update.php?id=' . $row['id'];
                $infotype = ' <i title="栏目属于[单页]类型">[单页]</i>';
                break;
            case 1:
                $addurl = 'infolist_add.php?cid=' . $row['id'];
                $infotype = ' <i title="栏目属于[列表]类型">[列表]</i>';
                break;
            case 2:
                $addurl = 'infoimg_add.php?cid=' . $row['id'];
                $infotype = ' <i title="栏目属于[图片]类型">[图片]</i>';
                break;
            case 3:
                $addurl = 'soft_add.php?cid=' . $row['id'];
                $infotype = ' <i title="栏目属于[下载]类型">[下载]</i>';
                break;
            case 4:
                $addurl = 'goods_add.php?cid=' . $row['id'];
                $infotype = ' <i title="栏目属于[商品]类型">[商品]</i>';
                break;
            default:
                $r = $dosql->GetOne("SELECT * FROM `#@__diymodel` WHERE `id`=" . $row['infotype']);
                if (isset($r) && is_array($r)) {
                    $addurl = 'modeldata_add.php?m=' . $r['modelname'] . '&cid=' . $row['id'];
                    $infotype = ' <i title="栏目属于[' . $r['modeltitle'] . ']类型">[' . $r['modeltitle'] . ']</i>';
                } else {
                    $addurl = 'javascript:;';
                    $infotype = ' 没有获取到类型';
                }
        }
        //设置$classname
        $classname = '';
        //设置空格
        for ($n = 1; $n < $i; $n++) {
            $classname .= '&nbsp;&nbsp;';
        }
        //设置折叠
        if ($row['parentid'] == '0') {
            $classname .= '<span class="minusSign" id="rowid_' . $row['id'] . '" onclick="DisplayRows(' . $row['id'] . ');">';
        } else {
            $classname .= '<span class="subType">';
        }
        //添加权限
        if ($cfg_adminlevel != 1) {
            if (in_array($row['id'], $catgoryAddPriv)) {
                $classname .= '<a href="' . $addurl . '" title="点击添加内容">' . $row['classname'] . '</a></span>';
                $addStr = '<a href="infoclass_add.php?infotype=' . $row['infotype'] . '&id=' . $row['id'] . '">添加子栏目</a>';
            } else {
                $classname .= '<span title="暂无添加权限哦~">' . $row['classname'] . '</span></span>';
                $addStr = '添加子栏目';
            }
        } else {
            $classname .= '<a href="' . $addurl . '" title="点击添加内容">' . $row['classname'] . '</a></span>';
            $addStr = '<a href="infoclass_add.php?infotype=' . $row['infotype'] . '&id=' . $row['id'] . '">添加子栏目</a>';
        }
        //信息类型
        $classname .= '<span class="infoTypeTxt">' . $infotype . '</span>';
        //修改权限
        if ($cfg_adminlevel != 1) {
            if (in_array($row['id'], $catgoryUpdatePriv)) {
                $updateStr = '<a href="infoclass_update.php?id=' . $row['id'] . '">修改</a>';
            } else {
                $updateStr = '修改';
            }
        } else {
            $updateStr = '<a href="infoclass_update.php?id=' . $row['id'] . '">修改</a>';
        }
        //删除权限
        if ($cfg_adminlevel != 1) {
            if (in_array($row['id'], $catgoryDelPriv)) {
                $delStr = '<a href="infoclass_save.php?action=delclass&id=' . $row['id'] . '" onclick="return ConfDel(2);">删除</a>';
            } else {
                $delStr = '删除';
            }
        } else {
            $delStr = '<a href="infoclass_save.php?action=delclass&id=' . $row['id'] . '" onclick="return ConfDel(2);">删除</a>';
        }
        //审核状态
        switch ($row['checkinfo']) {
            case 'true':
                $checkinfo = '显示';
                break;
            case 'false':
                $checkinfo = '隐藏';
                break;
            default:
                $checkinfo = '没有获取到参数';
        }
        //审核权限
        if ($cfg_adminlevel != 1) {
            if (in_array($row['id'], $catgoryUpdatePriv)) {
                $checkStr = '<a href="infoclass_save.php?action=check&id=' . $row['id'] . '&checkinfo=' . $row['checkinfo'] . '" title="点击进行显示与隐藏操作">' . $checkinfo . '</a>';
            } else {
                $checkStr = $checkinfo;
            }
        } else {
            $checkStr = '<a href="infoclass_save.php?action=check&id=' . $row['id'] . '&checkinfo=' . $row['checkinfo'] . '" title="点击进行显示与隐藏操作">' . $checkinfo . '</a>';
        }
        ?>
	<div rel="rowpid_<?php 
        echo GetTopID($row['parentstr']);
        ?>
">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataTable">
			<tr align="left" class="dataTr">
				<td width="5%" height="36" class="firstCol"><input type="checkbox" name="checkid[]" id="checkid[]" value="<?php 
        echo $row['id'];
        ?>
" /></td>
				<td width="3%"><?php 
        echo $row['id'];
        ?>
					<input type="hidden" name="id[]" id="id[]" value="<?php 
        echo $row['id'];
        ?>
" /></td>
				<td width="40%"><?php 
        echo $classname;
        ?>
</td>
				<td width="20%" align="center"><a href="infoclass_save.php?action=up&id=<?php 
        echo $row['id'];
        ?>
&parentid=<?php 
        echo $row['parentid'];
        ?>
&orderid=<?php 
        echo $row['orderid'];
        ?>
" class="leftArrow" title="提升排序"></a>
					<input type="text" name="orderid[]" id="orderid[]" class="inputls" value="<?php 
        echo $row['orderid'];
        ?>
" />
					<a href="infoclass_save.php?action=down&id=<?php 
        echo $row['id'];
        ?>
&parentid=<?php 
        echo $row['parentid'];
        ?>
&orderid=<?php 
        echo $row['orderid'];
        ?>
" class="rightArrow" title="下降排序"></a></td>
				<td width="32%" class="action endCol"><span><?php 
        echo $addStr;
        ?>
</span> | <span><?php 
        echo $checkStr;
        ?>
</span> | <span><?php 
        echo $updateStr;
        ?>
</span> | <span class="nb"><?php 
        echo $delStr;
        ?>
</span></td>
			</tr>
		</table>
	</div>
	<?php 
        Show($row['id'], $i + 2);
    }
}