<?php (!defined('IN_ADMIN') || !defined('IN_MUDDER')) && exit('Access Denied'); ?>
<script type="text/javascript">
function selectpanel(obj) {
    if(obj.value != '') 
        document.location.href = 'admincp.php?<?=$action?>&file=<?=$file?>&panelcode=' + obj.value;
}
</script>
<div id="body">
<? if($delete == 'confirm') {?>
<form method="post" action="admincp.php?action=<?=$action?>&file=<?=$file?>&">
    <input type="hidden" name="classcode" value="<?=$classcode?>" />
    <input type="hidden" name="delete" value="yes" />
    <div class="space">
        <div class="subtitle">删除分类</div>
        <table class="maintable" border="0" cellspacing="0" cellpadding="0">
        <tr><td><span class="font_4">本操作不可恢复</span>，您确定删除该分类，清除分类下的商铺，点评吗？<br />&nbsp;&nbsp;注意：本次删除操作，不会更新用户积分。</td></tr>
        </table>
        <br /><center><input type="submit" name="dosubmit" value=" 删除 " class="btn" />&nbsp;&nbsp;&nbsp;<input type="button" value=" 取消 " onclick="history.go(-1);" class="btn" />&nbsp;&nbsp;&nbsp;</center>
    </div>
</form>
<? } else { ?>
<div class="space">
    <div class="subtitle">编辑板块</div>
    <form method="post" action="admincp.php?action=<?=$action?>&file=<?=$file?>&">
    <input type="hidden" name="submitclassorder" value="yes" />
    <table class="maintable" border="0" cellspacing="0" cellpadding="0">
    <? if(!$panels || !is_array($panels)) { ?>
        <tr><td>目前没有板块，请先添加板块。</td></tr>
    <? } else { ?>
        <? foreach($panels as $panel) { ?>
        <tr<?if($panelcode==$panel['classcode']){?> class="altbg1"<?}?>>
            <td width="5%"><input type="text" name="orders[<?=$panel['cid']?>]" value="<?=$panel['classorder']?>" class="txtbox7" /></td>
            <td width="5%"><?=$panel['classcode']?></td>
            <td width="10%"><?=$panel['classname']?></td>
            <td width="*">[<a href="admincp.php?action=shop&file=classedit&classcode=<?=$panel['classcode']?>">编辑分类选项</a>]&nbsp;&nbsp;&nbsp;[<a href="admincp.php?action=shop&file=classlist&panelcode=<?=$panel['classcode']?>">编辑子分类</a>]</td>
        </tr>
        <? } ?>
    <? } ?>
    </table>
    <?if(!$panelcode){?><center><input type="submit" name="dosubmit" value=" 更新排序 " class="btn" /><?}?>
    </form>
</div>
<? if($panelcode) {?>
<form method="post" action="admincp.php?action=<?=$action?>&file=<?=$file?>&">
<input type="hidden" name="panelcode" value="<?=$panelcode?>" />
<input type="hidden" name="submitclassorder" value="yes" />
<div class="space">
    <div class="subtitle">板块分类</div>
    <table class="maintable" border="0" cellspacing="0" cellpadding="0">
        <tr><td>
            [<a href="admincp.php?action=shop&file=classadd&panelcode=<?=$panelcode?>">添加</a>]&nbsp;[<a href="admincp.php?action=shop&file=classedit&classcode=<?=$panelcode?>">编辑</a>]&nbsp;[<a href="admincp.php?action=shop&file=classlist&delete=confirm&classcode=<?=$panelcode?>">删除</a>]<br />
            <? if($classes && is_array($classes)) foreach($classes as $class) { ?>
                &nbsp;&nbsp;&nbsp;&nbsp;├&nbsp;&nbsp;<input type="text" name="orders[<?=$class['cid']?>]" class="txtbox7" value="<?=$class['classorder']?>" />&nbsp;<?=$class['classcode']?>&nbsp;<?=$class['classname']?>&nbsp;[<a href="admincp.php?action=shop&file=classedit&classcode=<?=$class['classcode']?>">编辑</a>]&nbsp;[<a href="admincp.php?action=shop&file=classlist&delete=confirm&classcode=<?=$class['classcode']?>">删除</a>]<br />
            <? } ?>
        </td></tr>
    </table>
    <center><input type="submit" name="dosubmit" value=" 更新排序 " class="btn" />
</div>
</form>
<? } ?>
<? } ?>
</div>