Example #1
0
 public function FrmAddCommune($data = null)
 {
     $commune = new Zend_Dojo_Form_Element_TextBox('commune_name');
     $commune->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'required' => 'true', 'missingMessage' => 'Invalid Module!', 'class' => 'fullside'));
     $communekh = new Zend_Dojo_Form_Element_TextBox('commune_namekh');
     $communekh->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'required' => 'true', 'missingMessage' => 'Invalid Module!', 'class' => 'fullside'));
     $_display = new Zend_Dojo_Form_Element_FilteringSelect('display');
     $_display->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $_display_opt = array(1 => $this->tr->translate("NAME_KHMER"), 2 => $this->tr->translate("NAME_ENGLISH"));
     $_display->setMultiOptions($_display_opt);
     $_db = new Application_Model_DbTable_DbGlobal();
     $rows_provice = $_db->getAllDistrict();
     $opt_province = "";
     if (!empty($rows_provice)) {
         foreach ($rows_provice as $row) {
             $opt_province[$row['dis_id']] = $row['district_name'];
         }
     }
     $district_name = new Zend_Dojo_Form_Element_FilteringSelect('district_name');
     $district_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $district_name->setMultiOptions($opt_province);
     $_db = new Application_Model_DbTable_DbGlobal();
     $rows_provice = $_db->getAllProvince();
     $opt_province = "";
     if (!empty($rows_provice)) {
         foreach ($rows_provice as $row) {
             $opt_province[$row['province_id']] = $row['province_en_name'];
         }
     }
     $_province = new Zend_Dojo_Form_Element_FilteringSelect('province_name');
     $_province->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'filterDistrict();'));
     $_province->setMultiOptions($opt_province);
     $_province->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => 'true', 'class' => 'fullside'));
     $_arr = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status = new Zend_Dojo_Form_Element_FilteringSelect("status");
     $_status->setMultiOptions($_arr);
     $_status->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => 'true', 'missingMessage' => 'Invalid Module!', 'class' => 'fullside'));
     if (!empty($data)) {
         $commune->setValue($data['commune_name']);
         // 			echo $data['commune_namekh'];exit();
         $communekh->setValue($data['commune_namekh']);
         $_display->setValue($data['displayby']);
         $district_name->setValue($data['district_id']);
         $_province->setValue($data['pro_id']);
         $_status->setValue($data['status']);
     }
     $this->addElements(array($commune, $district_name, $communekh, $_province, $_status, $_display));
     return $this;
 }
Example #2
0
	public function FrmAddDistrict($data=null){
		
		$request=Zend_Controller_Front::getInstance()->getRequest();
		
		$_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
		$_title->setAttribs(array('dojoType'=>$this->tvalidate,
				'onkeyup'=>'this.submit()',
				'placeholder'=>$this->tr->translate("SEARCH_DISTRICT_INFO")
		));
		$_title->setValue($request->getParam("adv_search"));
		
		
		$_status_search=  new Zend_Dojo_Form_Element_FilteringSelect('search_status');
		$_status_search->setAttribs(array('dojoType'=>$this->filter));
		$_status_opt = array(
				-1=>$this->tr->translate("ALL"),
				1=>$this->tr->translate("ACTIVE"),
				0=>$this->tr->translate("DACTIVE"));
		$_status_search->setMultiOptions($_status_opt);
		$_status_search->setValue($request->getParam("search_status"));
		
		$_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
		$_btn_search->setAttribs(array(
				'dojoType'=>'dijit.form.Button',
				'iconclass'=>'dijitIconSearch',
		
		));
		
		$district_name = new Zend_Dojo_Form_Element_TextBox('district_name');
		$district_name->setAttribs(array('dojoType'=>'dijit.form.ValidationTextBox',
				'required'=>'true','missingMessage'=>'Invalid Module!','class'=>'fullside'
				));
		
		$district_namekh = new Zend_Dojo_Form_Element_TextBox('district_namekh');
		$district_namekh->setAttribs(array('dojoType'=>'dijit.form.ValidationTextBox',
				'required'=>'true','missingMessage'=>'Invalid Module!','class'=>'fullside'
		));
		
		$code = new Zend_Dojo_Form_Element_TextBox('code');
		$code->setAttribs(array('dojoType'=>'dijit.form.ValidationTextBox',
				'required'=>'true','missingMessage'=>'Invalid Module!','class'=>'fullside'
		));
		
		$popupdistrict_name = new Zend_Dojo_Form_Element_TextBox('pop_district_name');
		$popupdistrict_name->setAttribs(array('dojoType'=>'dijit.form.ValidationTextBox',
				'required'=>'true','missingMessage'=>'Invalid Module!','class'=>'fullside'
		));
		
		$pop_district_namekh = new Zend_Dojo_Form_Element_TextBox('pop_district_namekh');
		$pop_district_namekh->setAttribs(array('dojoType'=>'dijit.form.ValidationTextBox',
				'required'=>'true','missingMessage'=>'Invalid Module!','class'=>'fullside'
		));
		
		$_display =  new Zend_Dojo_Form_Element_FilteringSelect('display');
		$_display->setAttribs(array('dojoType'=>'dijit.form.FilteringSelect','class'=>'fullside',));
		$_display_opt = array(
				1=>$this->tr->translate("NAME_KHMER"),
				2=>$this->tr->translate("NAME_EN"));
		$_display->setMultiOptions($_display_opt);

		$_db = new Application_Model_DbTable_DbGlobal();		
		$rows_province = $_db->getAllProvince();
		$opt_province = array(''=>$this->tr->translate("SELECT_PROVINCE"));
		if(!empty($rows_province))foreach($rows_province AS $row) $opt_province[$row['province_id']]=$row['province_en_name'];
		
		$_province = new Zend_Dojo_Form_Element_FilteringSelect('province_name');
		$_province->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside'
		));
		
		$_province->setMultiOptions($opt_province);
		$_province->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'required'=>'true',
				'class'=>'fullside',
				));
		$_province->setValue($request->getParam('province_name'));
		
		if(!empty($rows_province))foreach($rows_province AS $row) $opt_province[$row['province_id']]=$row['province_en_name'];
		
		$_provincess=new Zend_Dojo_Form_Element_FilteringSelect('province_names');
		$_provincess->setAttribs(array('dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'filterDistrict();',
		));
		$_provincess->setMultiOptions($opt_province);
		
		
		$_arr = array(1=>$this->tr->translate("ACTIVE"),0=>$this->tr->translate("DACTIVE"));
		$_status = new Zend_Dojo_Form_Element_FilteringSelect("status");
		$_status->setMultiOptions($_arr);
		$_status->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'required'=>'true',
				'missingMessage'=>'Invalid Module!',
				'class'=>'fullside'));
		$id = new Zend_Form_Element_Hidden('id');
		if(!empty($data)){
			$id->setValue($data['dis_id']);
			$code->setValue($data['code']);
			$district_name->setValue($data['district_name']);
			$district_namekh->setValue($data['district_namekh']);
			$_display->setValue($data['displayby']);
			$_province->setValue($data['pro_id']);
			
			$_status->setValue($data['status']);
		}
		$this->addElements(array($code,$pop_district_namekh,$_provincess,$_status_search,$_title,$id,$district_name,$popupdistrict_name,$district_namekh,$_display,$_province, $_status));
		return $this;
		
	}
