<?php (!defined('IN_ADMIN') || !defined('IN_MUDDER')) && exit('Access Denied'); ?>
<div id="body">
<form method="post" action="admincp.php?action=<?=$action?>&file=<?=$file?>&op=<?=$op?>&">
    <div class="space">
        <div class="subtitle">模块管理</div>
        <table class="maintable" border="0" cellspacing="0" cellpadding="0">
            <tr class="altbg1">
                <td width="20">选</td>
                <td width="25">核心</td>
                <td width="*">名称</td>
                <td width="80">标识</td>
                <td width="80">目录</td>
                <td width="80">依存于</td>
                <td width="50">版本</td>
                <td width="80">发布时间</td>
                <td width="90">作者</td>
                <td width="100">操作</td>
            </tr>
            <?if($db->num_rows($query) > 0){?>
            <?while($row=$db->fetch_array($query)) {?>
            <tr>
                <td><input type="checkbox" name="moduleflags[]" value="<?=$row['flag']?>" /></td>
                <td><?=$row['iscore']?'√':'－'?></td>
                <td><a href="admincp.php?action=<?=$action?>&file=<?=$file?>&op=info&moduleid=<?=$row['moduleid']?>"><?=$row['name']?></a></td>
                <td><?=$row['flag']?></td>
                <td><?=$row['directory']?></td>
                <td><?=$row['reliant']?></td>
                <td><a href="admincp.php?action=<?=$action?>&file=<?=$file?>&op=versioncheck&moduleid=<?=$row['moduleid']?>" title="新版本检测"><?=$row['version']?></a></td>
                <td><?=$row['releasetime']?></td>
                <td><a href="<?=$row['siteurl']?>" target="_blank"><?=$row['author']?></a></td>
                <td>
                    <?if(!$row['iscore']) {?>
                    <a href="admincp.php?action=<?=$row['flag']?>&file=config">配置</a>
                    <?if($row['disable']) {?>
                    <a href="admincp.php?action=<?=$action?>&file=<?=$file?>&op=enable&flag=<?=$row['flag']?>" title="启用本模块">启用</a>
                    <?} else {?>
                    <a href="admincp.php?action=<?=$action?>&file=<?=$file?>&op=disable&flag=<?=$row['flag']?>" title="禁用本模块">禁用</a>
                    <?}?>
                    <a href="admincp.php?action=<?=$action?>&file=<?=$file?>&op=unstall&moduleid=<?=$row['moduleid']?>" onclick="return window.confirm('本操作不可逆，您确认删除本模块（删除模块文件夹和数据表）吗？');">删除</a>
                    <?} else {?>
                    N/A
                    <?}?>
                </td>
            </tr>
            <?} $db->free_result($query); ?>
            <tr class="altbg1">
                <td colspan="10"><button type="button" class="btn2" onclick="checkbox_checked('moduleflags[]');">全选</button></td>
            </tr>
            <?}?>
        </table>
        <center><button type="submit" name="dosubmit" value="yes" class="btn" /> 更新模块配置缓存 </button></center>
    </div>
</form>
</div>