Пример #1
0
 public function index()
 {
     $manager = M('Manager');
     //1.获得当前记录总条数
     $total = $manager->count();
     $per = 7;
     //2.实例化分页类对象
     $page = new \Component\Page($total, $per);
     //autoload
     //3.拼装sql语句获得每页信息
     if ($_GET['search']) {
         $search = $_GET['search'];
         $sql = "select * from blog_manager where username like '%" . $search . "%' " . $page->limit;
     } else {
         $sql = "select * from blog_manager " . $page->limit;
     }
     $data = $manager->query($sql);
     //4.获得页码列表
     $pagelist = $page->fpage();
     // $data=$manager->select();
     $this->assign('title', '管理员列表');
     $this->assign('pagelist', $pagelist);
     $this->assign('data', $data);
     $this->display();
 }
 function manage()
 {
     $user = D("User");
     $total = $user->count();
     $per = 10;
     $page = new \Component\Page($total, $per);
     $sql = "select * from tuser order by TimeStart desc " . $per->limit;
     $info = $user->query($sql);
     $pagelist = $page->fpage();
     $this->assign('info', $info);
     $this->assign('pagelist', $pagelist);
     $this->display();
 }
 function manage()
 {
     $thesis = D("Thesis");
     $total = $thesis->count();
     $per = 10;
     $page = new \Component\Page($total, $per);
     $sql = "select * from tthesis order by ThesisId desc " . $page->limit;
     $info = $thesis->query($sql);
     $pagelist = $page->fpage();
     $this->assign('info', $info);
     $this->assign('pagelist', $pagelist);
     $this->display();
 }
 public function con_show_history_email()
 {
     R("Authengin/auth_request_datamanager");
     $email = D('Emails');
     $total = $email->count();
     $per = 6;
     $page = new \Component\Page($total, $per);
     $sql = "select * from dm_emails order by sendtime desc " . $page->limit;
     $info = $email->query($sql);
     $pagelist = $page->fpage();
     //分配分页列表数据
     $this->assign("pagelist", $pagelist);
     //分配表格
     $this->assign("email_info", $info);
     $this->assign("oper_info", "可以使用混合查询的方式");
     $this->display();
 }
 public function show()
 {
     $goods = D('Goods');
     //1.获得当前纪录总条数
     $total = $goods->count();
     $per = 7;
     //2.实例化分页对象
     $page = new \Component\Page($total, $per);
     //3.拼装SQL语句,获得每页信息
     $sql = "SELECT * FROM sw_goods " . $page->limit;
     $info = $goods->query($sql);
     //4.获得页码列表
     $pagelist = $page->fpage();
     $this->assign('info', $info);
     $this->assign('pagelist', $pagelist);
     $this->display();
 }
Пример #6
0
 function showlist()
 {
     $total = D('auth')->count();
     $per = 7;
     //实例化page类
     //$page=new \Compontent\Page($total,$listRows);//autoLoad();
     $page = new \Component\Page($total, $per);
     //autoload
     //3. 拼装sql语句获得每页信息
     $sql = "select * from sw_auth " . $page->limit;
     $info = D('auth')->query($sql);
     //4. 获得页码列表
     $pagelist = $page->fpage();
     $info = $this->getInfo();
     $this->assign('pagelist', $pagelist);
     $this->assign('info', $info);
     $this->display();
 }
 function manage()
 {
     $news = D('News');
     //1. 获得当前记录总条数
     $total = $news->count();
     $per = 10;
     //2. 实例化分页类对象
     $page = new \Component\Page($total, $per);
     //autoload
     //3. 拼装sql语句获得每页信息
     $sql = "select * from tnews order by NewsId desc " . $page->limit;
     $info = $news->query($sql);
     //4. 获得页码列表
     $pagelist = $page->fpage();
     $this->assign('info', $info);
     $this->assign('pagelist', $pagelist);
     $this->display();
 }
Пример #8
0
 public function index()
 {
     $resource = D('Resource');
     $total = $resource->count();
     $per = 7;
     $page = new \Component\Page($total, $per);
     if ($_GET['search']) {
         $search = $_GET['search'];
         $sql = "select * from blog_resource where header like '%" . $search . "%' " . $page->limit;
     } else {
         $sql = "select * from blog_resource " . $page->limit;
     }
     // $data=$resource->select();
     $data = $resource->query($sql);
     $pagelist = $page->fpage();
     $this->assign('data', $data);
     $this->assign('pagelist', $pagelist);
     $this->display();
 }
 function showlist(){
     
     $goods = D("Goods");
     
     //1. 获得当前记录总条数
     $total = $goods -> count();
     $per = 7;
     //2. 实例化分页类对象
     $page = new \Component\Page($total, $per); //autoload
     //3. 拼装sql语句获得每页信息
     $sql = "select * from sw_goods ".$page->limit;
     $info = $goods -> query($sql);
     //4. 获得页码列表
     $pagelist = $page -> fpage();
     
     $this -> assign('info', $info);
     $this -> assign('pagelist', $pagelist);
     $this -> display();
 }
