コード例 #1
0
ファイル: controller_book.php プロジェクト: VitalHawk/Library
 public function Add($params)
 {
     //print_r($_SESSION['user']);
     if (user_admin()) {
         $this->view->Show('book_add.tpl', array('books' => Book::Find($this->conn, $params['pubId'], $params['catId']), 'pubs' => array(-1 => '- Все -') + Publisher::GetAll($this->conn), 'pubId' => $params['pubId'], 'cats' => array(-1 => '- Все -') + Category::GetAll($this->conn), 'catId' => $params['catId']));
     } else {
         $this->view->Show('access_denied.tpl', array('mode' => 'Добавление книги'));
     }
 }
コード例 #2
0
 public function Index($params)
 {
     $this->view->Show('books.tpl', array('books' => Book::Find($this->conn, $params['pubId'], $params['catId'], $params['authId']), 'pubs' => array(-1 => '- Все -') + Publisher::GetAll($this->conn), 'pubId' => $params['pubId'], 'cats' => array(-1 => '- Все -') + Category::GetAll($this->conn), 'catId' => $params['catId'], 'auth' => array(-1 => '- Все -') + Author::GetAll($this->conn), 'authId' => $params['authId']));
     //        $this->smarty->assign('books', Book::Find($this->conn, $params['pubId'], $params['catId']));
     //
     //        $this->smarty->assign('pubs', array(-1 => '- Все -') + Publisher::GetAll($this->conn));
     //        $this->smarty->assign('pubId', $params['pubId']);
     //
     //        $this->smarty->assign('cats', array(-1 => '- Все -') + Category::GetAll($this->conn));
     //        $this->smarty->assign('catId', $params['catId']);
     //
     //        $this->smarty->display('books.tpl');
 }