public function indexAction() { $myThingsMapper = new Application_Model_ThingsMapper(); $otherThingsMapper = new Application_Model_ThingsMapper(); $accountMapper = new Application_Model_RegisterMapper(); $this->view->mydojodata = $myThingsMapper->fetchAll(Zend_Auth::getInstance()->getStorage()->read()->id); $id = ''; if ($this->getRequest()->isPost()) { if ($this->_hasParam('userid')) { $id = $this->_getParam('userid'); } } $this->view->othersthings = $otherThingsMapper->findotherthings(Zend_Auth::getInstance()->getStorage()->read()->id, $id); $this->view->users = $accountMapper->selectAllUsers(Zend_Auth::getInstance()->getStorage()->read()->id); }
public function profileAction() { $profileForm = new Application_Form_ProfileForm(); $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $user = new Application_Model_Register($profileForm->getValues()); $mapper = new Application_Model_RegisterMapper($user); $result = $mapper->find(array($userInfo->id), $user); $profileForm->populate($result); $profileForm->save->setAttrib('onClick', 'validateForSubmit(\'' . $profileForm->getName() . '\');'); $this->view->profileForm = $profileForm; if ($this->getRequest()->isPost()) { if ($profileForm->isValid($this->getRequest()->getPost())) { $user = new Application_Model_Register($profileForm->getValues()); $mapper = new Application_Model_RegisterMapper($user); $mapper->update($user, $userInfo->id); } } }