Пример #1
0
 public function detailAction()
 {
     $params = Jos::getParams();
     $objProduct = new Admin_Model_Product();
     $this->view->data['product'] = $objProduct->getInfo($params['id']);
     $this->view->data['title'] = $this->view->data['product']['pro_title'];
     $objSlider = new Admin_Model_Slider();
     $this->view->data['slider'] = $objSlider->listSlider(0, 4);
     $this->view->layout();
 }
Пример #2
0
 public function indexAction()
 {
     $params = Jos::getParams();
     if (Jos::isPost()) {
         if ($this->checkForm($params)) {
             $objUser = new Admin_Model_User();
             $username = $params['name'];
             $password = $params['password'];
             $check = $objUser->checkLogin($username, $password);
             if ($check > 0) {
                 $_SESSION['name'] = $username;
                 redirect('admin/home');
             } else {
                 $this->view->errorLogin = "******";
             }
         }
     }
     $this->view->layout();
 }
Пример #3
0
 /**
  * [_check description]
  * @param  [type] $params [description]
  * @return [type]         [description]
  */
 private function _check($params)
 {
     $flag = true;
     if (Jos::isNull($params['name'])) {
         $flag = false;
         $this->view->errorName = "Name not null !!!";
     }
     if (Jos::isNull($params['title'])) {
         $flag = false;
         $this->view->errorTitle = "Title not null !!!";
     }
     if (Jos::isNull($params['description'])) {
         $flag = false;
         $this->view->errorDescription = "Description not null !!!";
     }
     if (Jos::isNull($params['rewrite'])) {
         $flag = false;
         $this->view->errorRewrite = "Rewrite not null !!!";
     }
     return $flag;
 }
Пример #4
0
 /**
  * [_checkData description]
  * @param  [type] $params [description]
  * @return [type]         [description]
  */
 private function _checkData($params)
 {
     $flag = true;
     if (Jos::isNull($params['class'])) {
         $flag = false;
         $this->view->errorClass = "Please select class !!!";
     }
     if (Jos::isNull($params['category'])) {
         $flag = false;
         $this->view->errorCategory = "Please select category !!!";
     }
     return $flag;
 }
Пример #5
0
 /**
  * [checkData description]
  * @param  [type] $params [description]
  * @return [type]         [description]
  */
 private function checkData($params)
 {
     $flag = true;
     if (Jos::isNull($params['name'])) {
         $flag = false;
         $this->view->errorName = "Please enter class name !!!";
     }
     if (Jos::isNull($params['rewrite'])) {
         $flag = false;
         $this->view->errorRewrite = "Please enter class rewrite !!!";
     }
     return $flag;
 }
Пример #6
0
 /**
  * Check Data
  */
 private function checkData($params)
 {
     $flag = true;
     if (Jos::isNull($params['name'])) {
         $flag = false;
         $this->view->errorCateName = "Please enter category name !!!";
     }
     if (Jos::isNull($params['title'])) {
         $flag = false;
         $this->view->errorCateTitle = "Please enter category title !!!";
     }
     if (Jos::isNull($params['keyword'])) {
         $flag = false;
         $this->view->errorCateKeyword = "Please enter category meta keyword !!!";
     }
     if (Jos::isNull($params['rewrite'])) {
         $flag = false;
         $this->view->errorCateRewrite = "Please enter category rewrite !!!";
     }
     return $flag;
 }