Пример #10
0
 public function index()
 {
     $album = D('Album');
     $total = $album->count();
     $per = 7;
     $page = new \Component\Page($total, $per);
     if ($_GET['search']) {
         $search = $_GET['search'];
         $sql = "select * from blog_album where album_name like '%" . $search . "%' " . $page->limit;
     } else {
         $sql = "select * from blog_album " . $page->limit;
     }
     // $data=$album->select();
     $pagelist = $page->fpage();
     $data = $album->query($sql);
     $this->assign('data', $data);
     $this->assign('pagelist', $pagelist);
     $this->display();
 }
 function manage()
 {
     $datasets = D('Datasets');
     //object(Admin\DatasetsModel)
     //1. 获得当前记录总条数
     $total = $datasets->count();
     $per = 10;
     //2. 实例化分页类对象
     $page = new \Component\Page($total, $per);
     //autoload
     //3. 拼装sql语句获得每页信息
     $sql = "select * from tdatasets " . $page->limit;
     $info = $datasets->query($sql);
     //4. 获得页码列表
     $pagelist = $page->fpage();
     $this->assign('info', $info);
     $this->assign('pagelist', $pagelist);
     $this->display();
 }
Пример #12
0
 function showlist()
 {
     $goods = D('Goods');
     $total = $goods->count();
     $per = 7;
     //实例化page类
     //$page=new \Compontent\Page($total,$listRows);//autoLoad();
     $page = new \Component\Page($total, $per);
     //autoload
     //3. 拼装sql语句获得每页信息
     $sql = "select * from sw_goods " . $page->limit;
     $info = $goods->query($sql);
     //4. 获得页码列表
     $pagelist = $page->fpage();
     // $info = $goods -> select();//获得数据信息
     //把数据assign到模板
     //价格大于1000元的商品
     //where(内部$this,return $this)
     //$('div').css('color','red').css('font-size','30px')
     // $info = $goods -> where("goods_price > 1000 and goods_name like '索%'")->select();
     //查询指定的字段
     //$info = $goods->field("goods_id,goods_name")->select();
     //限制条数
     // $info = $goods->limit(10,5)->select();
     //分组查询group by
     //查询当前商品一共的分组信息
     //通过分组设置可以查询每个分组的商品信息
     //例如:每个分组下边有多少商品信息
     //      select category_id,count(*) from table group by category_id
     //      每个分组下边商品的价格算术和是多少
     //      select category_id,sum(price) from table group by category_id
     //$info = $goods->field('goods_category_id')->select(); //有重复的
     //$info = $goods ->field('goods_category_id')-> group('goods_category_id')->select();
     //show_bug($info);
     //排序显示结果order by goods_price desc
     //$info = $goods ->order('goods_price asc')-> select();
     $this->assign('info', $info);
     //把数据传到模板中去
     $this->assign('pagelist', $pagelist);
     $this->display();
 }
 function index_news()
 {
     $news = D('News');
     $total = $news->count();
     $per = 12;
     $page = new \Component\Page($total, $per);
     $sql = "select * from tnews order by NewsId desc " . $page->limit;
     $info = $news->query($sql);
     $pagelist = $page->fpage();
     $this->assign('info', $info);
     $this->assign('pagelist', $pagelist);
     $this->display();
 }
 public function con_friend_link()
 {
     $friendlink = D('Friendlink');
     $total = $friendlink->count();
     $per = 14;
     $page = new \Component\Page($total, $per);
     $sql = "select * from dm_friendlink " . $page->limit;
     $info = $friendlink->query($sql);
     $pagelist = $page->fpage();
     //分配分页列表数据
     $this->assign("pagelist", $pagelist);
     //分配表格
     $this->assign("friendlink_info", $info);
     $this->display();
 }
 public function con_friend_link_manager()
 {
     R("Authengin/auth_request_datamanager");
     $flink = D('Friendlink');
     $total = $flink->count();
     $per = 4;
     $page = new \Component\Page($total, $per);
     $sql = "select * from dm_friendlink " . $page->limit;
     $info = $flink->query($sql);
     $pagelist = $page->fpage();
     //分配分页列表数据
     $this->assign("pagelist", $pagelist);
     //分配表格
     $this->assign("flink", $info);
     $this->display();
 }