Esempio n. 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();
 }
Esempio n. 2
0
 public function getids()
 {
     $obj = new Admin_Model_Product();
     $entries = $obj->fetchAll();
     $arrUser = array();
     foreach ($entries as $entry) {
         $arrUser[$entry->getId()] = $entry->getUsername();
     }
     return $arrUser;
 }
 public function changeStatusAction()
 {
     $this->view->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     $id = $this->_getParam('id');
     $status = $this->_getParam('status');
     if ($status == 0) {
         $status = 1;
     } else {
         $status = 0;
     }
     $model = new Admin_Model_Product();
     $res = $model->changeStatus($id, $status);
     if (false === $res) {
         $arrResult = array("result" => 0);
     } else {
         $arrResult = array("result" => 1);
     }
     echo Zend_Json::encode($arrResult);
 }