Example #3
0
 public function FrmTecher($_data = null)
 {
     $_enname = new Zend_Dojo_Form_Element_TextBox('en_name');
     $_enname->setAttribs(array('dojoType' => $this->tvalidate, 'required' => 'true', 'class' => 'fullside'));
     $_khname = new Zend_Dojo_Form_Element_TextBox('kh_name');
     $_khname->setAttribs(array('dojoType' => $this->tvalidate, 'required' => 'true', 'class' => 'fullside'));
     $code = new Zend_Dojo_Form_Element_TextBox('code');
     $code->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside', 'readOnly' => 'readOnly'));
     $db = new Application_Model_DbTable_DbGlobal();
     $code_num = $db->getTeacherCode();
     $code->setValue($code_num);
     $phone = new Zend_Dojo_Form_Element_TextBox('phone');
     $phone->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside'));
     $sex = new Zend_Dojo_Form_Element_FilteringSelect('sex');
     $sex->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
     $options = array(1 => "M", 2 => "F");
     $sex->setMultiOptions($options);
     $dob = new Zend_Dojo_Form_Element_DateTextBox('dob');
     $dob->setAttribs(array('dojoType' => $this->t_date, 'class' => 'fullside'));
     $_adress = new Zend_Dojo_Form_Element_TextBox('address');
     $_adress->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside'));
     $db = new Application_Model_DbTable_DbGlobal();
     $db->getAllProvince();
     $rows = $db->getAllProvince();
     $opt = "";
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $opt[$row['id']] = $row['province_name'];
         }
     }
     $pob = new Zend_Dojo_Form_Element_FilteringSelect('pob');
     $pob->setAttribs(array('dojoType' => $this->filter, 'class' => 'pob', 'class' => 'fullside'));
     $pob->setMultiOptions($opt);
     $_email = new Zend_Dojo_Form_Element_TextBox('email');
     $_email->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside'));
     $_degree = new Zend_Dojo_Form_Element_FilteringSelect('degree');
     $_degree->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
     $_note = new Zend_Dojo_Form_Element_TextBox('note');
     $_note->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $_degree = new Zend_Dojo_Form_Element_FilteringSelect('degree');
     $_degree->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
     $degree_opt = $db->getAllDegree();
     $_degree->setMultiOptions($degree_opt);
     $_photo = new Zend_Form_Element_File('photo');
     $_status = new Zend_Dojo_Form_Element_FilteringSelect('status');
     $_status->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
     $_status_opt = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status->setMultiOptions($_status_opt);
     $_submit = new Zend_Dojo_Form_Element_SubmitButton('submit');
     $_submit->setLabel("save");
     $id = new Zend_Form_Element_Hidden('id');
     if (!empty($_data)) {
         $id->setValue($_data['id']);
         $code->setValue($_data['teacher_code']);
         $_enname->setValue($_data['teacher_name_en']);
         $_khname->setValue($_data['teacher_name_kh']);
         $sex->setValue($_data['sex']);
         $phone->setValue($_data['phone']);
         $pob->setValue($_data['pob']);
         $dob->setValue($_data['dob']);
         $_adress->setValue($_data['address']);
         $_email->setValue($_data['email']);
         $_degree->setValue($_data['degree']);
         $_note->setValue($_data['note']);
         $_status->setValue($_data['status']);
     }
     $this->addElements(array($id, $_enname, $_note, $_khname, $pob, $code, $phone, $sex, $dob, $_adress, $_email, $_degree, $_photo, $_status, $_submit));
     return $this;
 }
Example #4
0
 public function FrmAddClient($data = null)
 {
     $_group = new Zend_Dojo_Form_Element_CheckBox('is_group');
     $_group->setAttribs(array('dojoType' => 'dijit.form.CheckBox', 'onchange' => 'getGroupCode();'));
     $_group_code = new Zend_Dojo_Form_Element_TextBox('group_code');
     $_group_code->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'readonly' => 'readonly', 'style' => 'color:red;'));
     // 		$db = new Application_Model_DbTable_DbGlobal();
     // 		$id_client = $db->getNewClientId();
     $_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
     $_branch_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $db = new Application_Model_DbTable_DbGlobal();
     $rows = $db->getAllBranchName();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['displayby'] == 1 ? $row['branch_namekh'] : $row['branch_nameen'];
         }
     }
     $_branch_id->setMultiOptions($options);
     $_member = new Zend_Dojo_Form_Element_FilteringSelect('group_id');
     $_member->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $db = new Application_Model_DbTable_DbGlobal();
     $rows = $db->getClientByType();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['client_id']] = $row['name_en'];
         }
     }
     $_member->setMultiOptions($options);
     $_namekh = new Zend_Dojo_Form_Element_TextBox('name_kh');
     $_namekh->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => 'true'));
     $id_client = $db->getNewClientId();
     $_clientno = new Zend_Dojo_Form_Element_TextBox('client_no');
     $_clientno->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'readonly' => 'readonly', 'style' => 'color:red;'));
     $_clientno->setValue($id_client);
     $_nameen = new Zend_Dojo_Form_Element_TextBox('name_en');
     $_nameen->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => 'true'));
     $_sex = new Zend_Dojo_Form_Element_FilteringSelect('sex');
     $_sex->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = array(1 => "Male", 2 => "Femail");
     $_sex->setMultiOptions($opt);
     $_situ_status = new Zend_Dojo_Form_Element_FilteringSelect('situ_status');
     $_situ_status->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt_status = $db->getAllSituation();
     $_situ_status->setMultiOptions($opt_status);
     $_province = new Zend_Dojo_Form_Element_FilteringSelect('province');
     $_province->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $rows = $db->getAllProvince();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['province_id']] = $row['province_en_name'];
         }
     }
     $_province->setMultiOptions($options);
     $_district = new Zend_Dojo_Form_Element_FilteringSelect('district');
     $rows = $db->getAllDistrict();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['dis_id']] = $row['district_name'];
         }
     }
     $_district->setMultiOptions($options);
     $_district->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'popupCheckDistrict();'));
     $_commune = new Zend_Dojo_Form_Element_FilteringSelect('commune');
     $rows = $db->getCommune();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['com_id']] = $row['commune_name'];
         }
     }
     $_commune->setMultiOptions($options);
     $_commune->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'popupCheckCommune();'));
     $_village = new Zend_Dojo_Form_Element_FilteringSelect('village');
     $_village->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true', 'onchange' => 'popupCheckVillage();'));
     $rows = $db->getVillage();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['vill_id']] = $row['village_name'];
         }
     }
     $_village->setMultiOptions($options);
     $_house = new Zend_Dojo_Form_Element_TextBox('house');
     $_house->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside'));
     $_street = new Zend_Dojo_Form_Element_TextBox('street');
     $_street->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => 'true'));
     $_id_type = new Zend_Dojo_Form_Element_FilteringSelect('id_type');
     $_id_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $rows = $db->GetAllIDType();
     $_id_type->setMultiOptions($rows);
     $_id_no = new Zend_Dojo_Form_Element_TextBox('id_no');
     $_id_no->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => 'true'));
     $_phone = new Zend_Dojo_Form_Element_TextBox('phone');
     $_phone->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $_spouse = new Zend_Dojo_Form_Element_TextBox('spouse');
     $_spouse->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $_desc = new Zend_Dojo_Form_Element_Textarea('desc');
     $_desc->setAttribs(array('dojoType' => 'dijit.form.SimpleTextarea', 'class' => 'fullside', 'style' => 'width:96%;min-height:50px;'));
     $_status = new Zend_Dojo_Form_Element_FilteringSelect('status');
     $_status->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $_status_opt = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status->setMultiOptions($_status_opt);
     $_id = new Zend_Form_Element_Hidden('id');
     if ($data != null) {
         $_id->setValue($data['client_id']);
         $_member->setValue($data['parent_id']);
         $_group->setValue($data['is_group']);
         $_namekh->setValue($data['name_kh']);
         $_nameen->setValue($data['name_en']);
         $_sex->setValue($data['sex']);
         $_situ_status->setValue($data['sit_status']);
         $_province->setValue($data['pro_id']);
         $_district->setValue($data['dis_id']);
         $_commune->setValue($data['com_id']);
         $_village->setValue($data['village_id']);
         $_house->setValue($data['house']);
         $_street->setValue($data['street']);
         $_id_type->setValue($data['id_type']);
         $_id_no->setValue($data['id_number']);
         $_phone->setValue($data['phone']);
         $_spouse->setValue($data['spouse_name']);
         $_desc->setValue($data['remark']);
         $_status->setValue($data['status']);
         $_clientno->setValue($data['client_number']);
     }
     $this->addElements(array($_id, $_group_code, $_branch_id, $_member, $_group, $_namekh, $_nameen, $_sex, $_situ_status, $_province, $_district, $_commune, $_village, $_house, $_street, $_id_type, $_id_no, $_phone, $_spouse, $_desc, $_status, $_clientno));
     return $this;
 }
