Exemplo n.º 1
0
 public function indexAction()
 {
     // action body
     $this->_helper->layout()->setLayout('rdinehomelayout');
     $clientService = new Application_Service_Client();
     $userCount = 100000 + $clientService->getNumberOfUsers();
     $this->view->userCount = $userCount;
 }
Exemplo n.º 2
0
 public function UpdateRestaurantUserStatus($request)
 {
     try {
         $msg = false;
         $userservice = new Application_Service_Client();
         $status = $userservice->UpdateRestaurantUserStatus($request);
         if ($request->status == 'ACT' && $status == true) {
             $msg = 'Restaurant User Activated Successfully.';
         } else {
             if ($request->status == 'INA' && $status == true) {
                 $msg = 'Restaurant User DeActivated Successfully.';
             }
         }
         return $msg;
     } catch (Exception $ex) {
         Rdine_Logger_FileLogger::info($ex->getMessage());
         throw new Exception($ex->getMessage());
     }
 }
Exemplo n.º 3
0
 public function createsubscribedfirmAction()
 {
     try {
         $auth = Zend_Auth::getInstance();
         if ($auth->hasIdentity()) {
             $storage = new Zend_Auth_Storage_Session();
             $data = $storage->read();
             $this->_helper->layout()->setLayout('adminlayout');
             $request = $this->getRequest();
             /* Populating Restaurant owners */
             $resownerMapper = new User_Model_ManagerDataMapper();
             $resOwners = $resownerMapper->fetchAll();
             $this->view->resowners = $resOwners;
             $userservice = new Application_Service_Client();
             $form = $userservice->getRestaurantOwnerForm();
             $this->view->form = $form;
             //				$CountryCodeMapper = new Application_Model_CountryCodeDataMapper();
             //		    	$CountryCode = $CountryCodeMapper->fetchAll();
             //		    	$CodeList = array();
             //		    	$CodeList[] = array('key'=>'','value'=>'Select Country Flag');
             //		    	foreach($CountryCode as $listcode){
             //		    		$CodeList[] = array('key'=>$listcode->getCountry_dial_code(),'value'=>$listcode->getCountry_flag());
             //		    	}
             //		    	$this->view->codelist = $CodeList;
             if (isset($request->userid)) {
                 $data['restownerId'] = $request->userid;
                 $rsoMapper = new User_Model_ManagerDataMapper();
                 $table = $rsoMapper->getDbTable();
                 $select = $table->select();
                 $select->setIntegrityCheck(false);
                 $select->from($table, array('rsofk_salution', 'rsofirst_name', 'rsolast_name', 'rsophone', 'rsostateid', 'rsocityid', 'rsoregionid', 'rso_companyid', 'presid', 'defaultview'))->join(array('rd.restaurant_details'), 'resfk_user = rsofk_user', array('resid'))->where('rsofk_user = ?', $request->userid)->where('resstatus = ?', 1);
                 $row = $table->fetchRow($select);
                 if ($row->resid != null) {
                     if ($row->presid != null) {
                         $data['RestId'] = $row->presid;
                     } else {
                         $data['RestId'] = $row->resid;
                     }
                     $restNameByOwnObj = new FirmManagement_Model_FirmNamesByOwnerId();
                     $restNameByOwnObj->setRestOwnerId($request->userid);
                     $restMapper = new FirmManagement_Model_FirmDataMapper();
                     $restList = $restMapper->getRestaurantNamesByOwnerId($restNameByOwnObj);
                     $data['restList'] = $restList;
                 } else {
                     $data['RestId'] = "";
                     $data['restList'] = "";
                 }
                 $storage->write($data);
                 if ($data['companyid'] != 6) {
                     return $this->_helper->redirector('addfirm', 'Firm', 'FirmManagement');
                 } else {
                     return $this->_helper->redirector('addroundmenufirm', 'Firm', 'FirmManagement');
                 }
             } else {
                 if ($this->getRequest()->isPost()) {
                     $result = $userservice->RegisterRestaurantOwner($this->getRequest()->getPost());
                     if ($result['status']) {
                         $data['restownerId'] = $result['userid'];
                         $storage->write($data);
                         if ($data['companyid'] != 6) {
                             return $this->_helper->redirector('addfirm', 'Firm', 'FirmManagement');
                         } else {
                             return $this->_helper->redirector('addroundmenufirm', 'Firm', 'FirmManagement');
                         }
                     } else {
                         if ($result['form']) {
                             $this->view->form = $result['form'];
                             $this->view->errors = $form;
                         }
                     }
                 }
             }
         } else {
             $this->_redirect($this->view->url(array('module' => 'User', 'controller' => 'Login', 'action' => 'signin'), 'login', true));
         }
     } catch (Exception $ex) {
         throw new Exception($ex->getMessage());
     }
 }