<body> <div class="topToolbar"> <span class="title">广告管理</span> <span class="alltype"> <?php if (isset($tid)) { $r = $dosql->GetOne("SELECT `classname` FROM `#@__adtype` where `id`={$tid}"); $cname = $r['classname']; } else { $cname = '查看全部'; } ?> <a href="?" class="btn"><?php echo $cname; ?> </a> <span class="drop"> <?php GetMgrType('#@__adtype'); ?> </span> </span> <span class="text"><a href="adtype.php">广告位管理</a></span> <a href="javascript:location.reload();" class="reload">刷新</a></div> <form name="form" id="form" method="post" action="admanage_save.php"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataTable"> <tr align="left" class="head"> <td width="5%" height="30" class="firstCol"><input type="checkbox" name="checkid" id="checkid" onclick="CheckAll(this.checked);"></td> <td width="5%">ID</td> <td width="10%">缩略图</td> <td width="25%">广告标识</td> <td width="20%">投放范围</td> <td width="15%">广告形式</td> <td width="20%" class="endCol">操作</td> </tr> <?php //设置SQL
function GetMgrType($tbname = '', $id = 0, $i = 0) { global $dosql, $cfg_siteid; if ($tbname != '#@__goodstype' && $tbname != '#@__goodsbrand') { $sql = "SELECT * FROM `{$tbname}` WHERE `siteid`='{$cfg_siteid}' AND `parentid`={$id} ORDER BY `orderid` ASC"; } else { $sql = "SELECT * FROM `{$tbname}` WHERE `parentid`={$id} ORDER BY `orderid` ASC"; } //开始循环类别 $dosql->Execute($sql, $id); $i++; while ($row = $dosql->GetArray($id)) { echo '<a href="?tid=' . $row['id'] . '">'; for ($p = 1; $p < $i; $p++) { echo ' '; } if ($row['parentid'] != 0) { echo '|- '; } echo $row["classname"] . '</a>'; GetMgrType($tbname, $row['id'], $i); } }
<body> <div class="topToolbar"> <span class="title">友情链接管理</span> <span class="alltype"> <?php if (isset($tid)) { $r = $dosql->GetOne("SELECT `classname` FROM `#@__weblinktype` where `id`={$tid}"); $cname = $r['classname']; } else { $cname = '查看全部'; } ?> <a href="?" class="btn"><?php echo $cname; ?> </a> <span class="drop"> <?php GetMgrType('#@__weblinktype'); ?> </span> </span> <span class="text"><a href="weblinktype.php">类别管理</a></span> <a href="javascript:location.reload();" class="reload">刷新</a></div> <form name="form" id="form" method="post" action=""> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataTable"> <tr align="left" class="head"> <td width="5%" height="36" class="firstCol"><input type="checkbox" name="checkid" id="checkid" onclick="CheckAll(this.checked);"></td> <td width="5%">ID</td> <td width="15%">网站LOGO</td> <td width="20%">站点名称</td> <td width="25%">站点URL</td> <td width="10%">所属分类</td> <td width="20%" class="endCol">操作</td> </tr> <?php $sql = "SELECT * FROM `#@__weblink` WHERE `siteid`='{$cfg_siteid}'";