Ejemplo n.º 1
0
 public function indexAction()
 {
     try {
         $db = new Other_Model_DbTable_DbZone();
         if ($this->getRequest()->isPost()) {
             $search = $this->getRequest()->getPost();
         } else {
             $search = array('adv_search' => '', 'search_status' => -1);
         }
         $rs_rows = $db->getAllZoneArea($search);
         $glClass = new Application_Model_GlobalClass();
         $rs_rows = $glClass->getImgActive($rs_rows, BASE_URL, true);
         $list = new Application_Form_Frmtable();
         $collumns = array("ZONE_NAME", "ZONE_NUMBER", "DATE", "STATUS", "BY");
         $link = array('module' => 'other', 'controller' => 'zone', 'action' => 'edit');
         $this->view->list = $list->getCheckList(0, $collumns, $rs_rows, array('zone_name' => $link, 'zone_num' => $link));
     } catch (Exception $e) {
         Application_Form_FrmMessage::message("Application Error");
         echo $e->getMessage();
         Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
     }
     $frm = new Other_Form_FrmZone();
     $frm_co = $frm->FrmAddZone();
     Application_Model_Decorator::removeAllDecorator($frm_co);
     $this->view->frm_zone = $frm_co;
     $db = new Application_Model_DbTable_DbGlobal();
     $this->view->district = $db->getAllDistricts();
     $this->view->commune_name = $db->getCommune();
     $this->view->result = $search;
 }
Ejemplo n.º 2
0
 function  rptVillageAction(){
 	$db  = new Report_Model_DbTable_DbParamater();
 	$this->view->village_list = $db->getAllVillage();
 	//print_r($db->getAllstaff());
 	$key = new Application_Model_DbTable_DbKeycode();
 	$this->view->data=$key->getKeyCodeMiniInv(TRUE);
 	if($this->getRequest()->isPost()){
 		$search = $this->getRequest()->getPost();
 		//
 		if(isset($search['btn_search'])){
 			//print_r($search);exit();
 			$this->view->village_list = $db->getAllVillage($search);
 		}else{
 		$collumn = array("vill_id","village_namekh","village_name","displayby","commune_name","district_name","province_en_name","modify_date","status","user_name");
 		$this->exportFileToExcel('ln_village',$db->getAllVillage(),$collumn);
 		} 		
 	}else {
 		$search = array('adv_search' => '',
 				'search_status' => -1,
 				'province_name'=>0,
 				'district_name'=>'',
 				'commune_name'=>'');
 	}
 	$frm = new Other_Form_FrmVillage();
 	$frms = $frm->FrmAddVillage();
 	Application_Model_Decorator::removeAllDecorator($frms);
 	$this->view->frm_village= $frms;
 	
 	$db= new Application_Model_DbTable_DbGlobal();
 	$this->view->district = $db->getAllDistricts();
 	$this->view->commune_name = $db->getCommune();
 	$this->view->result = $search;
 }
Ejemplo n.º 3
0
 public function editAction()
 {
     $db = new Other_Model_DbTable_DbVillage();
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         try {
             $db->addVillage($_data);
             Application_Form_FrmMessage::Sucessfull("ការ​បញ្ចូល​ជោគ​ជ័យ !", '/other/Village');
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("ការ​បញ្ចូល​មិន​ជោគ​ជ័យ");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam("id");
     $row = $db->getVillageById($id);
     $this->view->row = $row;
     if (empty($row)) {
         $this->_redirect('other/Village');
     }
     $fm = new Other_Form_FrmVillage();
     $frm = $fm->FrmAddVillage($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm_village = $frm;
     $db = new Application_Model_DbTable_DbGlobal();
     $this->view->district = $db->getAllDistricts();
     $this->view->commune_name = $db->getCommune();
 }
Ejemplo n.º 4
0
 public function FrmAddVillage($data = null)
 {
     $village_name = new Zend_Dojo_Form_Element_TextBox('village_name');
     $village_name->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'required' => 'true', 'missingMessage' => 'Invalid Module!', 'class' => 'fullside'));
     $village_namekh = new Zend_Dojo_Form_Element_TextBox('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 = "";
     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_ENGLISH"));
     $_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 = "";
     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 = "";
     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'));
     $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($id, $commune_name, $popup_commune_name, $village_name, $district_name, $_province, $_status, $village_namekh, $_display));
     return $this;
 }
