Exemplo n.º 1
0
 public function index()
 {
     $msg = new MsgModel();
     $str = "";
     $p = isset($_GET['p']) ? $_GET['p'] : 1;
     $pageSize = 12;
     $curPage = ($p - 1) * $pageSize;
     $limit = $curPage . ',' . $pageSize;
     $message = $msg->getMsg($limit);
     if (isset($_SESSION['user'])) {
         $mark = 1;
         $user = new UserModel();
         $uerinfo = $user->userInfo($_SESSION['user']);
         $this->assign('info', $uerinfo);
     } else {
         $mark = 0;
     }
     $counts = $msg->msgCount();
     if ($counts > $pageSize) {
         $page = new Page($counts, $p, $pageSize);
         $str = $page->show('themeuk.php');
     }
     $this->assign('page', $str);
     $this->assign('msg', $message);
     $this->assign('mark', $mark);
     $this->display();
 }