Example #5
0
 public function FrmaddGuide($data = null)
 {
     $pob = new Zend_Dojo_Form_Element_TextBox('pob');
     $pob->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $att_file = new Zend_Form_Element_File('att_file');
     $att_file->setAttribs(array('class' => 'fullside'));
     $_dob = new Zend_Dojo_Form_Element_DateTextBox('dob_client');
     $_dob->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
     $_dob->setValue(date("Y-m-d"));
     $nationality = new Zend_Dojo_Form_Element_TextBox('nationality');
     $nationality->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $_email = new Zend_Dojo_Form_Element_TextBox('email');
     $_email->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $db = new Application_Model_DbTable_DbGlobal();
     $_namekh = new Zend_Dojo_Form_Element_TextBox('name_kh');
     $_namekh->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => 'true'));
     $id_client = $db->getDriverCode();
     $_clientno = new Zend_Dojo_Form_Element_TextBox('client_no');
     $_clientno->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'readonly' => 'readonly', 'style' => 'color:red;'));
     $_clientno->setValue($id_client);
     $_nameen = new Zend_Dojo_Form_Element_ValidationTextBox('name_en');
     $_nameen->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => 'true'));
     $_sex = new Zend_Dojo_Form_Element_FilteringSelect('sex');
     $_sex->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt_status = $db->getVewOptoinTypeByType(1, 1);
     unset($opt_status[-1]);
     unset($opt_status['']);
     $_sex->setMultiOptions($opt_status);
     $_phone = new Zend_Dojo_Form_Element_TextBox('phone');
     $_phone->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $normalprice = new Zend_Dojo_Form_Element_NumberTextBox('cnormalprice');
     $normalprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $otprice = new Zend_Dojo_Form_Element_NumberTextBox('cotprice');
     $otprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $pnormalprice = new Zend_Dojo_Form_Element_NumberTextBox('pnormalprice');
     $pnormalprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $potprice = new Zend_Dojo_Form_Element_NumberTextBox('potprice');
     $potprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $photo = new Zend_Form_Element_File('photo');
     $photo->setAttribs(array());
     $national_id = new Zend_Dojo_Form_Element_TextBox('national_id');
     $national_id->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $experience = new Zend_Dojo_Form_Element_TextBox('experience');
     $experience->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $publicholiday = new Zend_Dojo_Form_Element_NumberTextBox('poblicholiday_price');
     $publicholiday->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $weekend_price = new Zend_Dojo_Form_Element_NumberTextBox('weekend_price');
     $weekend_price->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $experience_num = new Zend_Dojo_Form_Element_NumberTextBox('experience_number');
     $experience_num->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $p_popublicholiday = new Zend_Dojo_Form_Element_NumberTextBox('ppoblicholiday_price');
     $p_popublicholiday->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $p_weekend = new Zend_Dojo_Form_Element_NumberTextBox('pweekend_price');
     $p_weekend->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $monthly_price = new Zend_Dojo_Form_Element_NumberTextBox('monthly_price');
     $monthly_price->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $_id = new Zend_Form_Element_Hidden("id");
     $_desc = new Zend_Dojo_Form_Element_TextBox('desc');
     $_desc->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'style' => 'width:96%;min-height:30px;'));
     $lang = new Zend_Dojo_Form_Element_TextBox('lang');
     $lang->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'style' => 'width:96%;min-height:50px;'));
     $_status = new Zend_Dojo_Form_Element_FilteringSelect('status');
     $_status->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = array(1 => "Active", 0 => "Deactive");
     $_status->setMultiOptions($opt);
     $_type = new Zend_Dojo_Form_Element_FilteringSelect('type');
     $_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $_status_opt = array(1 => $this->tr->translate("Guide"), 2 => $this->tr->translate("Driver"), 3 => $this->tr->translate("Both"));
     $_status_opt = $db->getVewOptoinTypeByType(8, 1, null, 1);
     $_type->setMultiOptions($_status_opt);
     $address = new Zend_Dojo_Form_Element_TextBox('home');
     $address->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $groupnum = new Zend_Dojo_Form_Element_TextBox('group');
     $groupnum->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $streetnum = new Zend_Dojo_Form_Element_TextBox('street');
     $streetnum->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $commune = new Zend_Dojo_Form_Element_TextBox('commune');
     $commune->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $district = new Zend_Dojo_Form_Element_TextBox('district');
     $district->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $province = new Zend_Dojo_Form_Element_FilteringSelect('province');
     $province->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = $db->getAllProvince(1);
     $province->setMultiOptions($opt);
     $id_card = new Zend_Dojo_Form_Element_TextBox('id_card');
     $id_card->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $issued_date = new Zend_Dojo_Form_Element_DateTextBox('issued_date');
     $issued_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
     $issued_date->setValue(date("Y-m-d"));
     $registered_date = new Zend_Dojo_Form_Element_DateTextBox('registered_date');
     $registered_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
     $registered_date->setValue(date("Y-m-d"));
     $expired_date = new Zend_Dojo_Form_Element_DateTextBox('expired_date');
     $expired_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
     $expired_date->setValue(date("Y-m-d"));
     $_email = new Zend_Dojo_Form_Element_TextBox('email');
     $_email->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'style' => 'color:red;'));
     ///////////////////////
     $citynormalprice = new Zend_Dojo_Form_Element_NumberTextBox('citynormalprice');
     $citynormalprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $cityweekendprice = new Zend_Dojo_Form_Element_NumberTextBox('cityweekendprice');
     $cityweekendprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $cityotprice = new Zend_Dojo_Form_Element_NumberTextBox('cityotprice');
     $cityotprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $citypublic = new Zend_Dojo_Form_Element_NumberTextBox('citypublicprice');
     $citypublic->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $_id_no = new Zend_Form_Element_Hidden('id');
     if ($data != null) {
         $_id_no->setValue($data['id']);
         $_clientno->setValue($data['driver_id']);
         $_namekh->setValue($data['first_name']);
         $_nameen->setValue($data['last_name']);
         $_sex->setValue($data['sex']);
         $_dob->setValue($data['dob']);
         $pob->setValue($data['pob']);
         $nationality->setValue($data['nationality']);
         $national_id->setValue($data['doc_number']);
         $_desc->setValue($data['lang_note']);
         $_type->setValue($data['position_type']);
         $id_card->setValue($data['id_card']);
         $issued_date->setValue($data['issue_date']);
         $expired_date->setValue($data['expired_date']);
         $registered_date->setValue($data['register_date']);
         $experience->setValue($data['experience_desc']);
         $_phone->setValue($data['tel']);
         $_email->setValue($data['email']);
         $groupnum->setValue($data['group_num']);
         $address->setValue($data['home_num']);
         $streetnum->setValue($data['street']);
         $commune->setValue($data['commune']);
         $district->setValue($data['district']);
         $province->setValue($data['province_id']);
         $pnormalprice->setValue($data['p_normalprice']);
         $p_weekend->setValue($data['p_weekendprice']);
         $p_popublicholiday->setValue($data['p_holidayprice']);
         $potprice->setValue($data['p_otprice']);
         $normalprice->setValue($data['c_normalprice']);
         $weekend_price->setValue($data['c_weekendprice']);
         $publicholiday->setValue($data['c_holidayprice']);
         $otprice->setValue($data['c_otprice']);
         $citypublic->setValue($data['citypublicprice']);
         $cityweekendprice->setValue($data['cityweekendprice']);
         $cityotprice->setValue($data['cityotprice']);
         $citynormalprice->setValue($data['citynormalprice']);
         $_status->setValue($data['status']);
     }
     $this->addElements(array($monthly_price, $citypublic, $cityotprice, $citynormalprice, $cityweekendprice, $province, $expired_date, $issued_date, $registered_date, $id_card, $district, $commune, $streetnum, $groupnum, $p_popublicholiday, $p_weekend, $experience, $publicholiday, $weekend_price, $pnormalprice, $potprice, $normalprice, $otprice, $lang, $address, $_type, $nationality, $_id, $photo, $national_id, $_email, $_namekh, $_nameen, $_sex, $_id_no, $_phone, $_desc, $_status, $_clientno, $_dob, $att_file, $pob));
     return $this;
 }