Ejemplo n.º 5
0
 public function editAction()
 {
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         $db_partner = new Partner_Model_DbTable_DbPartner();
         try {
             if ($this->getRequest()->getParam("btn_save_close")) {
                 //print_r($data);exit();
                 $db = $db_partner->getupdatePartner($data);
                 Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', '/partner/');
             }
         } catch (Exception $e) {
             echo $e->getMessage();
             $this->view->msg = 'ការ​បញ្ចូល​មិន​ជោគ​ជ័យ';
         }
     }
     $db_partner = new Partner_Model_DbTable_DbPartner();
     $id = $this->getRequest()->getParam('id');
     $row = $db_partner->getPartnerById($id);
     $this->view->row = $row;
     $this->view->photo = $row['photo'];
     $pructis = new Partner_Form_FrmPartner();
     $frm = $pructis->addPartner($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $form = $this->view->frm = $frm;
     $db = new Application_Model_DbTable_DbGlobal();
     $this->view->district = $db->getAllDistricts();
     $this->view->commune_name = $db->getCommune();
     $this->view->village_name = $db->getVillage();
 }
Ejemplo n.º 6
0
  function rptClientAction($table='ln_account_name'){
   
  	$key = new Application_Model_DbTable_DbKeycode();
  	$this->view->data=$key->getKeyCodeMiniInv(TRUE);
  	if($this->getRequest()->isPost()){  		
  		$search = $this->getRequest()->getPost();
  	}else{
  		$search = array('adv_search' => '',
						'status' => -1,
  						'branch_id' => 0,  				
						'province'=>0,
						'district'=>'',
						'commune'=>'',
						'village'=>'',
						'start_date'=> date('Y-m-d'),
						'end_date'=>date('Y-m-d'));
  	}	
  
  	$this->view->result=$search;
  	 
  	$db  = new Report_Model_DbTable_DbLnClient();
  	$this->view->client_list =$db->getAllLnClient($search);
  	
  	$frm = new Application_Form_FrmAdvanceSearch();
  	$frm = $frm->AdvanceSearch();
  	Application_Model_Decorator::removeAllDecorator($frm);
  	$this->view->frm_search = $frm;
  	
  	$fm = new Group_Form_FrmClient();
  	$frm = $fm->FrmAddClient();
  	Application_Model_Decorator::removeAllDecorator($frm);
  	$this->view->frm_client = $frm;
  	$db= new Application_Model_DbTable_DbGlobal();
  	$this->view->district = $db->getAllDistricts();
  	$this->view->commune = $db->getCommune();
  	$this->view->village = $db->getVillage();
  	
  	
  }
Ejemplo n.º 7
0
	public function editAction(){
		$db = new Other_Model_DbTable_DbVillage();
		if($this->getRequest()->isPost()){
			$_data = $this->getRequest()->getPost();
			try{
				$db->addVillage($_data);
				Application_Form_FrmMessage::Sucessfull($this->tr->translate('EDIT_SUCCESS'),self::REDIRECT_URL . '/Village/index');
			}catch(Exception $e){
				Application_Form_FrmMessage::message($this->tr->translate('EDIT_FAIL'));
				$err =$e->getMessage();
				Application_Model_DbTable_DbUserLog::writeMessageError($err);
			}
		}
		$id = $this->getRequest()->getParam("id");
		$row = $db->getVillageById($id);
		$this->view->row=$row;
		if(empty($row)){
			$this->_redirect('other/Village');
		}		
		$fm = new Other_Form_FrmVillage();
		$frm = $fm->FrmAddVillage($row);
		Application_Model_Decorator::removeAllDecorator($frm);
		$this->view->frm_village = $frm;
		
		$db= new Application_Model_DbTable_DbGlobal();
		$this->view->district = $db->getAllDistricts();
		$this->view->commune_name = $db->getCommune();
		
	}
Ejemplo n.º 8
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;
 }
Ejemplo n.º 9
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;
 }
