Example #1
0
 public function contactAction()
 {
     // action body
     $this->_helper->layout()->setLayout('layout');
     $admServ = new Application_Service_Administrator();
     if ($this->getRequest()->isPost()) {
         $result = $admServ->AddContact($this->getRequest()->getPost());
         if ($result['status']) {
             $params = $result['status'];
             $this->view->successmsg = true;
             $this->view->contactform = $admServ->getContactUsForm();
         } else {
             $this->view->contactform = $result['form'];
         }
     } else {
         $this->view->contactform = $admServ->getContactUsForm();
     }
 }
Example #2
0
 public function manageRestaurantOwners($data, $page)
 {
     try {
         $obj = new User_Model_RestOwnSearch();
         $adminService = new Application_Service_Administrator();
         $form = $adminService->getRestOwnerSearchForm();
         if ($form->isValid($data)) {
             if ($data) {
                 $formData = $form->getValues();
                 if ($formData['userId']) {
                     $obj->setId($formData['userId']);
                 }
                 if ($formData['email']) {
                     $obj->setEmail($formData['email']);
                 }
                 if ($formData['status']) {
                     $obj->setStatusId($formData['status']);
                 }
                 if ($formData['firstname']) {
                     $obj->setFirstname($formData['firstname']);
                 }
                 if ($formData['lastname']) {
                     $obj->setLastname($formData['lastname']);
                 }
                 if ($formData['state']) {
                     $obj->setStateid($formData['state']);
                 }
                 if ($formData['region']) {
                     $obj->setRegionid($formData['region']);
                 }
                 if ($formData['city']) {
                     $obj->setCityid($formData['city']);
                 }
                 if ($formData['resname']) {
                     $obj->setResName($formData['resname']);
                 }
                 if ($formData['company']) {
                     $obj->setCompany($formData['company']);
                 }
             }
             $userMapper = new User_Model_ClientDataMapper();
             $result = $userMapper->manageRestaurantOwners($obj, $page);
             return $result;
         }
     } catch (Exception $ex) {
         Rdine_Logger_FileLogger::info($ex->getMessage());
         throw new Exception($ex->getMessage());
     }
 }