public function init()
 {
     /* Populating Restaurant  Status Bd*/
     $StatusMapper = new Application_Model_UserStatusDataMapper();
     $statusres = $StatusMapper->fetchAll();
     $statusresLst = array();
     $statusresLst[] = array('key' => '', 'value' => 'Select Status');
     foreach ($statusres as $val) {
         $statusresLst[] = array('key' => $val->getId(), 'value' => $val->getDescription());
     }
     /* Populating State Base Data */
     $stateMapper = new Application_Model_StatebdMapper();
     $states = $stateMapper->fetchAll();
     $stateList = array();
     $stateList[] = array('key' => '', 'value' => 'Select Country');
     foreach ($states as $state) {
         $stateList[] = array('key' => $state->getId(), 'value' => $state->getDescription());
     }
     //         $companyList = array();
     //     	$companyMapper = new Administrator_Model_CompanyDataMapper();
     //     	$companyList = $companyMapper->getAllComapnyList();
     $firstName = $this->createElement('text', 'firstname');
     $firstName->removeDecorator('Label')->setAttrib('class', 'inp1 form input_form')->setAttrib('placeholder', 'First Name')->setAttrib('title', 'First Name')->removeDecorator('HtmlTag')->addFilters(array('StringTrim'))->setValue('');
     $resName = $this->createElement('text', 'resname');
     $resName->removeDecorator('Label')->setAttrib('class', 'inp1 form input_form')->setAttrib('placeholder', 'Restaurant Name')->setAttrib('title', 'Restaurant Name')->removeDecorator('HtmlTag')->addFilters(array('StringTrim'))->setValue('');
     $lastName = $this->createElement('text', 'lastname');
     $lastName->removeDecorator('Label')->setAttrib('class', 'inp1 form input_form')->setAttrib('placeholder', 'Last Name')->setAttrib('title', 'Last Name')->removeDecorator('HtmlTag')->addFilters(array('StringTrim'))->setValue('');
     $userId = $this->createElement('text', 'userId');
     $userId->removeDecorator('Label')->setAttrib('class', 'inp1 form input_form')->setAttrib('placeholder', 'User Id')->setAttrib('title', 'User Id')->removeDecorator('HtmlTag')->addValidator('Digits', new Zend_Validate_Digits(), array('messages' => 'Please enter Numbers only'))->setValue('');
     $email = $this->createElement('text', 'email');
     $email->removeDecorator('Label')->setAttrib('class', 'inp1 form input_form')->setAttrib('placeholder', 'Email')->setAttrib('title', 'Email')->removeDecorator('HtmlTag')->addFilters(array('StringTrim'))->setValue('');
     $Status = $this->createElement('select', 'status');
     $Status->removeDecorator('Label')->removeDecorator('HtmlTag')->setAttrib('class', 'drpDown form input_form')->setAttrib('title', 'Status')->addMultiOptions($statusresLst);
     $state = $this->createElement('select', 'state');
     $state->removeDecorator('Label')->removeDecorator('HtmlTag')->setAttrib('class', 'sel1 form input_form')->setAttrib('title', 'Country')->addValidators(array(array('NotEmpty', true, array('messages' => 'Please select State.'))))->addMultiOptions($stateList)->setRequired(false);
     $region = $this->createElement('select', 'region');
     $region->removeDecorator('Label')->removeDecorator('HtmlTag')->setAttrib('class', 'drpDown form input_form')->setAttrib('title', 'State')->setRegisterInArrayValidator(false)->setRequired(false);
     $city = $this->createElement('select', 'city');
     $city->removeDecorator('Label')->removeDecorator('HtmlTag')->setAttrib('class', 'sel1 form input_form')->setAttrib('title', 'City')->addValidators(array(array('NotEmpty', true, array('messages' => 'Please select City.'))))->setRegisterInArrayValidator(false)->setRequired(false);
     //          $company = $this->createElement('select','company');
     // 		 $company->removeDecorator('Label')
     //          	     ->removeDecorator('HtmlTag')
     // //         	     ->setAttrib('style','width:160px')
     //          	     ->setAttrib('class','drpDown form input_form')
     //          	     ->setAttrib('title','Company')
     //                  ->addMultiOptions($companyList);
     $Search = $this->createElement('submit', 'search');
     $Search->removeDecorator('Label')->removeDecorator('DtDdWrapper')->setValue('Search')->setAttrib('class', 'submitBtn')->setIgnore(true);
     $this->addElements(array($userId, $email, $resName, $firstName, $lastName, $Status, $state, $region, $city, $Search));
 }
 public function init()
 {
     $userId = $this->createElement('hidden', 'userid');
     $userId->removeDecorator('HtmlTag');
     $restNameCtl = $this->createElement('select', 'RestaurantName');
     $restNameCtl->removeDecorator('Label')->removeDecorator('HtmlTag')->setAttrib('class', 'form inp1')->setAttrib('style', 'height:auto')->setRegisterInArrayValidator(false)->setRequired(true);
     $userName = $this->createElement('text', 'username');
     $userName->removeDecorator('Label')->removeDecorator('HtmlTag')->setAttrib('maxlength', '40')->setAttrib('class', 'form inp1')->setAttrib('style', 'height:auto')->addFilters(array('StringTrim'))->addValidator('StringLength', false, array(0, 40))->setValue('')->setRequired(true);
     $emailAddress = $this->createElement('text', 'emailAddress');
     $emailAddress->removeDecorator('Label')->removeDecorator('HtmlTag')->setAttrib('maxlength', '40')->setAttrib('class', 'form inp1')->setAttrib('style', 'height:auto')->addValidator('StringLength', false, array(5, 50))->addValidator('EmailAddress')->addFilters(array('StringTrim'))->setValue('')->setRequired(true);
     $statusMapper = new Application_Model_UserStatusDataMapper();
     $status = $statusMapper->fetchAll();
     $statusList = array();
     $statusList[] = array('key' => '0', 'value' => 'Select status');
     foreach ($status as $value) {
         $statusList[] = array('key' => $value->getId(), 'value' => $value->getDescription());
     }
     $status = $this->createElement('select', 'status');
     $status->removeDecorator('Label')->removeDecorator('HtmlTag')->addMultiOptions($statusList)->setAttrib('class', 'form inp1')->setAttrib('style', 'height:auto')->setRequired(true);
     $search = $this->createElement('submit', 'Search');
     $search->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setValue('Submit')->setAttrib('class', 'submitBtn')->setIgnore(true);
     $this->addElements(array($userId, $restNameCtl, $userName, $emailAddress, $status, $search));
 }
Example #3
0
 public function getUserStatusIdByCode($code)
 {
     try {
         $Mapper = new Application_Model_UserStatusDataMapper();
         $List = $Mapper->fetchAll();
         foreach ($List as $status) {
             if ($code == $status->code) {
                 return $status;
             }
         }
     } catch (Exception $ex) {
         throw new Exception($ex->getMessage());
     }
 }