Example #6
0
 public function FrmAddVillage($data = null)
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
     $_title->setAttribs(array('dojoType' => $this->tvalidate, 'onkeyup' => 'this.submit()', 'placeholder' => $this->tr->translate("SEARCH_VILLAGE_INFO")));
     $_title->setValue($request->getParam("adv_search"));
     $_status_search = new Zend_Dojo_Form_Element_FilteringSelect('search_status');
     $_status_search->setAttribs(array('dojoType' => $this->filter));
     $_status_opt = array(-1 => $this->tr->translate("ALL"), 1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status_search->setMultiOptions($_status_opt);
     $_status_search->setValue($request->getParam("search_status"));
     $_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
     $_btn_search->setAttribs(array('dojoType' => 'dijit.form.Button', 'iconclass' => 'dijitIconSearch'));
     $village_name = new Zend_Dojo_Form_Element_ValidationTextBox('village_name');
     $village_name->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'required' => 'true', 'missingMessage' => 'Invalid Module!', 'class' => 'fullside'));
     $village_namekh = new Zend_Dojo_Form_Element_ValidationTextBox('village_namekh');
     $village_namekh->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'required' => 'true', 'missingMessage' => 'Invalid Module!', 'class' => 'fullside'));
     $_db = new Application_Model_DbTable_DbGlobal();
     $rows_provice = $_db->getCommune();
     $opt_commune = "";
     if (!empty($rows_provice)) {
         foreach ($rows_provice as $row) {
             $opt_commune[$row['com_id']] = $row['commune_name'];
         }
     }
     $commune_name = new Zend_Dojo_Form_Element_FilteringSelect('commune_name');
     $commune_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $commune_name->setMultiOptions($opt_commune);
     $commune_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => 'true', 'class' => 'fullside'));
     $popup_commune_name = new Zend_Dojo_Form_Element_FilteringSelect('popup_commune_name');
     $popup_commune_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $popup_commune_name->setMultiOptions($opt_commune);
     $rows_provice = $_db->getAllDistrict();
     $opt_province = array($this->tr->translate("SELECT_DISTRICT"));
     if (!empty($rows_provice)) {
         foreach ($rows_provice as $row) {
             $opt_province[$row['dis_id']] = $row['district_name'];
         }
     }
     $district_name = new Zend_Dojo_Form_Element_FilteringSelect('district_name');
     $district_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $_display = new Zend_Dojo_Form_Element_FilteringSelect('display');
     $_display->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $_display_opt = array(1 => $this->tr->translate("NAME_KHMER"), 2 => $this->tr->translate("NAME_EN"));
     $_display->setMultiOptions($_display_opt);
     $district_name->setMultiOptions($opt_province);
     $district_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => 'true', 'class' => 'fullside'));
     $rows_provice = $_db->getAllDistrict();
     $opt_province = array($this->tr->translate("SELECT_DISTRICT"));
     if (!empty($rows_provice)) {
         foreach ($rows_provice as $row) {
             $opt_province[$row['dis_id']] = $row['district_name'];
         }
     }
     $district_name = new Zend_Dojo_Form_Element_FilteringSelect('district_name');
     $district_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $district_name->setMultiOptions($opt_province);
     $district_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => 'true', 'class' => 'fullside'));
     $rows_provice = $_db->getAllProvince();
     $opt_province = array($this->tr->translate("SELECT_PROVINCE"));
     if (!empty($rows_provice)) {
         foreach ($rows_provice as $row) {
             $opt_province[$row['province_id']] = $row['province_en_name'];
         }
     }
     $_province = new Zend_Dojo_Form_Element_FilteringSelect('province_name');
     $_province->setMultiOptions($opt_province);
     $_province->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => 'true', 'class' => 'fullside', 'onchange' => 'filterDistrict();', 'invalidMessage' => false));
     $_province->setValue($request->getParam("province_name"));
     $_arr = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status = new Zend_Dojo_Form_Element_FilteringSelect("status");
     $_status->setMultiOptions($_arr);
     $_status->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => 'true', 'missingMessage' => 'Invalid Module!', 'class' => 'fullside'));
     $_fromdate = new Zend_Dojo_Form_Element_DateTextBox('from_date');
     $_fromdate->setAttribs(array('dojoType' => $this->date, 'class' => 'fullside', 'onchange' => 'CalculateDate();'));
     $_date = $request->getParam("start_date");
     if (empty($_date)) {
         $_date = date('Y-m-01');
     }
     $_fromdate->setValue($_date);
     $_todate = new Zend_Dojo_Form_Element_DateTextBox('to_date');
     $_todate->setAttribs(array('dojoType' => $this->date, 'class' => 'fullside'));
     $_date = $request->getParam("end_date");
     if (empty($_date)) {
         $_date = date("Y-m-d");
     }
     $_todate->setValue($_date);
     $id = new Zend_Form_Element_Hidden('id');
     if (!empty($data)) {
         $id->setValue($data['vill_id']);
         $village_name->setValue($data['village_name']);
         $village_namekh->setValue($data['village_namekh']);
         $_display->setValue($data['displayby']);
         $_province->setValue($data['pro_id']);
         $district_name->setValue($data['dis_id']);
         $commune_name->setValue($data['commune_id']);
         $_status->setValue($data['status']);
     }
     $this->addElements(array($_fromdate, $_todate, $_btn_search, $_status_search, $_title, $id, $commune_name, $popup_commune_name, $village_name, $district_name, $_province, $_status, $village_namekh, $_display));
     return $this;
 }
