public function FrmMenu($data = null) { $combo_code = new Zend_Form_Element_Text('combo_code'); $combo_code->setAttribs(array('class' => 'form-control', 'onkeyup' => 'displayPhoto()')); $description = new Zend_Form_Element_Text('description'); $description->setAttribs(array('class' => 'form-control', 'onchange' => 'displayPhoto()')); $lang_1 = new Zend_Form_Element_Text('lang_1'); $lang_1->setAttribs(array('class' => 'form-control', 'onchange' => 'displayPhoto()')); $lang_2 = new Zend_Form_Element_Text('lang_2'); $lang_2->setAttribs(array('checked' => 'checked', 'class' => 'form-control', 'onchange' => 'displayPhoto()')); $lang_3 = new Zend_Form_Element_Text('lang_3'); $lang_3->setAttribs(array('checked' => 'checked', 'class' => 'form-control')); if ($data != null) { } $db = new Application_Model_DbTable_DbGlobal(); $show_description = new Zend_Form_Element_Select('show_description'); $show_description->setAttribs(array('class' => 'form-control', 'required' => 'true', 'onchange' => 'displayPhoto()')); $opt = $db->getVewOptoinTypeByType(1, 1, null, 1); $show_description->setMultiOptions($opt); //$photo = new Zend_Form_Element_File('photo'); $background = new Zend_Form_Element_select('background'); $background->setAttribs(array('class' => 'form-control color-picker-rgba')); $otp = array('0' => 'apply to company', '1' => 'A', '2' => 'B', '3' => 'C'); $background->setMultiOptions($otp); $font_color = new Zend_Form_Element_Text('font_color'); $font_color->setAttribs(array('class' => 'form-control', 'id' => "selected-color1")); $font_size = new Zend_Form_Element_Text('demo3'); $font_size->setAttribs(array('class' => 'form-control', 'id' => "demo3", 'value' => 12, 'placeholder' => '12')); $apply_to_company = new Zend_Form_Element_Select('apply_to_company'); $apply_to_company->setAttribs(array('class' => 'form-control')); $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY")); $apply_to_company->setMultiOptions($apply_opt); $combo_item = new Zend_Form_Element_Checkbox('combo_item'); $combo_item->setAttribs(array('class' => 'red')); $active = new Zend_Form_Element_Checkbox('active'); $active->setAttribs(array('class' => 'red', 'checked' => 'checked')); $user_activate = new Zend_Form_Element_Checkbox('user_activate'); $user_activate->setAttribs(array('class' => 'red', 'onclick' => 'setDefaulTime()')); $note = new Zend_Form_Element_Textarea('note'); $note->setAttribs(array('class' => 'form-control', 'id' => "demo4", 'value' => 12, 'placeholder' => '12')); $setting = new Zend_Form_Element_Select('setting'); $setting->setAttribs(array('class' => 'form-control')); $setting_opt = array("" => $this->tr->translate("SELECT_SETTING")); $setting->setMultiOptions($setting_opt); $arrange = new Zend_Form_Element_Text('arrange'); $arrange->setAttribs(array('class' => 'form-control')); $resize = new Zend_Form_Element_Text('resize'); $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12')); $backgroun_color = new Zend_Form_Element_Text('backgroun_color'); $backgroun_color->setAttribs(array('class' => 'colorpicker-rgba form-control', 'onclick' => 'displayPhoto()')); $font_site = new Zend_Form_Element_text('font_size'); $font_site->setAttribs(array('class' => ' spinner-input form-control', 'onkeyup' => 'displayPhoto()', 'onclick' => 'displayPhoto()')); $font_site->setValue(18); $apply = new Zend_Form_Element_Select('apply'); $apply->setAttribs(array('class' => 'form-control')); $font_color = new Zend_Form_Element_text('font_color'); $font_color->setAttribs(array('class' => 'colorpicker-default form-control', 'onclick' => 'displayPhoto()')); $note = new Zend_Form_Element_Textarea('note'); $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 100px;")); $from_time = new Zend_Form_Element_Text('from_time'); $from_time->setAttribs(array('class' => 'form-control clockface-open', 'id' => 'clockface_1')); $to_time = new Zend_Form_Element_Text('to_time'); $to_time->setAttribs(array('class' => 'form-control clockface-open', 'id' => 'clockface_2')); $id = new Zend_Form_Element_Hidden('id'); if (!empty($data)) { $id->setValue($data['id']); $combo_code->setValue($data['menu_code']); $description->setValue($data['desc']); $lang_1->setValue($data['lang1']); $lang_2->setValue($data['lang2']); $show_description->setValue($data['display_by']); $backgroun_color->setValue($data['background_color']); $font_color->setValue($data['font_color']); $font_site->setValue($data['font_size']); $from_time->setValue($data['date']); $note->setValue($data['note']); $active->setValue($data['status']); $combo_item->setValue($data['is_combo']); $apply_to_company->setValue($data['apply_company']); } $this->addElements(array($apply, $active, $description, $lang_1, $lang_2, $lang_3, $show_description, $background, $font_color, $font_size, $note, $combo_code, $combo_item, $id, $note, $backgroun_color, $font_site, $font_color, $apply_to_company, $user_activate, $from_time, $to_time)); return $this; }
public function init() { //parent::__construct($options); $this->setName('addnewdevotee')->setAttrib('id', 'addnewdevotee')->setEnctype(Zend_Form::ENCTYPE_MULTIPART); //SUB FORM for Preliminary Information aboout Devotee $SubForm_BasicInfo = new Zend_Form_SubForm(); $DevPic = new Zend_Form_Element_File('uplphoto'); $DevPic->setLabel('Upload Your Photo Here')->setName('uplphoto'); $path = 'photos/'; $DevPic->setDestination($path)->addValidator('Size', true, array('max' => '4096000', 'messages' => 'The maximum permitted image file size is %max% selected image file size is %size%.'))->addValidator('Extension', true, array('jpg,jpeg', 'messages' => 'photo with only jpg, jpeg or gif format are accepted for uploading profile.')); //->setRequired(true) //->addValidator('NotEmpty'); //->setValidators(array('Size'=>array('min' => 20,'max' =>2097152),'Count' =>array('min' => 1,'max' => 3))) //->addValidator('IsImage'); //to disable the viewrenderer use //$this->_helper->viewRenderer->setNoRender(true); $Fname = new Zend_Form_Element_Text('first_name'); $Fname->setLabel('First Name*')->setName('first_name')->setAttrib('placeholder', 'First Name')->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => true)))->setRequired(true)->addValidator('NotEmpty')->addFilters(array('StripTags', 'StringTrim')); $Mname = new Zend_Form_Element_Text('middle_name'); $Mname->setLabel('Middle Name*')->setName('middle_name')->setAttrib('placeholder', 'Middle Name')->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => true)))->setRequired(true)->addValidator('NotEmpty')->addFilters(array('StripTags', 'StringTrim')); $Lname = new Zend_Form_Element_Text('last_name'); $Lname->setLabel('Last Name*')->setName('last_name')->setAttrib('placeholder', 'Last Name')->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => true)))->setRequired(true)->addValidator('NotEmpty')->addFilters(array('StripTags', 'StringTrim')); $Day = new Zend_Form_Element_Select('day'); $Day->setLabel('Date of Birth*')->setName('day')->setRequired(true)->setMultiOptions(Rgm_Basics::getDates())->addValidator('NotEmpty')->addFilters(array('StripTags', 'StringTrim')); $Month = new Zend_Form_Element_Select('month'); $Month->setName('month')->setRequired(true)->setMultiOptions(Rgm_Basics::getMonths())->addValidator('NotEmpty')->addFilters(array('StripTags', 'StringTrim')); $Year = new Zend_Form_Element_Select('year'); $Year->setName('year')->setRequired(true)->setMultiOptions(Rgm_Basics::getYears(1912, 2012))->addValidator('NotEmpty')->addFilters(array('StripTags', 'StringTrim')); $Gender = new Zend_Form_Element_Radio('gender'); $Gender->setName('gender')->setLabel('Gender*')->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => true)))->setRequired(true)->setMultiOptions(array('M' => 'Male', 'F' => 'Female'))->setSeparator('')->addFilters(array('StripTags', 'StringTrim')); $centr = new Application_Model_DbTable_MstCenter(); $CenterOptions = $centr->getKeyValues(); $Center = new Zend_Form_Element_Select('center'); $Center->setName('center')->setLabel('Center*')->setMultiOptions($CenterOptions)->setRequired(false)->addValidator('NotEmpty'); $con = new Application_Model_DbTable_MstCounselor(); $Counselor = new Zend_Form_Element_Select('counselor'); $CounselorOptions = $con->getKeyValues(); $Counselor->setName('counselor')->setMultiOptions($CounselorOptions)->setLabel('Counselor')->setRequired(false)->addValidator('NotEmpty')->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => true)))->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $mentr = new Application_Model_DbTable_MstAstCounselor(); $MentorOptions = $mentr->getKeyValues(); $Mentor = new Zend_Form_Element_Select('mentor'); $Mentor->setName('mentor')->setLabel('Mentor')->setMultioptions($MentorOptions)->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => true)))->setRequired(false)->addValidator('NotEmpty')->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $Mobile = new Zend_Form_Element_Text('mobile'); $Mobile->setName('mobile')->setLabel('Mobile No')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->addValidator(new Rgm_Validate_MobileNumber())->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => true))); $CC = new Application_Model_DbTable_MstCountry(); $CCOptions = $CC->getPairWithTelCode(); $CountryCode = new Zend_Form_Element_Select('cc'); $CountryCode->setName('cc')->setLabel('Country Code*')->setMultiOptions($CCOptions)->setRequired(true)->addValidator('NotEmpty'); $PhoneNumber = new Zend_Form_Element_Text('phone_number'); $PhoneNumber->setName('phone_number')->setLabel('Phone Number(R/O)')->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => true)))->addFilters(array('StripTags', 'StringTrim'))->setRequired(false); $Email = new Zend_Form_Element_Text('email'); $Email->setName('email')->setLabel('Email Id:')->addValidator('NotEmpty')->addValidator('EmailAddress')->addFilters(array('StripTags', 'StringTrim')); $CounseleeStatus = new Application_Model_DbTable_MstCounseleeStatus(); $CounseleeStatusOptions = $CounseleeStatus->getCounseleeStatus(); $CounsellingStatus = new Zend_Form_Element_Select('counselee_status'); $CounsellingStatus->setName('counselee_status')->setLabel('Counselling Status*')->setRequired(true)->setMultiOptions($CounseleeStatusOptions); $ActiveStatus = new Zend_Form_Element_Select('active_status'); $ActiveStatus->setName('active_status')->setLabel('Active Status*')->setMultiOptions(array('A' => 'Active', 'I' => 'Inactive', 'E' => 'Deceased'))->setRequired(true); $SubForm_BasicInfo->addElements(array($DevPic, $Fname, $Mname, $Lname, $Day, $Month, $Year, $Gender, $CountryCode, $Mobile, $PhoneNumber, $Email, $Center, $Counselor, $Mentor, $CounsellingStatus, $ActiveStatus)); /*Personal Information */ $SubForm_Personal_Info = new Zend_Form_SubForm(); $langsknownOptions = new Application_Model_DbTable_MstLanguage(); $langsknownOptions = $langsknownOptions->getLanguagelist(); $MotherTongue = new Zend_Form_Element_select('mother_tongue'); $MotherTongue->setName('mother_tongue')->setLabel('Mother Tongue*')->setMultiOptions($langsknownOptions)->addFilters(array('StripTags', 'StringTrim'))->setRequired(true); $LanguagesKnown = new Zend_Form_Element_MultiSelect('languages_known'); $LanguagesKnown->setName('languages_known')->setLabel('Languages Known* ')->setMultiOptions($langsknownOptions)->setRequired(true); $BldGrp = new Zend_Form_Element_Select('bld_grp'); $BldGrp->setName('bld_grp')->setLabel('Blood Group')->setMultiOptions(Rgm_Basics::getBloodGroupsAsoArr()); $Religion = new Application_Model_DbTable_MstReligion(); $ReligionOptions = $Religion->getReligionslist(); $PrevReligion = new Zend_Form_Element_Select('previous_religion'); $PrevReligion->setName('previous_religion')->setLabel('Previous Religion*')->setMultiOptions($ReligionOptions)->setRequired(true); $SubForm_Personal_Info->addElements(array($MotherTongue, $BldGrp, $PrevReligion, $LanguagesKnown)); //PRESENT AND PERMENANT ADDRESS INFORMATION $SubForm_Address_Info = new Zend_Form_SubForm(); $NativePlace = new Zend_Form_Element_Text('native_place'); $NativePlace->setName('native_place')->setLabel('Native Place* ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $NativeStatedb = new Application_Model_DbTable_MstState(); $NativeStateOptions = $NativeStatedb->getStateKeyValues(); $NativeState = new Zend_Form_Element_Select('native_state'); $NativeState->setName('native_state')->SetLabel('Native State* ')->setMultiOptions($NativeStateOptions)->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PresentAddLine1 = new Zend_Form_Element_Text('present_addline1'); $PresentAddLine1->setName('addline1')->setLabel('PlotNo.\\Room No.\\Wing*')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PresentAddLine2 = new Zend_Form_Element_Text('present_addline2'); $PresentAddLine2->setName('addline2')->setLabel('Bulding\\Chawl')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PresentLocality = new Zend_Form_Element_Text('present_locality'); $PresentLocality->setName('present_locality')->setLabel('Locality*')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PresentCity = new Zend_Form_Element_Text('present_city'); $PresentCity->setName('present_city')->SetLabel('City')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PresentState = new Zend_Form_Element_Text('present_state'); $PresentState->setName('present_state')->setLabel('State* ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PresentCountry = new Zend_Form_Element_Text('present_country'); $PresentCountry->setName('present_country')->SetLabel('Country* ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PresentZipCode = new Zend_Form_Element_Text('present_zip_code'); $PresentZipCode->setName('present_zip_code')->setLabel('Zip Code* ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PermenantAddLine1 = new Zend_Form_Element_Text('permenant_addline1'); $PermenantAddLine1->setName('permenant_addline1')->setLabel('PlotNo.\\Room No.\\Wing*')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PermenantAddLine2 = new Zend_Form_Element_Text('permenant_addline2'); $PermenantAddLine2->setName('permenant_addline2')->setLabel('Bulding\\Chawl')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PermenantLocality = new Zend_Form_Element_Text('permenant_locality'); $PermenantLocality->setName('permenant_locality')->setLabel('Locality*')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PermenantCity = new Zend_Form_Element_Text('permenant_city'); $PermenantCity->setName('permenant_city')->SetLabel('City')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PermenantState = new Zend_Form_Element_Text('permenant_state'); $PermenantState->setName('permenant_state')->setLabel('State* ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PermenantCountry = new Zend_Form_Element_Text('permenant_country'); $PermenantCountry->setName('permenant_country')->SetLabel('Country* ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PermenantZipCode = new Zend_Form_Element_Text('permenant_zip_code'); $PermenantZipCode->setName('permenant_zip_code')->setLabel('Zip Code* ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $SubForm_Address_Info->addElements(array($NativePlace, $PresentAddLine1, $PresentAddLine2, $PresentLocality, $PresentCity, $PresentState, $PresentCountry, $PermenantZipCode, $PermenantAddLine1, $PermenantAddLine2, $PermenantCity, $PermenantCountry, $PermenantLocality, $PermenantState, $PermenantZipCode)); //SUB FORM for Family Information $SubForm_Family_Info = new Zend_Form_SubForm(); $Father = new Zend_Form_Element_Text('father_name'); $Father->setName('father_name')->SetLabel('Father Name* ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $Mother = new Zend_Form_Element_Text('mother_name'); $Mother->setName('mother_name')->setLabel('Mother Name* ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $AsramStatus = new Application_Model_DbTable_MstAsram(); $AsramStatusOptions = $AsramStatus->listPairs(); $MaritalStatus = new Zend_Form_Element_Select('marital_status'); $MaritalStatus->setName('marital_status')->setLabel('Marital Status* ')->setMultiOptions($AsramStatusOptions)->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $SubForm_Family_Info->addElements(array($Father, $Mother, $MaritalStatus)); //SUB FORM Education Info $SubForm_Education_Info = new Zend_Form_SubForm(); $isgurukuli = new Zend_Form_Element_Radio('gurukuli'); $isgurukuli->setName('gurukuli')->setLabel('IS Gurukuli* ')->setMultiOptions(array(array('value' => 'Yes', 'key' => 'Y'), array('value' => 'No', 'key' => 'N')))->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $highesteducationdb = new Application_Model_DbTable_MstEducationCategory(); $highesteducationOptions = $highesteducationdb->getEduCategory(); $HighEducation = new Zend_Form_Element_Select('highest_education'); $HighEducation->setName('highest_education')->setLabel('Highest Education* ')->setMultiOptions($highesteducationOptions)->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $EduDescription = new Zend_Form_Element_Text('education_description'); $EduDescription->setName('education_description')->setLabel('Education Description* ')->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => true)))->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $Occupationdb = new Application_Model_DbTable_MstOccupation(); $OccupationOptions = $Occupationdb->listOccupation(); $Occupation = new Zend_Form_Element_Select('occupation'); $Occupation->setName('education_description')->setLabel('Education Description* ')->setMultiOptions($OccupationOptions)->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $PresDesignation = new Zend_Form_Element_Text('present_designation'); $PresDesignation->setName('present_designation')->setLabel('Present Designation ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $Merits_Awards = new Zend_Form_Element_Text('merits_awards'); $Merits_Awards->setName('merits_awards')->setLabel('Merits Awards')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $SkillSet = new Zend_Form_Element_Text('skill_sets'); $SkillSet->setName('skill_sets')->setLabel('Skill Sets ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $SubForm_Education_Info->addElements(array($isgurukuli, $HighEducation, $EduDescription, $Occupation, $PresDesignation, $Merits_Awards, $SkillSet)); //SUBFORM for Office Information $SubForm_Office_Info = new Zend_Form_SubForm(); $Organization = new Zend_Form_Element_Text('organization'); $Organization->setName('organization')->setLabel('Organization ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $OffAddress = new Zend_Form_Element_Text('office_address'); $OffAddress->setName('office_address')->setLabel('Address')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $OffLocality = new Zend_Form_Element_Text('office_locality'); $OffLocality->setName('office_locality')->setLabel('Locality ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $OffCity = new Zend_Form_Element_Text('office_city'); $OffCity->setName('office_city')->setLabel('City')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $OffState = new Zend_Form_Element_Text('office_state'); $OffState->setName('office_state')->setLabel('State')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $OffCountry = new Zend_Form_Element_Text('office_country'); $OffCountry->setName('office_country')->setLabel('Country')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $OffZip = new Zend_Form_Element_Text('Office_zip_code'); $OffZip->setName('Office_zip_code')->setLabel('Zip-Code')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower')); $SubForm_Office_Info->addElements(array($Organization, $OffAddress, $OffLocality, $OffCity, $OffState, $OffCountry, $OffZip)); //SUB FORM for Devotional Information $SubForm_Devotional_Info = new Zend_Form_SubForm(); $BeganChantingFromDay = new Zend_Form_Element_Select('bgn_chan_from_day'); $BeganChantingFromDay->setLabel('Started Chanting From')->setName('bgn_chan_from_day')->setMultiOptions(Rgm_Basics::getDates())->addValidator('NotEmpty')->addFilters(array('StripTags', 'StringTrim')); $BeganChantingFromMonth = new Zend_Form_Element_Select('bgn_chan_from_month'); $BeganChantingFromMonth->setLabel('Started Chanting From')->setName('bgn_chan_from_month')->setMultiOptions(Rgm_Basics::getMonths())->addValidator('NotEmpty')->addFilters(array('StripTags', 'StringTrim')); $BeganChantingFromYear = new Zend_Form_Element_Select('bgn_chan_from_year'); $BeganChantingFromYear->setLabel('Started Chanting From')->setName('bgn_chan_from_year')->setMultiOptions(Rgm_Basics::getYears(1965, 2012))->addValidator('NotEmpty')->addFilters(array('StripTags', 'StringTrim')); $BeganChantingNA = new Zend_Form_Element_Select('bgn_chan_from_na'); $BeganChantingNA->setLabel('Chants Hare Krishna Mahamantra?')->setName('bgn_chan_from_na')->SetMultiOptions(array(array('value' => 'Yes', 'key' => 'Y'), array('value' => 'No', 'key' => 'N'))); $NumberOfRoundsPresentlyChanting = new Zend_Form_Element_Select('no_rou_pres_chanting'); $NumberOfRoundsPresentlyChanting->setLabel('Number Of Rounds Presently Chanting')->setName('no_rou_pres_chanting')->SetMultiOptions(array(array('value' => '1', 'key' => '1'), array('value' => '2', 'key' => '2'), array('value' => '3', 'key' => '3'), array('value' => '4', 'key' => '4'), array('value' => '5', 'key' => '5'), array('value' => '6', 'key' => '6'), array('value' => '7', 'key' => '7'), array('value' => '8', 'key' => '8'), array('value' => '9', 'key' => '9'), array('value' => '10', 'key' => '10'), array('value' => '11', 'key' => '11'), array('value' => '12', 'key' => '12'), array('value' => '13', 'key' => '13'), array('value' => '14', 'key' => '14'), array('value' => '15', 'key' => '15'), array('value' => '16', 'key' => '16'))); $Chanting16RoundsSinceDay = new Zend_Form_Element_Select('chan_16_rounds_day'); $Chanting16RoundsSinceDay->setLabel('Chanting 16 Rounds(or more) Since')->setName('chan_16_rounds_since')->setMultiOptions(Rgm_Basics::getDates()); $Chanting16RoundsSince = new Zend_Form_Element_Select('chan_16_rounds_month'); $Chanting16RoundsSince->setLabel('Chanting 16 Rounds(or more) Since')->setName('chan_16_rounds_since')->setMultiOptions(Rgm_Basics::getMonths()); $Chanting16RoundsSince = new Zend_Form_Element_Select('chan_16_rounds_year'); $Chanting16RoundsSince->setLabel('Chanting 16 Rounds(or more) Since')->setName('chan_16_rounds_since')->setMultiOptions(Rgm_Basics::getYears(1965, 2012)); $IntroBy = new Zend_Form_Element_Text('intro_by'); $IntroBy->setName('intro_by')->setLabel('Introduced By*')->setRequired(true); $IntroCenter = new Zend_Form_Element_Select('intro_center'); $IntroCenter->setName('intro_center')->setLabel('Introduction center*')->setMultiOptions($CenterOptions)->setRequired(true); $YearOfIntroduction = new Zend_Form_Element_Select('year_introduction'); $YearOfIntroduction->setName('year_introduction')->setLabel('Year of Introduction')->setMultiOptions(Rgm_Basics::getYears(1965, 2012))->setRequired(true); $HarinamInitiated = new Zend_Form_Element_Select('harinam_initiatn_na'); $HarinamInitiated->setLabel('Harinam Initiated')->setName('harinam_initiatn_na')->setMultiOptions(array(array('value' => 'Yes', 'key' => 'y'), array('value' => 'No', 'key' => 'n'))); $DayOfHarinamInitiation = new Zend_Form_Element_Select('harinam_initiatn_day'); $DayOfHarinamInitiation->setLabel('Date Of Harinam Initiation')->setName('harinam_initiation_day')->setMultiOptions(Rgm_Basics::getDates()); $MonthOfHarinamInitiation = new Zend_Form_Element_Select('harinam_initiatn_month'); $MonthOfHarinamInitiation->setName('harinam_initiation_month')->setMultiOptions(Rgm_Basics::getMonths()); $YearOfHarinamInitiation = new Zend_Form_Element_Select('harinam_initiatn_year'); $YearOfHarinamInitiation->setName('harinam_initiation_year')->setMultiOptions(Rgm_Basics::getYears(1965, 2012)); //$InitiatedName = new Zend_Form_Element_Select('initiated_name_combo'); //$InitiatedName->setName('initiated_name_combo') // ->setLabel('Initiated Name') // ->setRequired(false); //$AddNewInitiatedName = new Zend_Form_Element_Button('add_new_initiated_name'); //$AddNewInitiatedName->setName('add_new_initiated_name') // ->setValue('New'); $SpiritualMasterdb = new Application_Model_DbTable_MstGuru(); $SpiritualMasterOptions = $SpiritualMasterdb->seekGuru(); $SpiritualMaster = new Zend_Form_Element_Select('spiritual_master'); $SpiritualMaster->setName('spiritual_master')->setLabel('Spiritual Master')->setMultiOptions($SpiritualMasterOptions); $BrahmanInitiated = new Zend_Form_Element_Select('harinam_initiated'); $BrahmanInitiated->setName('harinam_initiated')->setLabel('Brahman Initiated')->setMultiOptions(array(array('value' => 'Yes', 'key' => 'Y'), array('value' => 'No', 'key' => 'N'))); $DayOfBrahmanInitiation = new Zend_Form_Element_Select('date_of_brahman_initiation'); $DayOfBrahmanInitiation->setName('date_of_brahman_initiation')->setLabel('Date Of Brahman Initiation')->setMultiOptions(Rgm_Basics::getDates()); $MonthOfBrahmanInitiation = new Zend_Form_Element_Select('brahman_initiation_month'); $MonthOfBrahmanInitiation->setName('brahman_initiation_month')->setMultiOptions(Rgm_Basics::getMonths()); $YearOfBrahmanInitiation = new Zend_Form_Element_Select('brahman_initiation_year'); $YearOfBrahmanInitiation->setName('brahman_initiation_year')->setMultiOptions(Rgm_Basics::getYears(1965, 2012)); $DayOfSanyasInitiation = new Zend_Form_Element_Select('sanyas_initiation_day'); $DayOfSanyasInitiation->setName('sanyas_initiation_day')->setLabel('Date of Sanyas Initiation')->setMultiOptions(Rgm_Basics::getDates()); $MonthOfSanyasInitiation = new Zend_Form_Element_Select('sanyas_initiation_month'); $MonthOfSanyasInitiation->setName('sanyas_initiation_month')->setMultiOptions(Rgm_Basics::getMonths()); $YearOfSanyasInitiation = new Zend_Form_Element_Select('sanyas_initiation_year'); $YearOfSanyasInitiation->setName('sanyas_initiation_year')->setMultiOptions(Rgm_Basics::getYears(1965, 2012)); $SanyasSpiritualMaster = new Zend_Form_Element_Select('sanyas_spiritual_master'); $SanyasSpiritualMaster->setName('sanyas_spiritual_master')->setLabel('Sanyas Spiritual Master')->setMultiOptions($SpiritualMasterOptions); $SpiritualNamedb = new Application_Model_DbTable_MstSpiritualName(); $SpiritualNameOptions = $SpiritualNamedb->getKeyValues(); $SanyasName = new Zend_Form_Element_Select('sanyas_name'); $SanyasName->setLabel('Sanyas Name')->setMultiOptions($SpiritualNameOptions); $SanyasTitle = new Zend_Form_Element_Radio('sanyas_title'); $SanyasTitle->setName('sanyas_title')->setLabel('Sanyas Title')->setMultiOptions(array(array('value' => 'Goswami', 'key' => 'GOSWAMI'), array('value' => 'Swami', 'key' => 'SWAMI'))); $SubForm_Devotional_Info->addElements(array($BeganChantingFromDay, $BeganChantingFromMonth, $BeganChantingFromYear, $BeganChantingNA, $NumberOfRoundsPresentlyChanting, $Chanting16RoundsSince, $IntroBy, $IntroCenter, $YearOfIntroduction, $HarinamInitiated, $DayOfHarinamInitiation, $MonthOfHarinamInitiation, $YearOfHarinamInitiation, $SpiritualMasterdb, $SpiritualMaster, $BrahmanInitiated, $DayOfBrahmanInitiation, $MonthOfBrahmanInitiation, $YearOfBrahmanInitiation, $DayOfSanyasInitiation, $MonthOfSanyasInitiation, $YearOfSanyasInitiation, $SanyasSpiritualMaster, $SpiritualNamedb, $SanyasName, $SanyasTitle)); $SubForm_ServicesRendered_Info = new Zend_Form_SubForm(); $ServicesRenderedDB = new Application_Model_DbTable_MstServices(); $ServicesRenderedOptions = $ServicesRenderedDB->getKeyValues(); $ServicesRendered = new Zend_Form_Element_Multiselect('services_rendered'); $ServicesRendered->setName('services_rendered')->setLabel('Services Rendered')->setMultiOptions($ServicesRenderedOptions); $ServicesInterestedToRender = new Zend_Form_Element_Multiselect('interest_render_services'); $ServicesInterestedToRender->setName('interest_render_services')->setLabel('Interested in Rendering Services')->setMultiOptions($ServicesRenderedOptions); $SubForm_ServicesRendered_Info->addElements(array($ServicesRendered, $ServicesInterestedToRender)); //Adding SUBFORMS $this->addSubForms(array('basic_info' => $SubForm_BasicInfo, 'personal_info' => $SubForm_Personal_Info, 'address_info' => $SubForm_Address_Info, 'family_info' => $SubForm_Family_Info, 'education_info' => $SubForm_Education_Info, 'office_info' => $SubForm_Office_Info, 'devotional_info' => $SubForm_Devotional_Info, 'services_info' => $SubForm_ServicesRendered_Info)); }
public function FrmMenu($data = null) { $menu_group = new Zend_Form_Element_Select('menu_group'); $menu_group->setAttribs(array('class' => 'form-control input-xlarge select2me', 'required' => 'true', 'onchange' => 'poupUpForm()')); $db = new Menu_Model_DbTable_DbMenu(); $opt = $db->getAllGroupMenu(); $menu_group->setMultiOptions($opt); $root_code = new Zend_Form_Element_Select('root_code'); $root_code->setAttribs(array('class' => 'form-control input-xlarge select2me', 'onClick' => 'FuncRootMenuCode()')); $select_root_code_opt = array("" => $this->tr->translate("SELECT_GROUP_CODE"), -1 => $this->tr->translate("ADD_NEW")); $root_code->setMultiOptions($select_root_code_opt); $root_menu = new Zend_Form_Element_Select('root_menu'); $root_menu->setAttribs(array('class' => 'form-control input-xlarge select2me', 'onClick' => 'FuncRootMenuCode()')); $db = new Menu_Model_DbTable_DbMenu(); $opt = $db->getAllRootMenu(); $root_menu->setMultiOptions($opt); $root_menus = new Zend_Form_Element_Select('root_menus'); $root_menus->setAttribs(array('class' => 'form-control', 'onClick' => 'FuncRootMenuCode()')); $root_menu_opt = array("" => $this->tr->translate("SELECT_ROOT_MENU"), -1 => $this->tr->translate("ADD_NEW")); $root_menus->setMultiOptions($root_menu_opt); $apply_to_company = new Zend_Form_Element_Select('apply_to_company'); $apply_to_company->setAttribs(array('class' => 'form-control')); $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY")); $apply_to_company->setMultiOptions($apply_opt); $combo = new Zend_Form_Element_Checkbox('combo'); $combo->setAttribs(array('class' => 'red')); $printer_code = new Zend_Form_Element_Select('printer_code'); $printer_code->setAttribs(array('class' => 'form-control input-xlarge select2me')); $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY")); $printer_code->setMultiOptions($apply_opt); $combo = new Zend_Form_Element_Checkbox('combo'); $combo->setAttribs(array('class' => 'red')); $combo_code = new Zend_Form_Element_Text('combo_code'); $combo_code->setAttribs(array('class' => 'form-control', 'onkeyup' => 'displayPhoto()')); $description = new Zend_Form_Element_Text('description'); $description->setAttribs(array('class' => 'form-control', 'onchange' => 'displayPhoto()')); $lang_1 = new Zend_Form_Element_Text('lang_1'); $lang_1->setAttribs(array('class' => 'form-control', 'onchange' => 'displayPhoto()')); $lang_2 = new Zend_Form_Element_Text('lang_2'); $lang_2->setAttribs(array('checked' => 'checked', 'class' => 'form-control', 'onchange' => 'displayPhoto()')); $price = new Zend_Form_Element_Text('price'); $price->setAttribs(array('checked' => 'checked', 'class' => 'form-control')); $lang_3 = new Zend_Form_Element_Text('lang_3'); $lang_3->setAttribs(array('checked' => 'checked', 'class' => 'form-control')); if ($data != null) { } $db = new Application_Model_DbTable_DbGlobal(); $show_description = new Zend_Form_Element_Select('show_description'); $show_description->setAttribs(array('class' => 'form-control', 'required' => 'true', 'onchange' => 'displayPhoto()')); $opt = $db->getVewOptoinTypeByType(1, 1, null, 1); $show_description->setMultiOptions($opt); //$photo = new Zend_Form_Element_File('photo'); $background = new Zend_Form_Element_select('background'); $background->setAttribs(array('class' => 'form-control color-picker-rgba')); $otp = array('0' => 'apply to company', '1' => 'A', '2' => 'B', '3' => 'C'); $background->setMultiOptions($otp); $font_color = new Zend_Form_Element_Text('font_color'); $font_color->setAttribs(array('class' => 'form-control', 'id' => "selected-color1")); $font_size = new Zend_Form_Element_Text('demo3'); $font_size->setAttribs(array('class' => 'form-control', 'id' => "demo3", 'value' => 12, 'placeholder' => '12')); $apply = new Zend_Form_Element_Select('apply'); $apply->setAttribs(array('class' => 'form-control')); $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY")); $apply->setMultiOptions($apply_opt); $combo = new Zend_Form_Element_Checkbox('combo'); $combo->setAttribs(array('class' => 'red')); $combo1 = new Zend_Form_Element_Checkbox('combo1'); $combo1->setAttribs(array('class' => 'red')); $combo2 = new Zend_Form_Element_Checkbox('combo2'); $combo2->setAttribs(array('class' => 'red')); $combo3 = new Zend_Form_Element_Checkbox('combo3'); $combo3->setAttribs(array('class' => 'red')); $combo4 = new Zend_Form_Element_Checkbox('combo4'); $combo4->setAttribs(array('class' => 'red')); $active = new Zend_Form_Element_Checkbox('active'); $active->setAttribs(array('class' => 'red')); $format = new Zend_Form_Element_Text('demo4'); $format->setAttribs(array('class' => 'form-control', 'id' => "demo4", 'value' => 12, 'placeholder' => '12')); $note = new Zend_Form_Element_Textarea('note'); $note->setAttribs(array('class' => 'form-control', 'id' => "demo4", 'value' => 12, 'placeholder' => '12')); $setting = new Zend_Form_Element_Select('setting'); $setting->setAttribs(array('class' => 'form-control')); $setting_opt = array("" => $this->tr->translate("SELECT_SETTING")); $setting->setMultiOptions($setting_opt); $arrange = new Zend_Form_Element_Text('arrange'); $arrange->setAttribs(array('class' => 'form-control')); $resize = new Zend_Form_Element_Text('resize'); $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12')); $backgroun_color = new Zend_Form_Element_Text('backgroun_color'); $backgroun_color->setAttribs(array('class' => 'colorpicker-rgba form-control', 'onclick' => 'displayPhoto()')); $font_site = new Zend_Form_Element_text('font_size'); $font_site->setAttribs(array('class' => ' spinner-input form-control', 'onkeyup' => 'displayPhoto()', 'onclick' => 'displayPhoto()')); $font_site->setValue(18); $apply = new Zend_Form_Element_Select('apply'); $apply->setAttribs(array('class' => 'form-control')); $font_color = new Zend_Form_Element_text('font_color'); $font_color->setAttribs(array('class' => 'colorpicker-default form-control', 'onclick' => 'displayPhoto()')); $note = new Zend_Form_Element_Textarea('note'); $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 100px;")); //upload image to folder $photo = new Zend_Form_Element_file('photo'); $id = new Zend_Form_Element_Hidden('id'); if (!empty($data)) { //print_r($data);exit(); $id->setValue($data['id']); // print_r($data=['$id']);exit(); $combo_code->setValue($data['bar_code']); $description->setValue($data['desc']); $lang_1->setValue($data['lang1']); $lang_2->setValue($data['lang2']); $show_description->setValue($data['display_by']); $price->setValue($data['price']); $menu_group->setValue($data['category_id']); $photo->setValue($data['img_name']); $root_menu->setValue($data['root_menuid']); $combo->setValue($data['root_menu_name']); $combo1->setValue($data['printto_print']); $backgroun_color->setValue($data['background_color']); $font_color->setValue($data['font_color']); $font_site->setValue($data['font_size']); $combo2->setValue($data['showscreen']); $note->setValue($data['note']); $combo3->setValue($data['is_discound']); $combo4->setValue($data['time']); } $this->addElements(array($apply, $active, $menu_group, $description, $lang_1, $lang_2, $lang_3, $combo_code, $show_description, $background, $font_color, $font_size, $format, $setting, $arrange, $resize, $note, $price, $root_menu, $printer_code, $apply_to_company, $root_code, $root_menus, $combo, $combo1, $combo2, $combo3, $combo4, $id, $photo, $note, $backgroun_color, $font_site, $font_color)); return $this; }