protected function buildCat2Element() { $cat2 = new Zend_Form_Element_Radio('cat2'); $cat2->setLabel($this->_business->getCat2Name()); $cat2->addMultiOptions($this->_business->getCat2Array(null, false)); $cat2->setValue($this->_business->getFirstCat2(null, false)); $cat2->setAttrib('class', 'refineformselect'); $cat2->setAttrib('onclick', "changeCat2(this.id,this.value, '/ajax/realestate/changecat2/')"); $this->addElement($cat2); }
protected function buildCat1Element() { $cat1 = new Zend_Form_Element_Radio('cat1'); $cat1->setLabel($this->_business->getCat1Name()); $cat1->setMultiOptions($this->_business->getCat1Array()); //$cat1->setValue($this->_business->getFirstCat1()); logfire('FFFkey', $this->_business->getFirstCat1()); $cat1->setValue($this->_business->getFirstCat1()); $cat1->setAttrib('class', 'refineformselect'); $this->addElement($cat1); }
public function __construct($options = null) { // $this->_disabledDefaultActions = true; // $this->_object = $options['object']; unset($options['object']); parent::__construct($options); // Subform for the retailer status on website $retailerForm = new Cible_Form_SubForm(); $retailerForm->setName('retailerForm')->removeDecorator('DtDdWrapper'); //checkbox to set the retailers address as valid $isValid = new Zend_Form_Element_Checkbox('R_Active'); $isValid->setLabel($this->getView()->getCibleText('form_label_approved_onweb')); $isValid->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $retailerForm->addElement($isValid); $isRetailer = new Zend_Form_Element_Radio('isDistributeur'); $isRetailer->setLabel($this->getView()->getCibleText('form_label_Display_web'))->setOrder(0); $isRetailer->setSeparator(''); $isRetailer->setAttrib('class', 'vertAlignRadio'); $isRetailer->addMultiOptions(array(1 => $this->getView()->getCibleText('form_account_no'), 2 => $this->getView()->getCibleText('form_account_yes')))->setValue(1); $txtFr = new Cible_Form_Element_Html('lblFr', array('value' => $this->getView()->getCibleText('form_address_retailer_fr'))); $txtFr->setOrder(1)->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'formLanguage')))); $retailerForm->addElement($txtFr); $adressRetailer = new Cible_View_Helper_FormAddress($retailerForm); $adressRetailer->enableFields(array('name' => true, 'firstAddress' => false, 'secondAddress' => false, 'state' => false, 'cityTxt' => false, 'zipCode' => false, 'country' => false, 'firstTel' => false, 'secondTel' => false, 'fax' => false, 'email' => false, 'webSite' => false)); $adressRetailer->formAddress(); $retailerForm->addElement($isRetailer); $retailerForm->getElement('AI_SecondTel')->setAttrib('class', 'stdTextInput phoneFree'); // Subform for the retailer status on website $retailerFormEn = new Cible_Form_SubForm(); $retailerFormEn->setName('retailerFormEn')->removeDecorator('DtDdWrapper'); $txtEn = new Cible_Form_Element_Html('lblEn', array('value' => $this->getView()->getCibleText('form_address_retailer_en'))); $txtEn->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'formLanguage')))); $adressRetailerEn = new Cible_View_Helper_FormAddress($retailerFormEn); $adressRetailerEn->enableFields(array('name' => false, 'firstAddress' => false, 'secondAddress' => false, 'firstTel' => false, 'secondTel' => false, 'webSite' => false)); $adressRetailerEn->formAddress(); $retailerFormEn->addElement($txtEn); $retailerFormEn->getElement('AI_SecondTel')->setAttrib('class', 'stdTextInput phoneFree'); //*** Add subform to the form ***/ $this->addSubForm($retailerForm, 'retailerForm'); $this->addSubForm($retailerFormEn, 'retailerFormEn'); }
public function getForm() { $elementDecorators = array(array('Label'), array('ViewHelper'), array('Errors')); $form = new Zend_Form(); $form->setAction('/student/profile/feedback/')->setMethod('post'); $improvement = new Zend_Form_Element_Radio('improvement', array('label' => '', 'separator' => '', 'multiOptions' => array('Yes' => 'Yes', 'No' => 'No'))); $improvement->setDecorators($elementDecorators); $level = new Zend_Form_Element_Radio('level', array('label' => '', 'separator' => '', 'multiOptions' => array('Hard' => 'Hard', 'Suitable' => 'Suitable', 'Easy' => 'Easy'))); $level->setAttrib('class', 'radio_new'); $level->setDecorators($elementDecorators); $difficult = new Zend_Form_Element_Text('difficult', array('id' => 'difficult', 'maxLength' => '50')); $difficult->setDecorators($elementDecorators); $difficult->setAttrib('class', 'sub_text_input'); $suggestions = new Zend_Form_Element_Textarea('suggestions', array('label' => '?האם חווית בעיה בתרגול', 'id' => 'suggestions')); $suggestions->setAttrib('class', 'sub_textarea'); $sendFeedback = new Zend_Form_Element_Button('sendfeedback', array('id' => 'sendfeedback', 'label' => 'ds')); $sendFeedback->setAttrib('class', 'sub_button_input'); $sendFeedback->setDecorators($elementDecorators); $form->addElements(array($improvement, $level, $difficult, $suggestions)); return $form; }
public function init() { $this->setMethod('post'); //$this->setAttrib('action',DOMAIN.'language/edit'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'servicedeskrequests'); $id = new Zend_Form_Element_Hidden('id'); $postid = Zend_Controller_Front::getInstance()->getRequest()->getParam('id'); $businessunit_id = new Zend_Form_Element_Select('businessunit_id'); $businessunit_id->setLabel("Business Unit"); $businessunit_id->setAttrib('class', 'selectoption'); if ($postid == '') { $businessunit_id->setAttrib('onchange', 'displayemployees(this)'); $bunitModel = new Default_Model_Businessunits(); $bunitdata = $bunitModel->fetchAll('isactive=1', 'unitname'); $businessunit_id->addMultiOptions(array('' => 'Select Business unit', '0' => 'No Business Unit')); foreach ($bunitdata->toArray() as $data) { $businessunit_id->addMultiOption($data['id'], $data['unitname']); } } else { $businessunit_id->addMultiOptions(array('' => 'Select Business unit')); } $businessunit_id->setRegisterInArrayValidator(false); $businessunit_id->setRequired(true); $businessunit_id->addValidator('NotEmpty', false, array('messages' => 'Please select business unit.')); $department_id = new Zend_Form_Element_Select('department_id'); $department_id->setLabel("Department"); $department_id->setAttrib('class', 'selectoption'); $department_id->addMultiOption('', 'Select Department'); if ($postid == '') { $department_id->setAttrib('onchange', 'displayemployees(this)'); } $department_id->setRegisterInArrayValidator(false); $service_desk_flag = new Zend_Form_Element_Radio('service_desk_flag'); $service_desk_flag->setLabel("Applicability"); $service_desk_flag->setAttrib('onclick', 'changeimplementation(this)'); $service_desk_flag->addMultiOptions(array('1' => 'Business unit wise', '0' => 'Department wise')); $service_desk_flag->setSeparator(''); $service_desk_flag->setValue(1); $service_desk_flag->setRegisterInArrayValidator(false); $service_desk_flag->setRequired(true); $service_desk_flag->addValidator('NotEmpty', false, array('messages' => 'Please select applicability.')); $service_desk_id = new Zend_Form_Element_Select('service_desk_id'); $service_desk_id->setLabel("Category"); $service_desk_id->setAttrib('class', 'selectoption'); $service_desk_id->addMultiOption('', 'Select category'); $service_desk_id->setRegisterInArrayValidator(false); $service_desk_id->setRequired(true); $service_desk_id->addValidator('NotEmpty', false, array('messages' => 'Please select category.')); $request_recievers = new Zend_Form_Element_Multiselect('request_recievers'); $request_recievers->setLabel("Executors"); $request_recievers->setAttrib('class', 'selectoption'); $request_recievers->setRegisterInArrayValidator(false); $request_recievers->setRequired(true); $request_recievers->addValidator('NotEmpty', false, array('messages' => 'Please select executor.')); $approvingauthority = new Zend_Form_Element_Select('approvingauthority'); $approvingauthority->setLabel("No. of Approvers"); $approvingauthority->setAttrib('class', 'selectoption'); $approvingauthority->setAttrib('onchange', 'displayapprovingauthority(this)'); $approvingauthority->addMultiOptions(array('' => 'Select no. of approvers', '1' => '1', '2' => '2', '3' => '3')); $approvingauthority->setRegisterInArrayValidator(false); $approvingauthority->setRequired(true); $approvingauthority->addValidator('NotEmpty', false, array('messages' => 'Please select no. of approvers.')); $approver_1 = new Zend_Form_Element_Select('approver_1'); $approver_1->setLabel("Approver 1"); $approver_1->setAttrib('class', 'selectoption'); $approver_1->addMultiOption('', 'Select Approver 1'); $approver_1->setAttrib('onchange', 'displayapprovingauthority(this)'); $approver_1->setRegisterInArrayValidator(false); $approver_2 = new Zend_Form_Element_Select('approver_2'); $approver_2->setLabel("Approver 2"); $approver_2->setAttrib('class', 'selectoption'); $approver_2->addMultiOption('', 'Select Approver 2'); $approver_2->setAttrib('onchange', 'displayapprovingauthority(this)'); $approver_2->setRegisterInArrayValidator(false); $approver_3 = new Zend_Form_Element_Select('approver_3'); $approver_3->setLabel("Approver 3"); $approver_3->setAttrib('class', 'selectoption'); $approver_3->addMultiOption('', 'Select Approver 3'); $approver_3->setRegisterInArrayValidator(false); $cc_mail_recievers = new Zend_Form_Element_Multiselect('cc_mail_recievers'); $cc_mail_recievers->setLabel("Request Viewers"); $cc_mail_recievers->setAttrib('class', 'selectoption'); $cc_mail_recievers->setRegisterInArrayValidator(false); $attachment = new Zend_Form_Element_Radio('attachment'); $attachment->setLabel("Attachment"); $attachment->addMultiOptions(array('1' => 'Yes', '0' => 'No')); $attachment->setSeparator(''); $attachment->setValue(0); $attachment->setRegisterInArrayValidator(false); $description = new Zend_Form_Element_Textarea('description'); $description->setLabel("Description"); $description->setAttrib('rows', 10); $description->setAttrib('cols', 50); $description->setAttrib('maxlength', '200'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $businessunit_id, $department_id, $description, $service_desk_flag, $service_desk_id, $request_recievers, $approvingauthority, $approver_1, $approver_2, $approver_3, $cc_mail_recievers, $attachment, $submit)); $this->setElementDecorators(array('ViewHelper')); }
public function init() { // public function __construct($app,$value) { // // Zend_Dojo::enableForm($this); // // parent::__construct($app); // // parent::__construct($value); $membertitle = new Zend_Form_Element_Select('membertitle'); $membertitle->setAttrib('class', 'txt_put'); $membertitle->setAttrib('id', 'membertitle'); $membertitle->setAttrib('tabindex', '3'); $membertitle->setAttrib($value, 'true'); $memberfirstname = new Zend_Form_Element_Text('memberfirstname'); $memberfirstname->setAttrib('class', ''); $memberfirstname->setAttrib('size', '10'); $memberfirstname->setAttrib('id', 'memberfirstname'); $memberfirstname1 = new Zend_Form_Element_Text('memberfirstname1'); $memberfirstname1->setAttrib('class', ''); $memberfirstname1->setAttrib('id', 'memberfirstname1'); $memberfirstname1->setAttrib('size', '10'); //$memberfirstname1->setAttrib('style','background-color: #5CB3FF'); $memberaddressline1 = new Zend_Form_Element_Text('memberaddressline1'); $memberaddressline1->setAttrib('class', 'txt_put'); $memberaddressline1->setAttrib('id', 'memberaddressline1'); $memberaddressline1->setAttrib('tabindex', '13'); $memberaddressline1->setAttrib($value, 'true'); // echo $value; $membermiddlename = new Zend_Form_Element_Text('membermiddlename'); $membermiddlename->setAttrib('class', 'txt_put'); $membermiddlename->setAttrib('id', 'membermiddlename'); $membermiddlename->setAttrib('tabindex', '5'); $membermiddlename->setAttrib($value, 'true'); $memberaddressline2 = new Zend_Form_Element_Text('memberaddressline2'); $memberaddressline2->setAttrib('class', 'txt_put'); $memberaddressline2->setAttrib('id', 'memberaddressline2'); $memberaddressline2->setAttrib('tabindex', '14'); $memberaddressline2->setAttrib($value, 'true'); $memberlastname = new Zend_Form_Element_Text('memberlastname'); $memberlastname->setAttrib('class', 'txt_put'); $memberlastname->setAttrib('id', 'closedate'); $memberlastname->setAttrib('tabindex', '6'); $memberlastname->setAttrib($value, 'true'); $MFI_member = new Zend_Form_Element_Select('MFI_member'); // $MFI_member->addMultiOption('','Select'); $MFI_member->setAttrib('class', 'txt_put'); $MFI_member->setAttrib('id', 'MFI_member'); $memberaddressline3 = new Zend_Form_Element_Text('memberaddressline3'); $memberaddressline3->setAttrib('class', 'txt_put'); $memberaddressline3->setAttrib('id', 'memberaddressline3'); $memberaddressline3->setAttrib('tabindex', '15'); $memberaddressline3->setAttrib($value, 'true'); $memberpersonalid = new Zend_Form_Element_Text('memberpersonalid '); $memberpersonalid->setAttrib('class', 'txt_put'); $memberpersonalid->setAttrib('id', 'memberpersonalid'); $memberpersonalid->setAttrib('tabindex', '7'); $memberpersonalid->setAttrib($value, 'true'); $memberdateofbirth = new Zend_Form_Element_Text('memberdateofbirth '); $memberdateofbirth->setAttrib('tabindex', '8'); $memberdateofbirth->setAttrib('class', 'txt_put'); $memberdateofbirth->setAttrib('size', '10'); $memberdateofbirth->setAttrib('id', 'memberdateofbirth'); $memberdateofbirth->setAttrib($value, 'true'); $memberdateofbirth->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date'))); $membercity = new Zend_Form_Element_Text('membercity'); $membercity->setAttrib('class', 'txt_put'); $membercity->setAttrib('id', 'membercity'); $membercity->setAttrib('tabindex', '16'); $membercity->setAttrib($value, 'true'); $gender_id = new Zend_Form_Element_Select('gender_id'); $gender_id->addMultiOption('', 'Select'); $gender_id->setAttrib('class', 'txt_put'); $gender_id->setAttrib('id', 'gender_id'); $gender_id->setAttrib('tabindex', '9'); $gender_id->setAttrib($value, 'true'); $memberstate = new Zend_Form_Element_Text('memberstate'); $memberstate->setAttrib('class', 'txt_put'); $memberstate->setAttrib('id', 'memberstate'); $memberstate->setAttrib('tabindex', '17'); $memberstate->setAttrib($value, 'true'); $membercountry = new Zend_Form_Element_Text('membercountry'); $membercountry->setAttrib('class', 'txt_put'); $membercountry->setAttrib('id', 'membercountry'); $membercountry->setAttrib('tabindex', '18'); $membercountry->setAttrib($value, 'true'); $memberpincode = new Zend_Form_Element_Text('memberpincode'); $memberpincode->setAttrib('class', 'txt_put'); $memberpincode->setAttrib('id', 'memberpincode'); $memberpincode->setAttrib('tabindex', '19'); $memberpincode->setAttrib($value, 'true'); $memberphone = new Zend_Form_Element_Text('memberphone'); $memberphone->setAttrib('class', 'txt_put'); $memberphone->setAttrib('id', 'memberphone'); $memberphone->setAttrib('tabindex', '20'); $memberphone->setAttrib($value, 'true'); $memberchildrennumber = new Zend_Form_Element_Text('memberchildrennumber'); $memberchildrennumber->setAttrib('class', 'txt_put'); $memberchildrennumber->setAttrib('id', 'memberchildrennumber'); $memberprofession = new Zend_Form_Element_Text('memberprofession'); $memberprofession->setAttrib('class', 'txt_put'); $memberprofession->setAttrib('id', 'memberprofession'); $membereducation = new Zend_Form_Element_Text('membereducation'); $membereducation->setAttrib('class', 'txt_put'); $membereducation->setAttrib('id', 'membereducation'); // $photo = new Zend_Form_Element_File('photo'); // $photo->setAttrib('size', '11'); // $photo->setLabel('Upload an image:'); // $photo->setAttrib('tabindex', '12'); $membereconomicalstatusdescription = new Zend_Form_Element_Select('membereconomicalstatusdescription'); $membereconomicalstatusdescription->addMultiOption('', 'Select'); $membereconomicalstatusdescription->setAttrib('class', 'txt_put'); $membereconomicalstatusdescription->setAttrib('id', 'membereconomicalstatusdescription'); $relationship = new Zend_Form_Element_Select('relationship'); $relationship->setAttrib('class', 'txt_put'); $relationship->setAttrib('id', 'relationship'); $physicalstatus_id = new Zend_Form_Element_Select('physicalstatus_id'); $physicalstatus_id->addMultiOption('', 'Select'); $physicalstatus_id->setAttrib('class', 'txt_put'); $physicalstatus_id->setAttrib('id', 'physicalstatus_id'); $physicalstatus_id->setAttrib('tabindex', '11'); $physicalstatus_id->setAttrib($value, 'true'); $membermaritalstatus_id = new Zend_Form_Element_Select('membermaritalstatus_id'); $membermaritalstatus_id->addMultiOption('', 'Select'); $membermaritalstatus_id->setAttrib('class', 'txt_put'); $membermaritalstatus_id->setAttrib('id', 'membermaritalstatus_id'); $membermaritalstatus_id->setAttrib('tabindex', '10'); $membermaritalstatus_id->setAttrib($value, 'true'); $memberStatus = new Zend_Form_Element_Radio('memberstatus_id'); //$memberStatus->setAttrib('checked', 'true'); $memberStatus->setAttrib('id', 'memberstatus_id'); $memberId = new Zend_Form_Element_Text('member_id'); $memberId->setAttrib('class', 'txt_put'); $memberId->setAttrib('readonly', 'true'); $memberId->setAttrib('size', '10'); $memberhouse = new Zend_Form_Element_Checkbox('memberhouse'); $memberhouse->setAttrib('id', 'memberhouse '); $memberhouse->setAttrib('class', 'txt_put'); $memberhouse->setAttrib('onchange', 'toggleStatus()'); $memberhouse->setAttrib($value, 'true'); $memberhouse = new Zend_Form_Element_Checkbox('memberhouse'); $memberhouse->setAttrib('class', 'txt_put'); $memberhouse->setAttrib('id', 'memberhouse'); $memberhouse->setAttrib('onchange', 'togglehouse();'); $memberland = new Zend_Form_Element_Checkbox('memberland'); $memberland->setAttrib('class', 'txt_put'); $memberland->setAttrib('id', 'memberland'); $memberland->setAttrib('onchange', 'toggleland();'); $memberland->setAttrib($value, 'true'); $homeSize = new Zend_Form_Element_Text('memberhomesize'); $homeSize->setAttrib('class', 'txt_put'); $homeSize->setAttrib('id', 'memberhomesize'); $homeSize->setAttrib('size', '8'); $homeSize->setAttrib($value, 'true'); $landSize = new Zend_Form_Element_Text('memberlandsize'); $landSize->setAttrib('class', 'txt_put'); $landSize->setAttrib('id', 'memberlandsize'); $landSize->setAttrib('size', '8'); $landSize->setAttrib($value, 'true'); $numlandSize = new Zend_Form_Element_Text('numlandSize'); $numlandSize->setAttrib('class', 'txt_put'); $numlandSize->setAttrib('id', 'numlandSize'); $numlandSize->setAttrib('size', '8'); $numlandSize->setAttrib($value, 'true'); $otherlivingassets = new Zend_Form_Element_Select('otherlivingassets'); $otherlivingassets->setAttrib('class', 'txt_put'); $otherlivingassets->setAttrib('id', 'otherlivingassets'); $otherlivingassets->addMultiOption('', 'Select'); $otherlivingassets->setAttrib('onchange', 'livingassets();'); $otherlivingassets->setAttrib($value, 'true'); $othernonlivingassets = new Zend_Form_Element_Select('othernonlivingassets'); $othernonlivingassets->setAttrib('class', 'txt_put'); $othernonlivingassets->setAttrib('id', 'othernonlivingassets'); $othernonlivingassets->addMultiOption('', 'Select'); $othernonlivingassets->setAttrib('onchange', 'nonlivingassets();'); $othernonlivingassets->setAttrib($value, 'true'); $numotherassets = new Zend_Form_Element_Text('numotherassets'); $numotherassets->setAttrib('class', 'txt_put'); $numotherassets->setAttrib('id', 'numotherassets'); $numotherassets->setAttrib('size', '8'); $numotherassets->setAttrib($value, 'true'); $OFFICE_TYPE = new Zend_Form_Element_Select('officeType'); $OFFICE_TYPE->addMultiOption('', 'Select'); $OFFICE_TYPE->setAttrib('class', 'txt_put'); $OFFICE_TYPE->setAttrib('tabindex', '1'); $OFFICE_TYPE->setAttrib($value, 'true'); $SUB_OFFICE = new Zend_Form_Element_Select('subOffice'); $SUB_OFFICE->setAttrib('class', 'txt_put'); $SUB_OFFICE->setAttrib('tabindex', '2'); $SUB_OFFICE->setAttrib($value, 'true'); $transporation_for_schoolstatus = new Zend_Form_Element_Select('transporation_for_schoolstatus'); $transporation_for_schoolstatus->addMultiOption('', 'Select'); $transporation_for_schoolstatus->setAttrib('class', 'txt_put'); $transporation_for_schoolstatus->setAttrib('id', 'transporation_for_schoolstatus'); $transporation_for_schoolstatus = new Zend_Form_Element_Select('transporation_for_schoolstatus'); $transporation_for_schoolstatus->addMultiOption('', 'Select'); $transporation_for_schoolstatus->setAttrib('class', 'txt_put'); $transporation_for_schoolstatus->setAttrib('id', 'transporation_for_schoolstatus'); $school_locationstatus = new Zend_Form_Element_Select('school_locationstatus'); $school_locationstatus->addMultiOption('', 'Select...'); $school_locationstatus->setAttrib('class', 'txt_put'); $school_locationstatus->setAttrib('id', 'school_locationstatus'); $qualificationdetails = new Zend_Form_Element_Select('qualificationdetails'); $qualificationdetails->addMultiOption('', 'Select...'); $qualificationdetails->setAttrib('class', 'txt_put'); $qualificationdetails->setAttrib('id', 'qualificationdetails'); $profession = new Zend_Form_Element_Select('profession'); $profession->addMultiOption('', 'Select'); $profession->setAttrib('class', 'txt_put'); $profession->setAttrib('id', 'profession'); $health_problem = new Zend_Form_Element_Select('health_problem'); $health_problem->addMultiOption('', 'Select'); $health_problem->setAttrib('class', 'txt_put'); $health_problem->setAttrib('id', 'health_problem'); $earningsstatus = new Zend_Form_Element_Select('earningsstatus'); $earningsstatus->addMultiOption('', 'Select'); $earningsstatus->setAttrib('class', 'txt_put'); $earningsstatus->setAttrib('id', 'earningsstatus'); $submit = new Zend_Form_Element_Submit('Save'); $submit->setAttrib('id', 'save'); $this->addElements(array($OFFICE_TYPE, $SUB_OFFICE, $memberfirstname, $memberfirstname1, $membertitle, $memberaddressline1, $membermiddlename, $memberaddressline2, $memberlastname, $gender_id, $memberaddressline3, $memberpersonalid, $membercity, $memberdateofbirth, $memberstate, $membercountry, $MFI_member, $membermaritalstatus_id, $membereconomicalstatusdescription, $memberpincode, $memberchildrennumber, $memberphone, $memberhouse, $memberland, $otherlivingassets, $othernonlivingassets, $physicalstatus_id, $relationship, $memberStatus, $homeSize, $landSize, $memberId, $transporation_for_schoolstatus, $school_locationstatus, $qualificationdetails, $profession, $health_problem, $earningsstatus, $numlandSize, $numotherassets)); $memberId = new Zend_Form_Element_Hidden('memberId'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setAttrib('class', 'officesubmit'); $this->addElements(array($submit, $memberId)); }
public function init() { $this->setMethod('post'); //$this->setAttrib('action',DOMAIN.'language/edit'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'appraisalconfig'); $id = new Zend_Form_Element_Hidden('id'); $postid = Zend_Controller_Front::getInstance()->getRequest()->getParam('id'); $businessunit_id = new Zend_Form_Element_Select('businessunit_id'); $businessunit_id->setLabel("Business Unit"); $businessunit_id->setAttrib('class', 'selectoption'); if ($postid == '') { $businessunit_id->setAttrib('onchange', 'displayDept(this)'); $bunitdata = $this->bunitdata; if (!empty($bunitdata)) { $businessunit_id->addMultiOptions(array('' => 'Select Business unit', '0' => 'No Business Unit')); foreach ($bunitdata as $data) { $businessunit_id->addMultiOption($data['id'], $data['unitname']); } } else { $businessunit_id->addMultiOptions(array('' => 'Select Business unit')); } } else { $businessunit_id->addMultiOptions(array('' => 'Select Business unit')); } $businessunit_id->setRegisterInArrayValidator(false); $businessunit_id->setRequired(true); $businessunit_id->addValidator('NotEmpty', false, array('messages' => 'Please select business unit.')); $department_id = new Zend_Form_Element_Select('department_id'); $department_id->setLabel("Department"); $department_id->setAttrib('class', 'selectoption'); $department_id->addMultiOption('', 'Select Department'); if ($postid == '') { $department_id->setAttrib('onchange', 'displayDept(this)'); } $department_id->setRegisterInArrayValidator(false); $performance_app_flag = new Zend_Form_Element_Radio('performance_app_flag'); $performance_app_flag->setLabel("Applicability"); $performance_app_flag->setAttrib('onclick', 'checkimplementfun(this)'); $performance_app_flag->addMultiOptions(array('1' => 'Business unit wise', '0' => 'Department wise')); $performance_app_flag->setSeparator(''); $performance_app_flag->setValue(1); $performance_app_flag->setRegisterInArrayValidator(false); $performance_app_flag->setRequired(true); $performance_app_flag->addValidator('NotEmpty', false, array('messages' => 'Please select applicability.')); $appraisal_mode = new Zend_Form_Element_Select('appraisal_mode'); $appraisal_mode->setLabel("Appraisal Mode"); $appraisal_mode->setAttrib('class', 'selectoption'); $appraisal_mode->addMultiOptions(array('' => 'Select appraisal mode', 'Quarterly' => 'Quarterly', 'Half-yearly' => 'Half-yearly', 'Yearly' => 'Yearly')); $appraisal_mode->setRegisterInArrayValidator(false); $appraisal_mode->setRequired(true); $appraisal_mode->addValidator('NotEmpty', false, array('messages' => 'Please select appraisal mode.')); $appraisal_ratings = new Zend_Form_Element_Select('appraisal_ratings'); $appraisal_ratings->setLabel("Appraisal Ratings"); $appraisal_ratings->setAttrib('class', 'selectoption'); $appraisal_ratings->addMultiOptions(array('' => 'Select ratings', '1' => '1-5', '2' => '1-10')); $appraisal_ratings->setRegisterInArrayValidator(false); $appraisal_ratings->setRequired(true); $appraisal_ratings->addValidator('NotEmpty', false, array('messages' => 'Please select appraisal ratings.')); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $businessunit_id, $performance_app_flag, $department_id, $appraisal_mode, $appraisal_ratings, $submit)); $this->setElementDecorators(array('ViewHelper')); }
public function getForm($data, $protection = 0) { $elementDecorators = array(array('Label'), array('ViewHelper'), array('Errors')); $form = new Zend_Form(); $form->setAction('/user/registration/first-form/')->setMethod('post'); //firstname field $firstName = new Zend_Form_Element_Text('firstname', array('maxLength' => '30', 'id' => 'name', 'validators' => array(array('stringLength', false, array(3, 100)), array('Alpha')))); if (isset($data['u_name'])) { $firstName->setValue($data['u_name']); } if ($protection) { $firstName->setAttrib('readonly', 'true'); } $firstName->setDecorators($elementDecorators); //lastname field $lastName = new Zend_Form_Element_Text('lastname', array('maxLength' => '30', 'id' => 'lname', 'validators' => array(array('stringLength', false, array(3, 100)), array('Alpha')))); $lastName->setDecorators($elementDecorators); if (isset($data['u_family_name'])) { $lastName->setValue($data['u_family_name']); } if ($protection) { $lastName->setAttrib('readonly', 'true'); } //selecting gender: Male (1) or Female (0) $gender = new Zend_Form_Element_Radio('sex', array('separator' => '', 'multiOptions' => array('1' => 'זכר ', '0' => 'נקבה'))); $gender->setDecorators($elementDecorators); $gender->setValue($data['u_sex_id']); if (isset($data['u_sex_id'])) { $gender->setValue($data['u_sex_id']); } if ($protection) { $gender->setAttrib('readonly', 'true'); } //birthday field: validation for yyyy-mm-dd input $birthday = new Zend_Form_Element_Text('datepicker', array('size' => 10)); $birthday->setDecorators($elementDecorators); if (isset($data['u_date_of_birth'])) { $birthday->setValue(date("d/m/Y", strtotime($data['u_date_of_birth']))); } if ($protection) { $birthday->setAttrib('readonly', 'true'); } //heigth $heigth = new Zend_Form_Element_Select('heigth', array()); for ($i = 120; $i <= 300; $i++) { $heigth->addMultiOption($i, $i); } $heigth->setDecorators($elementDecorators); if (isset($data['uht_height'])) { $heigth->setValue($data['uht_height']); } if ($protection) { $heigth->setAttrib('disabled', 'true'); } //weight $weight = new Zend_Form_Element_Select('weight', array('label' => '')); for ($i = 20; $i <= 300; $i++) { $weight->addMultiOption($i, $i); } $weight->setDecorators($elementDecorators); if (isset($data['uht_weight'])) { $weight->setValue($data['uht_weight']); } //email field with validation $email = new Zend_Form_Element_Text('email', array()); $email->addValidator(new Zend_Validate_EmailAddress()); $email->setDecorators($elementDecorators); if (isset($data['u_email'])) { $email->setValue($data['u_email']); } if ($protection) { $email->setAttrib('readonly', 'true'); } // password field $password1 = new Zend_Form_Element_Password('password1', array('id' => 'pass')); $password1->setDecorators($elementDecorators); // password confirmation field $password2 = new Zend_Form_Element_Password('password2', array('id' => 'c_pass')); $password2->addValidator(new User_Form_UserFirstFormPasswordValidator('password1')); $password2->setDecorators($elementDecorators); $state = new Zend_Form_Element_Select('state', array('requred' => true)); $state->setMultiOptions(array('1' => 'מדינה:')); $state->setDecorators($elementDecorators); if (isset($data['u_state'])) { $state->setValue($data['u_state']); } $address = new Zend_Form_Element_Text('address', array('required' => false, 'id' => 'full_adr')); $address->setDecorators($elementDecorators); if (isset($data['u_address'])) { $address->setValue($data['u_address']); } $pregnant = new Zend_Form_Element_Radio('pregnant', array('separator' => '', 'multioptions' => array('Yes' => 'לא', 'No' => 'כן'))); $pregnant->setDecorators($elementDecorators); if ($data['uht_pregnant']) { $pregnant->setValue($data['uht_pregnant']); } $pregnantSince = new Zend_Form_Element_Select('pregnantsince', array('id' => 'hz1')); $pregnantSince->setMultiOptions(array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9')); $pregnantSince->setDecorators($elementDecorators); if ($data['uht_pregnant']) { $pregnant->setValue($data['uht_pregnant']); } if ($data['uht_pregnant_since']) { $pregnantSince->setValue($data['uht_pregnant_since']); } $objectives = new Zend_Form_Element_Textarea('objectives', array('id' => 'obj', 'rows' => '20', 'cols' => '20')); if ($data['u_objectives']) { $objectives->setValue($data['u_objectives']); } $terms = new Zend_Form_Element_Checkbox('terms', array('required' => 'true,')); $heartPressure = new Zend_Form_Element_Checkbox('heartpressure', array()); $heartPressure->setDecorators($elementDecorators); if ($data['uht_heart_or_pb']) { $heartPressure->setChecked(true); } $diabetes = new Zend_Form_Element_Checkbox('diabetes', array()); $diabetes->setDecorators($elementDecorators); if ($data['uht_diabetes']) { $diabetes->setChecked(true); } $migrene = new Zend_Form_Element_Checkbox('migrene', array()); $migrene->setDecorators($elementDecorators); if ($data['uht_migrene']) { $migrene->setChecked(true); } $babies = new Zend_Form_Element_Checkbox('babies', array()); $babies->setDecorators($elementDecorators); if ($data['uht_babies']) { $babies->setChecked(true); } $nosleep = new Zend_Form_Element_Checkbox('nosleep', array()); $nosleep->setDecorators($elementDecorators); if ($data['uht_nosleep']) { $nosleep->setChecked(true); } $digestion = new Zend_Form_Element_Checkbox('digestion', array()); $digestion->setDecorators($elementDecorators); if ($data['uht_digestion']) { $digestion->setChecked(true); } $menopause = new Zend_Form_Element_Checkbox('menopause', array()); $menopause->setDecorators($elementDecorators); if ($data['uht_menopause']) { $menopause->setChecked(true); } $sclorosies = new Zend_Form_Element_Checkbox('sclorosies', array()); $sclorosies->setDecorators($elementDecorators); if ($data['uht_sclorosies']) { $sclorosies->setChecked(true); } $epilepsy = new Zend_Form_Element_Checkbox('epilepsy', array()); $epilepsy->setDecorators($elementDecorators); if ($data['uht_epilepsy']) { $epilepsy->setChecked(true); } $cancer = new Zend_Form_Element_Checkbox('cancer', array()); $cancer->setDecorators($elementDecorators); if ($data['uht_cancer']) { $cancer->setChecked(true); } $asthma = new Zend_Form_Element_Checkbox('asthma', array()); $asthma->setDecorators($elementDecorators); if ($data['uht_asthma']) { $asthma->setChecked(true); } $artritis = new Zend_Form_Element_Checkbox('artritis', array()); $artritis->setDecorators($elementDecorators); if ($data['uht_Artritis']) { $artritis->setChecked(true); } $hernia = new Zend_Form_Element_Checkbox('hernia', array()); $hernia->setDecorators($elementDecorators); if ($data['uht_hernia']) { $hernia->setChecked(true); } $depression = new Zend_Form_Element_Checkbox('depression', array()); $depression->setDecorators($elementDecorators); if ($data['uht_depression_or_anxiety']) { $depression->setChecked(true); } $headaches = new Zend_Form_Element_Checkbox('headaches', array()); $headaches->setDecorators($elementDecorators); if ($data['uht_headaches']) { $headaches->setChecked(true); } $fatigue = new Zend_Form_Element_Checkbox('fatigue', array()); $fatigue->setDecorators($elementDecorators); if ($data['uht_fatigue']) { $fatigue->setChecked(true); } $injury = new Zend_Form_Element_Checkbox('injury', array()); $injury->setDecorators($elementDecorators); if ($data['uht_injury']) { $injury->setChecked(true); } $injuryText = new Zend_Form_Element_Textarea('injurytext', array('id' => 'obj', 'rows' => '20', 'cols' => '20')); if ($data['uht_injury_text']) { $injuryText->setValue($data['uht_injury_text']); } $medication = new Zend_Form_Element_Checkbox('medication', array()); $medication->setDecorators($elementDecorators); if ($data['uht_medication']) { $medication->setChecked(true); } $medicationText = new Zend_Form_Element_Textarea('medicationtext', array('id' => 'obj', 'rows' => '20', 'cols' => '20')); if ($data['uht_which_medication']) { $medicationText->setValue($data['uht_which_medication']); } $walk = new Zend_Form_Element_Radio('walk', array('label' => '', 'separator' => '', 'multiOptions' => array('Yes' => 'כן', 'No' => 'לא'))); if ($data['uht_walk']) { $walk->setValue($data['uht_walk']); } $walk->setDecorators($elementDecorators); $hands = new Zend_Form_Element_Radio('hands', array('label' => '', 'separator' => '', 'multiOptions' => array('Yes' => 'כן', 'No' => 'לא'))); if ($data['uht_hands']) { $hands->setValue($data['uht_hands']); } $hands->setDecorators($elementDecorators); $legs = new Zend_Form_Element_Radio('legs', array('label' => '', 'separator' => '', 'multiOptions' => array('Yes' => 'כן', 'No' => 'לא'))); if ($data['uht_sit']) { $legs->setValue($data['uht_sit']); } $legs->setDecorators($elementDecorators); $backashes = new Zend_Form_Element_Radio('backashes', array('label' => '', 'separator' => '', 'multiOptions' => array('Yes' => 'כן', 'No' => 'לא'))); if ($data['uht_backashes']) { $backashes->setValue($data['uht_backashes']); } $backashes->setDecorators($elementDecorators); if ($protection) { $backashes->setAttrib('disabled', 'true'); } $slippedDisk = new Zend_Form_Element_Radio('disc', array('label' => '', 'separator' => '', 'multiOptions' => array('Yes' => 'כן', 'No' => 'לא'))); if ($protection) { $slippedDisk->setAttrib('disabled', 'true'); } if ($data['uht_slipped_disk']) { $slippedDisk->setValue($data['uht_slipped_disk']); } $slippedDisk->setDecorators($elementDecorators); $generalQuestionsText1 = new Zend_Form_Element_Text('general1', array('id' => 'f_1')); $generalQuestionsText2 = new Zend_Form_Element_Text('general2', array('id' => 'f_2')); $generalQuestionsText3 = new Zend_Form_Element_Text('general3', array('id' => 'f_3')); $generalQuestionsText1->setDecorators($elementDecorators); if ($protection) { $generalQuestionsText1->setAttrib('readonly', 'true'); $generalQuestionsText2->setAttrib('readonly', 'true'); $generalQuestionsText3->setAttrib('readonly', 'true'); } $generalQuestionsText2->setDecorators($elementDecorators); $generalQuestionsText3->setDecorators($elementDecorators); if (isset($data['uht_general1'])) { $generalQuestionsText1->setValue($data['uht_general1']); } if (isset($data['uht_general2'])) { $generalQuestionsText2->setValue($data['uht_general2']); } if (isset($data['uht_general3'])) { $generalQuestionsText3->setValue($data['uht_general3']); } $lowerback = new Zend_Form_Element_Checkbox('lowerback', array()); $lowerback->setDecorators($elementDecorators); if ($data['uht_lower_back']) { $lowerback->setChecked(true); } $upperback = new Zend_Form_Element_Checkbox('upperback', array()); $upperback->setDecorators($elementDecorators); if ($data['uht_upper_back']) { $upperback->setChecked(true); } $feet = new Zend_Form_Element_Checkbox('feet', array()); $feet->setDecorators($elementDecorators); if ($data['uht_ankles_and_feet']) { $feet->setChecked(true); } $neck = new Zend_Form_Element_Checkbox('neck', array()); $neck->setDecorators($elementDecorators); if ($data['uht_neck_and_shoulders']) { $neck->setChecked(true); } $breath = new Zend_Form_Element_Checkbox('breath', array()); $breath->setDecorators($elementDecorators); if ($data['uht_breath']) { $breath->setChecked(true); } $pelvis = new Zend_Form_Element_Checkbox('pelvis', array()); $pelvis->setDecorators($elementDecorators); if ($data['uht_thighs_or_pelvis']) { $pelvis->setChecked(true); } $knees = new Zend_Form_Element_Checkbox('knees', array()); $knees->setDecorators($elementDecorators); if ($data['uht_thighs_or_pelvis']) { $knees->setChecked(true); } $wrists = new Zend_Form_Element_Checkbox('wrists', array()); $wrists->setDecorators($elementDecorators); if ($data['uht_wrists']) { $wrists->setChecked(true); } $head = new Zend_Form_Element_Checkbox('head', array()); $head->setDecorators($elementDecorators); if ($data['uht_head']) { $head->setChecked(true); } $ankles = new Zend_Form_Element_Checkbox('ankles', array()); $ankles->setDecorators($elementDecorators); if ($data['uht_ankles']) { $ankles->setChecked(true); } $externalMails = new Zend_Form_Element_Checkbox('external', array()); $externalMails->setDecorators($elementDecorators); if ($data['u_external_emails']) { $externalMails->setChecked(true); } $moreInfo = new Zend_Form_Element_Textarea('moreinfo', array('id' => 'obj', 'rows' => '20', 'cols' => '20')); if ($data['uht_more_info']) { $moreInfo->setValue($data['uht_more_info']); } $form->addElements(array($firstName, $lastName, $gender, $birthday, $heigth, $weight, $email, $password1, $password2, $state, $address, $pregnant, $pregnantSince, $objectives, $terms, $heartPressure, $diabetes, $migrene, $babies, $nosleep, $digestion, $menopause, $sclorosies, $epilepsy, $cancer, $asthma, $artritis, $hernia, $depression, $fatigue, $headaches, $injury, $injuryText, $medication, $medicationText, $walk, $hands, $legs, $backashes, $slippedDisk, $generalQuestionsText1, $generalQuestionsText2, $generalQuestionsText3, $lowerback, $upperback, $feet, $neck, $breath, $pelvis, $knees, $wrists, $head, $ankles, $moreInfo, $externalMails)); return $form; }
public function init() { /* Form Elements & Other Definitions Here ... */ $this->setMethod("POST"); $id = new Zend_Form_Element_Hidden("id"); //add firstname $f_name = new Zend_Form_Element_Text("f_name"); $f_name->setRequired(); $f_name->setLabel("First Name:"); $f_name->setAttrib("placeholder", "Enter Your first Name"); $f_name->addValidator(new Zend_Validate_Alnum("true")); $f_name->setAttrib("class", "form-control"); $f_name->getDecorator("Label")->setOption("class", "control-label"); $f_name->getDecorator("Errors")->setOption("class", "alert alert-danger"); $f_name->getDecorator("Errors")->setOption("style", " list-style-type:none"); //add lastname $l_name = new Zend_Form_Element_Text("l_name"); $l_name->setRequired(); $l_name->setLabel("Last Name:"); $l_name->setAttrib("placeholder", "Enter Your last Name"); $l_name->addValidator(new Zend_Validate_Alnum("true")); $l_name->setAttrib("class", "form-control"); $l_name->getDecorator("Label")->setOption("class", "control-label"); $l_name->getDecorator("Errors")->setOption("class", "alert alert-danger"); $l_name->getDecorator("Errors")->setOption("style", " list-style-type:none"); //add mail $username = new Zend_Form_Element_Text("username"); $username->setRequired(); $username->setLabel("Username:"******"placeholder", "Enter Your E-Mail"); $username->addValidator(new Zend_Validate_EmailAddress()); $username->setAttrib("class", "form-control"); $username->getDecorator("Label")->setOption("class", "control-label"); $username->getDecorator("Errors")->setOption("class", "alert alert-danger"); $username->getDecorator("Errors")->setOption("style", " list-style-type:none"); //add address $address = new Zend_Form_Element_Text("address"); $address->setLabel("Adress:"); $address->setAttrib("placeholder", "Enter Your adress"); $address->addValidator(new Zend_Validate_Alnum("true")); $address->setAttrib("class", "form-control"); $address->getDecorator("Label")->setOption("class", "control-label"); $address->getDecorator("Errors")->setOption("class", "alert alert-danger"); $address->getDecorator("Errors")->setOption("style", " list-style-type:none"); //add mobile $mobile = new Zend_Form_Element_Text("mobile"); $mobile->setLabel("Mobile:"); $mobile->setAttrib("placeholder", "Enter Your mobile"); $mobile->addValidator(new Zend_Validate_Alnum("true")); $mobile->setAttrib("class", "form-control"); $mobile->getDecorator("Label")->setOption("class", "control-label"); $mobile->getDecorator("Errors")->setOption("class", "alert alert-danger"); $mobile->getDecorator("Errors")->setOption("style", " list-style-type:none"); //add phone $phone = new Zend_Form_Element_Text("phone"); $phone->setLabel("Phone:"); $phone->setAttrib("placeholder", "Enter Your phone"); $phone->addValidator(new Zend_Validate_Alnum("true")); $phone->setAttrib("class", "form-control"); $phone->getDecorator("Label")->setOption("class", "control-label"); $phone->getDecorator("Errors")->setOption("class", "alert alert-danger"); $phone->getDecorator("Errors")->setOption("style", " list-style-type:none"); //add checkbox $status = new Zend_Form_Element_Radio("active"); $status->addMultiOptions(array('1' => 'Active', '0' => 'Notactive')); $status->setLabel('What is your status ?'); $status->setAttrib("class", "form-control"); $status->getDecorator("Label")->setOption("class", "control-label"); $status->setRequired(); $user_type = new Zend_Form_Element_Radio("user_type"); $user_type->addMultiOptions(array('admin' => 'Admin', 'normal' => 'Normal')); $user_type->setLabel('User Type'); $user_type->setAttrib("class", "form-control"); $user_type->getDecorator("Label")->setOption("class", "control-label"); $user_type->setRequired(); $password = new Zend_Form_Element_Password("password"); $password->setRequired(); $password->setLabel("Password:"******"placeholder", "Enter Your Password"); $password->setAttrib("class", "form-control"); $password->getDecorator("Label")->setOption("class", "control-label"); $password->getDecorator("Errors")->setOption("class", "alert alert-danger"); $password->getDecorator("Errors")->setOption("style", " list-style-type:none"); $re_password = new Zend_Form_Element_Password("re_password"); $re_password->setRequired(); $re_password->setLabel("Retype Your Password:"******"placeholder", "Re-enter Your Password"); $re_password->setAttrib("class", "form-control"); $re_password->getDecorator("Label")->setOption("class", "control-label"); $re_password->getDecorator("Errors")->setOption("class", "alert alert-danger"); $re_password->getDecorator("Errors")->setOption("style", " list-style-type:none"); $submit = new Zend_Form_Element_Submit("submit"); $submit->setAttrib("class", "btn btn-xl center-block"); $this->addElements(array($id, $f_name, $l_name, $username, $address, $password, $re_password, $mobile, $phone, $status, $user_type, $submit)); // Add a captcha /*$this->addElement('captcha', 'captcha', array( 'label' => 'Please enter the 5 letters displayed below:', 'required' => true, 'captcha' => array( 'captcha' => 'Figlet', 'wordLen' => 5, 'timeout' => 300 ) ));*/ }