12月112014
DWZ(J-ui)框架中分页组件的详细说明
<?php require_once './conf/dbconfig.php' ?> <?php require_once './model/db.class.php' ?> <?php $db = new Db('users'); $totalCount = $db->total();//获取总的数据条数 $pageNumShown=10;//分页的数字显示个数 $_POST["pageNum"]!=""?$pageNum=$_POST["pageNum"]:$pageNum=1;//获取当前页数据 $numPerPage=2;//每页显示条数 $fup_page=($pageNum-1)*$numPerPage;//获取limit的起始数据,limit($fup_page,$numPerPage). $res = $db->limit($fup_page,$numPerPage)->select(); ?> <form id="pagerForm" method="post" action="userlist.php"> <!--<input type="hidden" name="status" value="${param.status}">--> <!--<input type="hidden" name="keywords" value="${param.keywords}" />--> <input type="hidden" name="pageNum" value="<?php echo $pageNum;?>" /> <input type="hidden" name="numPerPage" value="<?php echo $numPerPage;?>" /> <!--<input type="hidden" name="orderField" value="${param.orderField}" />--><!-- 要排序的字段 --> <!--<input type="hidden" name="orderDirection" value="{$orderDirection}">--><!-- 字段的排序方式 --> </form> <div class="pageHeader"> <form onsubmit="return navTabSearch(this);" action="demo_page1.html" method="post"> <div class="searchBar"> <!--<ul class="searchContent"> <li> <label>我的客户:</label> <input type="text"/> </li> <li> <select class="combox" name="province"> <option value="">所有省市</option> <option value="北京">北京</option> <option value="上海">上海</option> <option value="天津">天津</option> <option value="重庆">重庆</option> <option value="广东">广东</option> </select> </li> </ul> --> <table class="searchContent"> <tr> <td> 我的客户:<input type="text" name="keyword" /> </td> <td> <select class="combox" name="province"> <option value="">所有省市</option> <option value="北京">北京</option> <option value="上海">上海</option> <option value="天津">天津</option> <option value="重庆">重庆</option> <option value="广东">广东</option> </select> </td> <td> 建档日期:<input type="text" class="date" readonly="true" /> </td> </tr> </table> <div class="subBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li> <li><a class="button" href="demo_page6.html" target="dialog" mask="true" title="查询框"><span>高级检索</span></a></li> </ul> </div> </div> </form> </div> <div class="pageContent"> <div class="panelBar"> <ul class="toolBar"> <li><a class="add" href="./useradd.html" target="dialog"><span>添加</span></a></li> <li><a class="delete" href="./dodel.php?id={item_id}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li> <li><a class="edit" href="useredit.php?id={item_id}" target="dialog"><span>修改</span></a></li> <li class="line">line</li> <li><a class="icon" href="demo/common/dwz-team.xls" target="dwzExport" targetType="navTab" title="实要导出这些记录吗?"><span>导出EXCEL</span></a></li> </ul> </div> <table class="table" width="100%" layoutH="138"> <thead> <tr> <th width="80">用户ID</th> <th width="120">姓名</th> <th align="center">年龄</th> <th width="100" align="center">性别</th> <th width="150" align="center">班级</th> </tr> </thead> <tbody> <?php foreach($res as $v){ ?> <tr target="item_id" rel="<?=$v['id'];?>"> <td><?=$v['id'];?></td> <td><?=$v['name'];?></td> <td><?=$v['age'];?></td> <td><?=$v['sex'];?></td> <td><?=$v['classid'];?></td> </tr> <?php } ?> </tbody> </table> <div class="panelBar"> <div class="pages"> <span>显示</span> <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})"> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> <option value="200">200</option> </select> <span>条,共<?php echo $db->total() ?>条</span> </div> <div class="pagination" targetType="navTab" totalCount="<?php echo $totalCount;?>" numPerPage="<?php echo $numPerPage;?>" pageNumShown="<?php echo $pageNumShown;?>" currentPage="<?php echo $pageNum;?>"></div> </div> </div>
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!