public function userBorrow()
 {
     //获取图书馆信息
     $lib = D("library");
     $library = $lib->field("id,bbs")->find("1");
     $library = explode("。", $library["bbs"]);
     //实例化数据表
     $info = D("borrow");
     //分页效果
     $total = $info->count();
     $per = 8;
     $pages = new \Tools\page($total, $per);
     //获取session数据
     $re_id = session("re_id");
     /*******判断未登陆*******/
     if ($re_id == null) {
         echo "<script type='text/javascript'>alert('请登陆后查看!');history.back();</script>";
         die;
     }
     $borrow = $info->query("SELECT a.id,a.borrowtime,a.status,a.reverttime,b.bo_code,b.bo_name,b.bo_id FROM `li_borrow`as a left join `li_book` as b on a.bookid=b.bo_id where readerid={$re_id} {$pages->limit}");
     //获取分页
     $pagelist = $pages->fpage(array(3, 4, 5, 6, 7, 8));
     //载入smarty模板
     $this->assign("session", session());
     $this->assign("borrow", $borrow);
     $this->assign("pagelist", $pagelist);
     $this->assign("library", $library);
     //载入视图
     $this->display("userborrowreglist");
 }
 function index()
 {
     //实例化数据表
     $info = D("booktype");
     if (!empty($_POST)) {
         $add = $info->create($_POST);
         if ($add) {
             $type = $info->add($add);
             if ($type) {
                 echo "<font style='color:red'>添加成功!</font>";
             } else {
                 echo "<font style='color:red'>添加失败!</font>";
             }
         }
     } else {
         //做分页效果
         $total = $info->count();
         $per = 8;
         //每页显示的条数
         $pages = new \Tools\page($total, $per);
         //查询数据表的数据
         $type_name = $info->query("select by_id,by_name from li_booktype {$pages->limit}");
         //获得页码列表
         $pagelist = $pages->fpage(array(3, 4, 5, 6, 7, 8));
         //载入smarty模板
         $this->assign("type_name", $type_name);
         $this->assign("pagelist", $pagelist);
         //载入视图
         $this->display("booktype");
     }
 }
 public function index()
 {
     //实例化数据表
     $info = D("press");
     if (!empty($_POST)) {
         $add = $info->create($_POST);
         if ($add) {
             $press = $info->add($add);
             if ($press) {
                 echo "<font style='color:red'>添加成功!</font>";
             } else {
                 echo "<font style='color:red'>添加失败!</font>";
             }
         }
     } else {
         //分页效果
         $total = $info->count();
         $per = 8;
         $pages = new \Tools\page($total, $per);
         $limit = str_replace(" ", "", $pages->limit);
         //查询数据表
         $press_info = $info->limit(substr($limit, 5))->select();
         $pagelist = $pages->fpage(array(3, 4, 5, 6, 7, 8));
         //载入smarty模板
         $this->assign("press_info", $press_info);
         $this->assign("pagelist", $pagelist);
         //载入视图
         $this->display("publishing");
     }
 }
 function index()
 {
     //实例化数据表
     $info = D("bookcase");
     if (!empty($_POST)) {
         $add = $info->create($_POST);
         if ($add) {
             $case = $info->add($add);
             if ($case) {
                 echo "<font style='color:red'>添加成功!</font>";
             } else {
                 echo "<font style='color:red'>添加失败!</font>";
             }
         }
     } else {
         //分页效果
         $total = $info->count();
         $per = 8;
         $pages = new \Tools\page($total, $per);
         //查询数据表的数据
         $limit = str_replace(" ", "", $pages->limit);
         $case_name = $info->field("ca_name,ca_id")->limit(substr($limit, 5))->select();
         $pagelist = $pages->fpage(array(3, 4, 5, 6, 7, 8));
         //载入smarty模板
         $this->assign("case_name", $case_name);
         $this->assign("pagelist", $pagelist);
         //载入视图
         $this->display("bookcase");
     }
 }
 public function book()
 {
     //实例化数据表
     $book = new \Model\BookModel();
     //分页效果
     $total = $book->count();
     $per = 10;
     $pages = new \Tools\page($total, $per);
     $book_info = $book->query("SELECT a.bo_id,a.bo_code,a.bo_name,a.bo_stock,b.by_name,c.pr_name,d.ca_name FROM `li_book`as a left join li_booktype as b on a.bo_typeid=b.by_id left join li_press as c on a.bo_pressid=c.pr_id left join li_bookcase as d on a.bo_bookcaseid=d.ca_id {$pages->limit} ");
     $pagelist = $pages->fpage(array(3, 4, 5, 6, 7, 8));
     //载入smarty模板
     $this->assign("info", $book_info);
     $this->assign("pagelist", $pagelist);
     $this->display();
 }
 public function reader()
 {
     //获取读者信息
     $reader = new \Model\ReaderModel();
     //分页效果
     $total = $reader->count();
     $per = 3;
     $pages = new \Tools\page($total, $per);
     $read_info = $reader->query("select a.re_id,a.re_name,a.re_code,b.rt_name,c.pa_type,a.re_number,a.re_tel,a.re_email,a.re_num from li_reader as a left join li_readertype as b on a.re_typeid=b.rt_id left join li_papers as c on a.re_paperid=c.pa_id {$pages->limit}");
     $pagelist = $pages->fpage(array(3, 4, 5, 6, 7, 8));
     //载入smarty模板
     $this->assign("read_info", $read_info);
     $this->assign("pagelist", $pagelist);
     $this->display();
 }
 public function index()
 {
     //获取图书信息
     $book = new \Model\BookModel();
     //做分页效果
     $total = $book->count();
     $per = 10;
     //每页显示的条数
     $pages = new \Tools\page($total, $per);
     $book_info = $book->query("SELECT a.bo_id,a.bo_code,a.bo_name,a.bo_author,a.bo_price,a.bo_borrowtimes,b.by_name,c.pr_name,d.ca_name FROM `li_book`as a left join li_booktype as b on a.bo_typeid=b.by_id left join li_press as c on a.bo_pressid=c.pr_id left join li_bookcase as d on a.bo_bookcaseid=d.ca_id order by bo_borrowtimes desc {$pages->limit}");
     //获得页码列表
     $pagelist = $pages->fpage(array(3, 4, 5, 6, 7, 8));
     // var_dump($pagelist);
     // die();
     //载入smarty模板
     $this->assign("book_info", $book_info);
     $this->assign("pagelist", $pagelist);
     $this->display();
 }
 public function bookMustread()
 {
     //获取图书馆信息
     $library = $this->library();
     //获取图书必读信息
     $info = new \Model\BookModel();
     //分页效果
     $total = $info->count();
     $per = 8;
     $pages = new \Tools\page($total, $per);
     $mustread = $info->query("SELECT a.bo_id,a.bo_code,a.bo_name,b.by_name,c.pr_name,d.ca_name,a.bo_stock FROM `li_book`as a left join li_booktype as b on a.bo_typeid=b.by_id left join li_press as c on a.bo_pressid=c.pr_id left join li_bookcase as d on a.bo_bookcaseid=d.ca_id where bo_mustread=1 {$pages->limit}");
     $pagelist = $pages->fpage(array(3, 4, 5, 6, 7, 8));
     // 载入smarty模板
     $this->assign("library", $library);
     $this->assign("mustread", $mustread);
     $this->assign("pagelist", $pagelist);
     //载入视图
     $this->display("book_bidu");
 }