Ejemplo n.º 10
0
	public function indexAction(){
		try{
			$db = new Group_Model_DbTable_DbClient();
			if($this->getRequest()->isPost()){
				$formdata=$this->getRequest()->getPost();
				$search = array(
						'adv_search' => $formdata['adv_search'],
						'province_id'=>$formdata['province'],
						'comm_id'=>$formdata['commune'],
						'district_id'=>$formdata['district'],
						'village'=>$formdata['village'],
						'status'=>$formdata['status'],
						'start_date'=> $formdata['start_date'],
						'end_date'=>$formdata['end_date']
						);
			}
			else{
				$search = array(
						'adv_search' => '',
						'status' => -1,
						'province_id'=>0,
						'district_id'=>'',
						'comm_id'=>'',
						'village'=>'',
						'start_date'=> date('Y-m-d'),
						'end_date'=>date('Y-m-d'));
			}
			
			$rs_rows= $db->getAllClients($search);
			$glClass = new Application_Model_GlobalClass();
			$rs_rows = $glClass->getImgActive($rs_rows, BASE_URL, true);
			$list = new Application_Form_Frmtable();
			$collumns = array("BRANCH_NAME","CUSTOMER_CODE","CLIENTNAME_KH","CLIENTNAME_EN","SEX","PHONE","HOUSE","STREET","VILLAGE","SPOUSE_NAME",
					"DATE","BY_USER","STATUS");
			$link=array(
					'module'=>'group','controller'=>'index','action'=>'edit',
			);
			$link1=array(
					'module'=>'group','controller'=>'index','action'=>'view',
			);
			$this->view->list=$list->getCheckList(0, $collumns, $rs_rows,array('branch_name'=>$link1,'client_number'=>$link,'name_kh'=>$link,'name_en'=>$link));
		}catch (Exception $e){
			Application_Form_FrmMessage::message("Application Error");
			Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
		}
	
		$frm = new Application_Form_FrmAdvanceSearch();
		$frm = $frm->AdvanceSearch();
		Application_Model_Decorator::removeAllDecorator($frm);
		$this->view->frm_search = $frm;
		
		$fm = new Group_Form_FrmClient();
		$frm = $fm->FrmAddClient();
		Application_Model_Decorator::removeAllDecorator($frm);
		$this->view->frm_client = $frm;
		$db= new Application_Model_DbTable_DbGlobal();
		$this->view->district = $db->getAllDistricts();
		$this->view->commune_name = $db->getCommune();
		$this->view->village_name = $db->getVillage();
		
		$this->view->result=$search;	
	}
Ejemplo n.º 11
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 = 
		
// 		);
		//
		$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',
		));
		$opt_join_d_type= $db->getVewOptoinTypeByType(23,1);
		$join_d_type->setMultiOptions($opt_join_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',
		));
		$opt_guarantor_d_type= $db->getVewOptoinTypeByType(23,1);
		$guarantor_d_type->setMultiOptions($opt_guarantor_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_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){
// 			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,$join_d_type,$guarantor_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_type,$_id_no,
				$_phone,$_spouse,$_desc,$_status,$_clientno,$_dob,$dob_join_acc,$_dob_Guarantor,$clienttype_namekh,$clienttype_nameen));
		return $this;
		
	}	
Ejemplo n.º 12
0
	public function editAction(){
		
		$db = new Group_Model_DbTable_DbClient();
		
		if($this->getRequest()->isPost()){
			try{
				$data = $this->getRequest()->getPost();
				//print_r($data);exit();
				$id= $db->addClient($data);
				if($data['chackcall']==1){
					Application_Form_FrmMessage::message("វានឹងបន្ថែមទ្រព្យបញ្ចាំរបស់អតិថិជនដោយស្វ័យប្រវត្តិ!");
				//	Application_Form_FrmMessage::redirectUrl("/group/Callteral/add/id/".$id);
				}
				//Application_Form_FrmMessage::redirectUrl("/group/index");
				//$db->addClient($data);
				//Application_Form_FrmMessage::Sucessfull('EDIT_SUCCESS',"/group/index");
			}catch (Exception $e){
				Application_Form_FrmMessage::message("EDIT_FAILE");
				echo $e->getMessage();
				Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
			}
		}
		$id = $this->getRequest()->getParam("id");
		$row = $db->getClientById($id);
	    $this->view->row=$row;
		$this->view->photo = $row['photo_name'];
		if(empty($row)){
			$this->_redirect("/group/Client");
		}
		$fm = new Group_Form_FrmClient();
		$frm = $fm->FrmAddClient($row);
		Application_Model_Decorator::removeAllDecorator($frm);
		$this->view->frm_client = $frm;
		
		$db= new Application_Model_DbTable_DbGlobal();
		$this->view->district = $db->getAllDistricts();
		$this->view->commune_name = $db->getCommune();
		$this->view->village_name = $db->getVillage();
	}