<?php
require_once '_admin_setting.php';
require_once NSO_INC_PATH . 'Pager.php';

$nsoPostFormFileName = 'user_form.php';

$sql = "SELECT * FROM users";
$pager = new Pager($nsodb, $sql, 20);
$rs = $pager->getResults();
$totalRow = $pager->getTotalRow();

addHeaderJavascript('javascripts/user_list.js');
require_once '_top.php';
require_once '_header.php';
require_once '_menuPane.php';
?>
<div id="godContentContainer">
    <div class="content_part">
        <div class="title">
            <h2><?php echo $categoryName?>管理员（共有<strong><?php echo $totalRow; ?></strong>个）</span></h2>
        </div>
        <div id="topToolbar" class="toolbar">
            <div class="tool_button quick_filter_button">
                <div class="button"><input type="checkbox" class="checkall" /><span class="check_list"></span><span class="deco_left"></span><span class="deco_right"></span></div>
            </div>
            <div class="tool_button">
                <div class="button add_button">增加<span class="deco_left"></span><span class="deco_right"></span></div>
            </div>
            <!--
            <div class="tool_button">
                <div class="button savesort_button">保存排序<span class="deco_left"></span><span class="deco_right"></span></div>
            </div>
             -->
            <div class="pager_navigation"><?php echo $pager->getNavigation(); ?></div>
        </div>
        <div class="infobar">
            <div class="message_box">正在处理...</div>
        </div>
        <div class="content">
            <div class="table_content">
                <table>
                    <tbody>
                    <?php if ($rs) : foreach ($rs as $row) : $updateUrl = "user_form.php?id={$row['id']}";?>
                    	<tr id="post-<?php echo $post['id']?>">
                            <td class="drag_icon"></td>
                            <td class="checkbox"><input type="checkbox" value="<?php echo $row['id']?>" /></td>
                            <td class="title"><a href="<?php echo $updateUrl?>"><?php echo $row['account']?></a></td>
                            <td class="action">
                                <a href="<?php echo $updateUrl?>" class="edit">编辑</a>
                                <a href="user_edit_action.php?action=delete&id=<?php echo $row['id']?>" class="delete">删除</a>
                            </td>
                        </tr>
                     <?php endforeach; endif;?>
                     </tbody>
                </table>
            </div>
        </div>
        <div style="display: none">
            <div id="hiddenParamId"><?php echo $cat;?></div>
            <div id="hiddenParamPostFormFileName"><?php echo $nsoPostFormFileName?></div>
        </div>
    </div>
</div>
<?php include_once '_bottom.php';?>