Example #7
0
	public function FrmAddClient($data=null){
		$_spouse = new Zend_Dojo_Form_Element_TextBox('spouse');
		$_spouse->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_releted = new Zend_Dojo_Form_Element_TextBox('relate_with');
		$_releted->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$clienttype_nameen= new Zend_Dojo_Form_Element_DateTextBox('clienttype_nameen');
		$clienttype_nameen->setAttribs(array('dojoType'=>'dijit.form.TextBox','class'=>'fullside'
		));
		$clienttype_namekh= new Zend_Dojo_Form_Element_DateTextBox('clienttype_namekh');
		$clienttype_namekh->setAttribs(array('dojoType'=>'dijit.form.TextBox','class'=>'fullside'
		));
		$dob_join_acc= new Zend_Dojo_Form_Element_DateTextBox('dob_join_acc');
		$dob_join_acc->setAttribs(array('dojoType'=>'dijit.form.DateTextBox','class'=>'fullside',
		));
		$_dob_Guarantor= new Zend_Dojo_Form_Element_DateTextBox('dob_guarantor');
		$_dob_Guarantor->setAttribs(array('dojoType'=>'dijit.form.DateTextBox','class'=>'fullside',
		));
		$_dob= new Zend_Dojo_Form_Element_DateTextBox('dob_client');
		$_dob->setAttribs(array('dojoType'=>'dijit.form.DateTextBox','class'=>'fullside',
		));
		
		
		$_relate_tel = new Zend_Dojo_Form_Element_TextBox('relate_tel');
		$_relate_tel->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_guarantor_tel = new Zend_Dojo_Form_Element_TextBox('guarantor_tel');
		$_guarantor_tel->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_guarantor_with = new Zend_Dojo_Form_Element_TextBox('guarantor_with');
		$_guarantor_with->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		
		$request=Zend_Controller_Front::getInstance()->getRequest();
		
		$_group = new Zend_Dojo_Form_Element_CheckBox('is_group');
		$_group->setAttribs(array(
				'dojoType'=>'dijit.form.CheckBox',
				'onClick'=>'getGroupCode();',
				));
		
		$_group_code = new Zend_Dojo_Form_Element_TextBox('group_code');
		$_group_code->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'readonly'=>'readonly',
				'style'=>'color:red;'
		));
		
// 		$db = new Application_Model_DbTable_DbGlobal();
// 		$id_client = $db->getNewClientId();
		
		$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
		$_branch_id->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'Onchange'=>'getFunction();'
		));
		$db = new Application_Model_DbTable_DbGlobal();
		$rows = $db->getAllBranchName();
		$options=array(''=>"---Select Branch Name---");
		if(!empty($rows))foreach($rows AS $row) $options[$row['br_id']]=$row['displayby']==1?$row['branch_namekh']:$row['branch_nameen'];
		$_branch_id->setMultiOptions($options);
	
		
		
		$_member = new Zend_Dojo_Form_Element_FilteringSelect('group_id');
		$_member->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'getGroupCode();'
		));
		$db = new Application_Model_DbTable_DbGlobal();
		$rows = $db->getClientByType(1);
		$options=array(''=>"---Select Group Name---");
		if(!empty($rows))foreach($rows AS $row) $options[$row['client_id']]=$row['name_en'];
		$_member->setMultiOptions($options);
		
		$_namekh = new Zend_Dojo_Form_Element_TextBox('name_kh');
		$_namekh->setAttribs(array(
						'dojoType'=>'dijit.form.ValidationTextBox',
						'class'=>'fullside',
						'required' =>'true'
		));
		
 		$id_client = $db->getNewClientId();
		$_clientno = new Zend_Dojo_Form_Element_TextBox('client_no');
		$_clientno->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'readonly'=>'readonly',
				'style'=>'color:red;'
		));
 		$_clientno->setValue($id_client);
	
		$_nameen = new Zend_Dojo_Form_Element_ValidationTextBox('name_en');
		$_nameen->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		$_join_with = new Zend_Dojo_Form_Element_TextBox('join_with');
		$_join_with->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_join_nation_id = new Zend_Dojo_Form_Element_TextBox('join_nation_id');
		$_join_nation_id->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_sex = new Zend_Dojo_Form_Element_FilteringSelect('sex');
		$_sex->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
		));
// 		$opt = array(1=>"Male",2=>"Femail");
		$opt_status = $db->getVewOptoinTypeByType(11,1);
		unset($opt_status[-1]);
		unset($opt_status['']);
		$_sex->setMultiOptions($opt_status);
		
		
		$_situ_status = new Zend_Dojo_Form_Element_FilteringSelect('situ_status');
		$_situ_status->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
		));
		$opt_status = $db->getVewOptoinTypeByType(5,1);
		unset($opt_status[-1]);
		unset($opt_status['']);
		$_situ_status->setMultiOptions($opt_status);
		
		$client_d_type = new Zend_Dojo_Form_Element_FilteringSelect('client_d_type');
		$client_d_type->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
		));
// 		$opt_client_d_type= $db->getVewOptoinTypeByType(23,1);
// 		$client_d_type->setMultiOptions($opt_client_d_type);
		
// 		$join_d_type = new Zend_Dojo_Form_Element_FilteringSelect('join_d_type');
// 		$join_d_type->setAttribs(array(
// 				'dojoType'=>'dijit.form.FilteringSelect',
// 				'class'=>'fullside',
// 		));
// 		$join_d_type->setMultiOptions($opt_client_d_type);
		
// 		$guarantor_d_type = new Zend_Dojo_Form_Element_FilteringSelect('guarantor_d_type');
// 		$guarantor_d_type->setAttribs(array(
// 				'dojoType'=>'dijit.form.FilteringSelect',
// 				'class'=>'fullside',
// 		));
// 		$guarantor_d_type->setMultiOptions($opt_client_d_type);
		
		$guarantor_address = new Zend_Dojo_Form_Element_TextBox('guarantor_address');
		$guarantor_address->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		///////////////////////////////////
		
		$_province = new Zend_Dojo_Form_Element_FilteringSelect('province');
		$_province->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'filterDistrict();',
				
		));
		
		$rows =  $db->getAllProvince();
		$options=array($this->tr->translate("SELECT_PROVINCE")); //array(''=>"------Select Province------",-1=>"Add New");
		if(!empty($rows))foreach($rows AS $row) $options[$row['province_id']]=$row['province_en_name'];
		$_province->setMultiOptions($options);
// 		$_province->setValue($request->getParam('province'));
		
		
		$_district = new Zend_Dojo_Form_Element_FilteringSelect('district');
// 		$rows =  $db->getAllDistrict();
// 		$options=array(''=>"------Select------",-1=>"Add New");
// 		if(!empty($rows))foreach($rows AS $row) $options[$row['dis_id']]=$row['district_name'];
// 		$_district->setMultiOptions($options);
		$_district->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'popupCheckDistrict();'
		));
		
		$_commune = new Zend_Dojo_Form_Element_FilteringSelect('commune');
// 		$rows =  $db->getCommune();
		$options=array(''=>"------Select------",-1=>"Add New");
