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>
  • 相关阅读:
    CF763C Timofey and Remoduling
    CF762E Radio Stations
    CF762D Maximum Path
    CF763B Timofey and Rectangles
    URAL1696 Salary for Robots
    uva10884 Persephone
    LA4273 Post Offices
    SCU3037 Painting the Balls
    poj3375 Network Connection
    Golang zip压缩文件读写操作
  • 原文地址:https://www.cnblogs.com/fenle/p/5260964.html
Copyright © 2011-2022 走看看