school_list.html 3.0 KB
<include file="public@header"/>
</head>
<body>
<style>
    .pagination{text-align:center;margin-top:20px;margin-bottom: 20px;}
    .pagination li{margin:0px 10px; border:1px solid #e6e6e6;padding: 3px 8px;display: inline-block;}
    .pagination .active{background-color: #dd1a20;color: #fff;}
    .pagination .disabled{color:#aaa;}
</style>
<div class="wrap js-check-wrap">
    <form class="well form-inline margin-top-20" method="post" action="{:url('School/school_list')}" onsubmit="return tovaild()">
        时间:
        <input type="text" class="form-control js-bootstrap-datetime" name="start_time"
               value="{$start_time|default=''}"
               style="width: 140px;" autocomplete="off">-
        <input type="text" class="form-control js-bootstrap-datetime" name="end_time"
               value="{$end_time|default=''}"
               style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
        关键字:
        <input type="text" class="form-control" name="keyword" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入学校名称...">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('School/school_list')}">清空</a>
    </form>
    <table class="table table-hover table-bordered table-list">
        <thead>
        <tr>
            <th>序号</th>
            <th>学校名称</th>
            <th>地区</th>
            <th>创建者</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <volist name="data" id="vo">
            <tr class="tr{$vo.id}">
                <td>{$vo.id}</td>
                <td>{$vo.school}</td>
                <td>{$vo.region}</td>
                <td>{$vo.uname}</td>
                <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
                <td>
                    <a href="{:url('School/school_edit',array('ids'=>$vo.id))}"><button type="button" class="btn btn-default">编辑</button></a>
                    <button type="button" class="btn btn-default" onclick="del({$vo.id})">删除</button>
                </td>
            </tr>
        </volist>

        </tbody>
    </table>
    <div class="pagination">
        {$res->render()}
    </div>

</div>
<script src="__STATIC__/js/admin.js"></script>
<script>

    //提交时判断
    function tovaild(){
        keyword = $("input[name='keyword']").val();
        start_time = $("input[name='start_time']").val();
        end_time = $("input[name='end_time']").val();
        if(end_time == '' && start_time == '' && keyword == ''){
            alert('搜索条件不能为空');
            return false;
        }

    }

    /**
     * 用户id
     *
     */
    function del(id) {
        ccc = window.confirm('是否删除?');
        if(ccc){
            $.post("{:url('School/school_del')}",{id:id},function(data){
                if(data){
                    $('.tr'+id).remove();
                }
            });
        }
    }
</script>
</body>
</html>