protected function page($_total) { $page = new Page($_total); $this->model->limit = $page->limit; $this->smarty->assign("num", $page->listRowsBegin()); $this->smarty->assign("page", $page->display()); }
private function show() { //Tools::dump($this->model->getAllUser()); $page = new Page($this->model->getAllUserTotal(), 5); $this->model->limit = $page->limit; $this->smarty->assign("num", $page->listRowsBegin()); $this->smarty->assign("page", $page->display()); $data = $this->model->getAllUser(); foreach ($data as $key => $value) { switch ($value->state) { case 0: $value->state = "<span style='color:red;'>[否]</span>\r\n\t\t\t\t\t\t\t<a href='?a=user&action=state&flag=show&id=" . $value->id . "'>通过</a>"; break; case 1: $value->state = "<span style='color:green;'>[是]</span>\r\n\t\t\t\t\t\t\t<a href='?a=user&action=state&flag=hide&id=" . $value->id . "'>否决</a>\t"; } } $this->smarty->assign('data', $data); $this->smarty->assign("show", true); }
private function showCourse() { $course = new courseModel(); $page = new Page($course->getAllCourseTotal(), 5); $course->limit = $page->limit; $allCourse = $course->getAllCourse(); foreach ($allCourse as $key => $value) { switch ($value->state) { case 0: $value->state = "<span style='color:red;'>[否]</span>\r\n\t\t\t\t\t\t\t<a href='?a=learning&action=state&flag=show&id=" . $value->id . "'>显示</a>"; break; case 1: $value->state = "<span style='color:green;'>[是]</span>\r\n\t\t\t\t\t\t\t<a href='?a=learning&action=state&flag=hide&id=" . $value->id . "'>隐藏</a>\t"; } } $this->course(); //Tools::dump($allCourse); $this->smarty->assign("num", $page->listRowsBegin()); $this->smarty->assign("page", $page->display()); $this->smarty->assign("data", $allCourse); $this->smarty->assign("showCourse", true); }