// 		if(!empty($rows))foreach($rows AS $row) $options[$row['com_id']]=$row['commune_name'];
		$_commune->setMultiOptions($options);
		$_commune->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'popupCheckCommune();'
		));
		
		$_village = new Zend_Dojo_Form_Element_FilteringSelect('village');
		$_village->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true',
				'onchange'=>'popupCheckVillage();'
		));
		$rows =  $db->getVillage();
		$options=array(''=>"------Select------",-1=>"Add New");
		if(!empty($rows))foreach($rows AS $row) $options[$row['vill_id']]=$row['village_name'];
		$_village->setMultiOptions($options);
		
		$_house = new Zend_Dojo_Form_Element_TextBox('house');
		$_house->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside',
		));
		
		$_street = new Zend_Dojo_Form_Element_TextBox('street');
		$_street->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside',
				//'required' =>'true'
		));
		
// 		$_id_type = new Zend_Dojo_Form_Element_FilteringSelect('id_type');
// 		$_id_type->setAttribs(array(
// 				'dojoType'=>'dijit.form.FilteringSelect',
// 				'class'=>'fullside',
// 				'required' =>'true'
// 		));
// 		$rows =  $db->GetAllIDType();
// 		$_id_type->setMultiOptions($rows);
		
		$_id_no = new Zend_Dojo_Form_Element_TextBox('id_no');
		$_id_no->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		
		$_phone = new Zend_Dojo_Form_Element_TextBox('phone');
		$_phone->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_spouse = new Zend_Dojo_Form_Element_TextBox('spouse');
		$_spouse->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		$photo=new Zend_Form_Element_File('photo');
		$photo->setAttribs(array(
		));
		$job = new Zend_Dojo_Form_Element_TextBox('job');
		$job->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		$national_id=new Zend_Dojo_Form_Element_TextBox('national_id');
		$national_id->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				));
		
		$spouse_nationid=new Zend_Dojo_Form_Element_TextBox('spouse_nationid');
		$spouse_nationid->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		
		$chackcall = new Zend_Dojo_Form_Element_CheckBox('chackcall');
		$chackcall->setAttribs(array(
				'dojoType'=>'dijit.form.CheckBox',
				//'checked'=>'checked'
		));
// 		$_id=new Zend_Form_Element_Hidden('id');
		$_id = new Zend_Form_Element_Hidden("id");
		$_desc = new Zend_Dojo_Form_Element_TextBox('desc');
		$_desc->setAttribs(array('dojoType'=>'dijit.form.TextBox','class'=>'fullside',
				'style'=>'width:96%;min-height:50px;'));
		
		$_status=  new Zend_Dojo_Form_Element_FilteringSelect('status');
		$_status->setAttribs(array('dojoType'=>'dijit.form.FilteringSelect','class'=>'fullside',));
		$_status_opt = array(
				1=>$this->tr->translate("ACTIVE"),
				0=>$this->tr->translate("DACTIVE"));
		$_status->setMultiOptions($_status_opt);
		
// 		$_id = new Zend_Form_Element_Hidden('id');
		if($data!=null){
// 			print_r($data);
			$_branch_id->setValue($data['branch_id']);
			$_member->setValue($data['parent_id']);
			$_group->setValue($data['is_group']);
			$_namekh->setValue($data['name_kh']);
			$_nameen->setValue($data['name_en']);
			$_sex->setValue($data['sex']);
			$_situ_status->setValue($data['sit_status']);
			$_province->setValue($data['pro_id']);
			$_district->setValue($data['dis_id']);
			$_commune->setValue($data['com_id']);
			$_village->setValue($data['village_id']);
			$_house->setValue($data['house']);
			$_street->setValue($data['street']);
// 			$_id_type->setValue($data['id_type']);
			$_id_no->setValue($data['id_number']);
			$_phone->setValue($data['phone']);
			$_spouse->setValue($data['spouse_name']);
			$_desc->setValue($data['remark']);
			$_status->setValue($data['status']);
			$_clientno->setValue($data['client_number']);	
			$photo->setValue($data['photo_name']);
			$_id->setValue($data['client_id']);
			$_group_code->setValue($data['group_code']);
			$job->setValue($data['job']);
			$national_id->setValue($data['nation_id']);
			$spouse_nationid->setValue($data['spouse_nationid']);
			$_join_with->setValue($data['join_with']);
			$_join_nation_id->setValue($data['join_nation_id']);
			$_relate_tel->setValue($data['join_tel']);
			$_releted->setValue($data['relate_with']);
			$_guarantor_with->setValue($data['guarantor_with']);
			$_guarantor_tel->setValue($data['guarantor_tel']);
            $client_d_type->setValue($data['client_d_type']);
// 			$join_d_type->setValue($data['join_d_type']);
// 			$guarantor_d_type->setValue($data['guarantor_d_type']);
			$guarantor_address->setValue($data['guarantor_address']);

			$_dob_Guarantor->setValue($data['dob_guarantor']);
			$dob_join_acc->setValue($data['dob_join_acc']);
			$_dob->setValue($data['dob']);
// 			print_r($data);
		}
		$this->addElements(array($client_d_type,$guarantor_address,$_relate_tel,$_guarantor_tel,$_guarantor_with,$_releted,$_join_nation_id,$_join_with,$spouse_nationid,$_id,$photo,$_spouse,$job,$national_id,$chackcall,$_group_code,$_branch_id,$_member,$_group,$_namekh,$_nameen,$_sex,$_situ_status,
				$_province,$_district,$_commune,$_village,$_house,$_street,$_id_no,
				$_phone,$_spouse,$_desc,$_status,$_clientno,$_dob,$dob_join_acc,$_dob_Guarantor,$clienttype_namekh,$clienttype_nameen));
		return $this;
		
	}	
