zoukankan      html  css  js  c++  java
  • page show

    controller

        public function record()
        {
            $r     = 10;
            $m     = M();
            $query = $m->query('select count(1) as count from winner');
            $total = $query[0]['count'];
            $page  = new ThinkPage($total,$r);// 实例化分页类 传入总记录数和每页显示的记录数(25)
            $show  = $page->show();// 分页显示输出
            $list  = $m->query("select w.id, w.uid, w.create_time, u.username, i.name from winner as w, user as u, item as i where u.id=w.uid and i.id=w.prize_id order by w.create_time limit $page->firstRow, $page->listRows");
            $this->assign('list',$list);// 赋值数据集
            $this->assign('page',$show);// 赋值分页输出
            $this->display(T('Winner@Admin/record'));
        }

    view

    <extend name="Public/base"/>
    
    <block name="body">
        <div class="main-title">
            <h2>中奖纪录</h2>
        </div>
    
        <div class="with-padding">
            <form id="export-form" method="post" action="{:U('export')}">
                <table class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>ID</th>
                            <th>用户名</th>
                            <th>奖品</th>
                            <th>时间</th>
                        </tr>
                    </thead>
                    <tbody>
                        <volist name="list" id="table">
                            <tr>
                                <td>{$i}</td>
                                <td>{$table.id}</td>
                                <td><a href='/xxx/index.php?s=/admin/user/expandinfo_details/uid/{$table.uid}.html'> {$table.username}</a></td>
                                <td>{$table.name}</td>
                                <td><?php echo date('Y-m-d H:i:s', $table['create_time']);?></td>
                            </tr>
                        </volist>
                    </tbody>
                </table>
            </form>
        </div>
        {$page}
    </block>
  • 相关阅读:
    OC2_数组操作
    OC1_数组创建
    OC6_字符串练习
    Python3学习笔记12-定义函数及调用
    Python3学习笔记11-循环语句
    Python3学习笔记10-条件控制
    Python3学习笔记09-字典
    Python3学习笔记08-tuple
    Python3学习笔记07-List
    Python3学习笔记05-数字
  • 原文地址:https://www.cnblogs.com/fenle/p/5260964.html
Copyright © 2011-2022 走看看