public function indexAction() { $thingsMapper = new Application_Model_ThingsMapper(); $sql = "1"; $categoryid = $this->getRequest()->getParam("category"); if (!empty($categoryid)) { $sql .= " AND thingscategories_id = " . (int) $categoryid; } if (Zend_Auth::getInstance()->hasIdentity()) { $this->view->allthings = $thingsMapper->getthings(Zend_Auth::getInstance()->getStorage()->read()->id, $sql); } else { $this->view->allthings = $thingsMapper->getthings(null, $sql); } }
public function thingAction() { $mapper = new Application_Model_ThingsMapper(); if ($this->getRequest()->getParam('itemid')) { if (Zend_Auth::getInstance()->hasIdentity()) { $this->view->thing = $mapper->selectThing($this->getRequest()->getParam('itemid'), new Application_Model_Things()); $this->view->images = $mapper->findimage($this->getRequest()->getParam('itemid')); $this->view->mythings = $mapper->fetchAll(Zend_Auth::getInstance()->getStorage()->read()->id); } else { $this->view->thing = $mapper->selectThing($this->getRequest()->getParam('itemid'), new Application_Model_Things()); $this->view->images = $mapper->findimage($this->getRequest()->getParam('itemid')); } } }
public function deletethingAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); if ($this->getRequest()->isPost()) { $itemid = $this->getRequest()->getParam("itemid"); $mapper = new Application_Model_ThingsMapper(); $mapper->deleteThing($itemid); echo "oil ok"; } else { echo "no post"; } }