Example #8
0
 public function FrmCustomer($data = null)
 {
     $_dob = new Zend_Form_Element_Text('dob_client');
     $_dob->setValue(date("d-m-Y"));
     $_dob->setAttribs(array('class' => 'fullside', "style" => "width:100%"));
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $db = new Application_Model_DbTable_DbGlobal();
     $_namekh = new Zend_Form_Element_Text('name_kh');
     $_namekh->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $_clientno = new Zend_Form_Element_Text('client_no');
     $_clientno->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $id_client = $db->getNewClientId();
     $_clientno->setValue($id_client);
     $_nameen = new Zend_Form_Element_Text('name_en');
     $_nameen->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $_sex = new Zend_Form_Element_Select('sex');
     $_sex->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $opt_status = $db->getVewOptoinTypeByType(1, 1);
     unset($opt_status[-1]);
     unset($opt_status['']);
     $_sex->setMultiOptions($opt_status);
     $_situ_status = new Zend_Form_Element_Select('status');
     $_situ_status->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $home = new Zend_Form_Element_Text('home');
     $home->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $group_num = new Zend_Form_Element_Text('group_num');
     $group_num->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $i_group_num = new Zend_Form_Element_Text('igroup_num');
     $i_group_num->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $country = new Zend_Form_Element_Select('country');
     $country->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $row = $db->getAllCountry();
     $opt_country = array();
     if (!empty($row)) {
         foreach ($row as $rs) {
             $opt_country[$rs['id']] = $rs['country_name'];
         }
     }
     $country->setMultiOptions($opt_country);
     $state = new Zend_Form_Element_Text('state');
     $state->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $commune = new Zend_Form_Element_Text('commune');
     $commune->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $district = new Zend_Form_Element_Text('district');
     $district->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $icommune = new Zend_Form_Element_Text('zip');
     $icommune->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $city = new Zend_Form_Element_Text('city');
     $city->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $province = new Zend_Form_Element_Select('province');
     $province->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $opt = $db->getAllProvince(1);
     $province->setMultiOptions($opt);
     $_street = new Zend_Form_Element_Text('street');
     $_street->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $address1 = new Zend_Form_Element_Text('address1');
     $address1->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $_id_type = new Zend_Form_Element_Select('id_type');
     $_id_type->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $address = new Zend_Form_Element_Text('address');
     $address->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $_phone = new Zend_Form_Element_Text('phone');
     $_phone->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $photo = new Zend_Form_Element_File('photo');
     $photo->setAttribs(array());
     $job = new Zend_Form_Element_Text('job');
     $job->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $national_id = new Zend_Form_Element_Text('national_id');
     $national_id->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $email = new Zend_Form_Element_Text('email');
     $email->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $iemail = new Zend_Form_Element_Text('iemail');
     $iemail->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $fax = new Zend_Form_Element_Text('fax');
     $fax->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $balance = new Zend_Form_Element_Text('balance');
     $balance->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $_id = new Zend_Form_Element_Hidden("id");
     $_desc = new Zend_Form_Element_Text('desc');
     $_desc->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $_status = new Zend_Form_Element_Select('status');
     $_status->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $_status_opt = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status->setMultiOptions($_status_opt);
     $_title = new Zend_Form_Element_Select('title');
     $_title->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $_status_opt = array(1 => $this->tr->translate("Mr."), 2 => $this->tr->translate("Ms"), 3 => $this->tr->translate("Miss"));
     $_title->setMultiOptions($_status_opt);
     $customer_type = new Zend_Form_Element_Select('customer_type');
     $customer_type->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;'));
     $_status_opt = array(1 => $this->tr->translate("Self"), 2 => $this->tr->translate("Agency"));
     $customer_type->setMultiOptions($_status_opt);
     $nationality = new Zend_Form_Element_Text('nationality');
     $nationality->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $company_name = new Zend_Form_Element_Text('company_name');
     $company_name->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $passport = new Zend_Form_Element_Text('passport');
     $passport->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $p_issuedate = new Zend_Form_Element_Text('pissue_date');
     $p_issuedate->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $p_issuedate->setValue(date("Y-m-d"));
     $p_expireddate = new Zend_Form_Element_Text('pexpired_date');
     $p_expireddate->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $p_expireddate->setValue(date("Y-m-d"));
     $card_code = new Zend_Form_Element_Text('card_code');
     $card_code->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $c_issuedate = new Zend_Form_Element_Text('cissue_date');
     $c_issuedate->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $c_issuedate->setValue(date("Y-m-d"));
     $c_expireddate = new Zend_Form_Element_Text('cexpired_date');
     $c_expireddate->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $c_expireddate->setValue(date("Y-m-d"));
     $ftb = new Zend_Form_Element_Text('ftb');
     $ftb->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $f_issuedate = new Zend_Form_Element_Text('fissue_date');
     $f_issuedate->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $f_issuedate->setValue(date("Y-m-d"));
     $f_expireddate = new Zend_Form_Element_Text('fexpired_date');
     $f_expireddate->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $f_expireddate->setValue(date("Y-m-d"));
     $address2 = new Zend_Form_Element_Text('address2');
     $address2->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $in_city = new Zend_Form_Element_Text('i_city');
     $in_city->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $in_province = new Zend_Form_Element_Text('country');
     $in_province->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $in_zipcode = new Zend_Form_Element_Text('i_zipcode');
     $in_zipcode->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $in_phone = new Zend_Form_Element_Text('i_phone');
     $in_phone->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $in_note = new Zend_Form_Element_Text('i_note');
     $in_note->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $old_photo = new Zend_Form_Element_Hidden('old_photo');
     $ids = new Zend_Form_Element_Hidden('id');
     $loc_address = new Zend_Form_Element_Textarea("loc_add");
     $in_add = new Zend_Form_Element_Textarea("int_add");
     $fly_no = new Zend_Form_Element_Text("fly_no");
     $fly_no->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $fly_date = new Zend_Form_Element_Text("fly_date");
     $fly_date->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $fly_time = new Zend_Form_Element_Text("fly_time");
     $fly_time->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $fly_destination = new Zend_Form_Element_Text("fly_destination");
     $fly_destination->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $occupation = new Zend_Form_Element_Text('occupation');
     $occupation->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     $photo = new Zend_Form_Element_File('photo');
     $photo->setAttribs(array());
     $fax = new Zend_Form_Element_Text('fax');
     $fax->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style'));
     if ($data != null) {
         $home->setValue($data["house_num"]);
         $district->setValue($data["district"]);
         $ids->setValue($data['id']);
         $_title->setValue($data['title']);
         $_namekh->setValue($data['first_name']);
         $_nameen->setValue($data['last_name']);
         $_sex->setValue($data['sex']);
         $_clientno->setValue($data['customer_code']);
         $_dob->setValue(date("d-m-Y"), strtotime($data['dob']));
         $country->setValue($data['pob']);
         $nationality->setValue($data['nationality']);
         $company_name->setValue($data['company_name']);
         $_phone->setValue($data['phone']);
         $email->setValue($data['email']);
         $group_num->setValue($data['group_num']);
         $address->setValue($data['house_num']);
         $_street->setValue($data['street']);
         $commune->setValue($data['commune']);
         $province->setValue($data['province_id']);
         $address1->setValue($data["address1"]);
         $address2->setValue($data['address2']);
         $in_city->setValue($data['i_city']);
         $state->setValue($data['i_state']);
         $in_zipcode->setValue($data['i_zipcode']);
         $icommune->setValue($data['i_zipcode']);
         $in_phone->setValue($data['i_phone']);
         $city->setValue($data['i_city']);
         $fax->setValue($data['fax']);
         $national_id->setValue($data['nationality']);
         $occupation->setValue($data['occupation']);
     }
     $this->addElements(array($state, $fax, $photo, $occupation, $fly_date, $fly_destination, $fly_no, $fly_time, $iemail, $city, $icommune, $address1, $i_group_num, $home, $loc_address, $in_add, $old_photo, $ids, $in_note, $in_phone, $in_zipcode, $in_province, $in_city, $address2, $customer_type, $commune, $district, $province, $p_issuedate, $p_expireddate, $c_issuedate, $c_expireddate, $f_issuedate, $f_expireddate, $passport, $card_code, $ftb, $company_name, $nationality, $_title, $balance, $fax, $email, $group_num, $country, $_id, $photo, $job, $national_id, $_namekh, $_nameen, $_sex, $_situ_status, $_street, $_id_type, $address, $_phone, $_desc, $_status, $_clientno, $_dob));
     return $this;
 }
Example #9
0
 public function addPartner($data = NULL)
 {
     $_db = new Application_Model_DbTable_DbGlobal();
     $id = new Zend_Form_Element_Hidden('id');
     /* Form Elements & Other Definitions Here ... */
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
     $_title->setAttribs(array('dojoType' => $this->tvalidate, 'onkeyup' => 'this.submit()', 'placeholder' => $this->tr->translate("SEARCH INFO")));
     $_title->setValue($request->getParam("adv_search"));
     $_status_search = new Zend_Dojo_Form_Element_FilteringSelect('status_search');
     $_status_search->setAttribs(array('dojoType' => $this->filter));
     $_status_opt = array(-1 => $this->tr->translate("ALL"), 1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status_search->setMultiOptions($_status_opt);
     $_status_search->setValue($request->getParam("status_search"));
     $_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
     $_btn_search->setAttribs(array('dojoType' => 'dijit.form.Button', 'iconclass' => 'dijitIconSearch'));
     //////-------------------------------
     $mainbranch = new Zend_Dojo_Form_Element_FilteringSelect('main_branch');
     $mainbranch->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect'));
     $db = new Partner_Model_DbTable_DbPartner();
     $opt = $db->getNamePartnerparent(null, 1);
     $mainbranch->setMultiOptions($opt);
     $mainbranch->setValue($request->getParam('main_branch'));
     $rows_provice = $_db->getAllProvince();
     $opt_province = "";
     $opt_province = array('-1' => "------Select Province------");
     if (!empty($rows_provice)) {
         foreach ($rows_provice as $row) {
             $opt_province[$row['id']] = $row['name'];
         }
     }
     $province_name = new Zend_Dojo_Form_Element_FilteringSelect('province_name');
     $province_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'onchange' => 'filterDistrict();'));
     $province_name->setMultiOptions($opt_province);
     $province_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => 'true'));
     //------------------------------------------------------------------------
     $branchname = new Zend_Dojo_Form_Element_ValidationTextBox('branch_name');
     $branchname->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'required' => true));
     $cade_number = new Zend_Dojo_Form_Element_TextBox('cade_number');
     $cade_number->setAttribs(array('dojoType' => 'dijit.form.TextBox'));
     $partnername = new Zend_Dojo_Form_Element_TextBox('partner_name');
     $partnername->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'Required' => true));
     $photo = new Zend_Form_Element_File('photo');
     $photo->setAttribs(array());
     $id_accournnumber = $db->getNewAccountNumber(1);
     $accournnumber = new Zend_Dojo_Form_Element_TextBox('account_number');
     $accournnumber->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'readonly' => 'readonly', 'style' => 'color:red;'));
     $accournnumber->setValue($id_accournnumber);
     $Address = new Zend_Dojo_Form_Element_TextBox('address');
     $Address->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox'));
     $homenumber = new Zend_Dojo_Form_Element_TextBox('home_number');
     $homenumber->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox'));
     $groupnumber = new Zend_Dojo_Form_Element_TextBox('group_number');
     $groupnumber->setAttribs(array('dojoType' => 'dijit.form.TextBox'));
     $streetnumber = new Zend_Dojo_Form_Element_TextBox('street_number');
     $streetnumber->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox'));
     $communnumber = new Zend_Dojo_Form_Element_ValidationTextBox('commun_number');
     $communnumber->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'required' => true));
     $phonenumber = new Zend_Dojo_Form_Element_TextBox('phone_number');
     $phonenumber->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox'));
     $faxnumber = new Zend_Dojo_Form_Element_TextBox('fax_number');
     $faxnumber->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox'));
     $salephone = new Zend_Dojo_Form_Element_TextBox('sele_phone');
     $salephone->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox'));
     $status = new Zend_Dojo_Form_Element_FilteringSelect('status');
     $status->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect'));
     $opt = array(1 => 'ប្រើប្រាស់', 0 => 'មិនបានប្រើប្រាស់');
     $status->setMultiOptions($opt);
     $note = new Zend_Dojo_Form_Element_SimpleTextarea('note');
     $note->setAttribs(array('dojoType' => 'dijit.form.SimpleTextarea'));
     $money_usa = new Zend_Dojo_Form_Element_NumberTextBox('money_usa');
     $money_usa->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'required' => true));
     $money_usa->setValue(0);
     $money_bath = new Zend_Dojo_Form_Element_NumberTextBox('money_bath');
     $money_bath->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'Required' => true));
     $money_bath->setValue(0);
     $money_real = new Zend_Dojo_Form_Element_NumberTextBox('money_riel');
     $money_real->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'Required' => true));
     $money_real->setValue(0);
     $status_getmoney = new Zend_Dojo_Form_Element_FilteringSelect('status_getmoney');
     $status_getmoney->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect'));
     $opt_status = array(1 => 'ដៃគូមេ', 2 => 'ដៃគូកូន');
     $status_getmoney->setMultiOptions($opt_status);
     $status_tran = new Zend_Dojo_Form_Element_FilteringSelect('tran_type');
     $status_tran->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect'));
     $status_option = array(1 => 'ប្រើប្រាស់សាច់ប្រាក់', 2 => 'ទូទាត់ខាងក្រៅ');
     $status_tran->setMultiOptions($status_option);
     $date = new Zend_Dojo_Form_Element_DateTextBox('date');
     $date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox'));
     $date->setValue(date('Y-m-d'));
     $from_date = new Zend_Dojo_Form_Element_DateTextBox('start_date');
     $from_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'required' => 'true', 'class' => 'fullside', 'onchange' => 'CalculateDate();'));
     $_date = $request->getParam("start_date");
     if (empty($_date)) {
         $_date = date('Y-m-01');
     }
     $from_date->setValue($_date);
     $to_date = new Zend_Dojo_Form_Element_DateTextBox('end_date');
     $to_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'required' => 'true', 'class' => 'fullside'));
     $_date = $request->getParam("end_date");
     if (empty($_date)) {
         $_date = date("Y-m-d");
     }
     $to_date->setValue($_date);
     if ($data != null) {
         $mainbranch->setValue($data['parent']);
         $branchname->setValue($data['partner_brand']);
         //$sub_branch->setValue($data['partner_brand']);
         $partnername->setValue($data['partner_name']);
         $accournnumber->setValue($data['account_no']);
         $cade_number->setValue($data['nation_id']);
         $homenumber->setValue($data['house_no']);
         $groupnumber->setValue($data['group_no']);
         $streetnumber->setValue($data['street']);
         //    		$commune_name->setValue($data['commune']);
         //     		$districtnumber->setValue($data['district']);
         //     		$provicenumber->setValue($data['province']);
         $province_name->setValue($data['province']);
         //    		$district_name->setValue($data['district']);
         $faxnumber->setValue($data['tel']);
         $salephone->setValue($data['mobile']);
         $note->setValue($data['note']);
         $money_usa->setValue($data['cash_dollar']);
         $money_bath->setValue($data['cash_bath']);
         $money_real->setValue($data['cash_riel']);
         $status_tran->setValue($data['is_cashoperation']);
         $Address->setValue($data['address']);
         $date->setValue($data['date']);
         $id->setValue($data['id']);
         $status->setValue($data['status']);
     }
     $this->addElements(array($id, $_title, $_status_search, $_btn_search, $date, $to_date, $from_date, $branchname, $partnername, $photo, $Address, $accournnumber, $homenumber, $groupnumber, $streetnumber, $communnumber, $phonenumber, $faxnumber, $salephone, $note, $status, $cade_number, $mainbranch, $money_usa, $money_bath, $money_real, $status_tran, $status_getmoney, $province_name));
     return $this;
 }
Example #10
0
 /**
  * Generate navigation for use global
  * @author channy
  * @param $url current of action
  * @param $frm form for use cover of control 
  * @param $limit number of limit record
  * @return $record_count number of record
  */
 public function getAllProvinceOption()
 {
     $_db = new Application_Model_DbTable_DbGlobal();
     $rows = $_db->getAllProvince();
     $options = '<option value="-1" >' . htmlspecialchars('Please Select Province', ENT_QUOTES) . '</option>';
     if (!empty($rows)) {
         foreach ($rows as $value) {
             $options .= '<option value="' . $value['id'] . '" >' . htmlspecialchars($value['province_name'], ENT_QUOTES) . '</option>';
         }
     }
     return $options;
 }