示例#1
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;
 }
示例#2
0
  function  rptVillageAction(){
  	$db  = new Report_Model_DbTable_DbParamater();
  
  	$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' => '',
  				'search_status' => -1,
  				'province_name'=>0,
  				'district_name'=>'',
  				'commune_name'=>'');
  	}
  	$this->view->village_list = $db->getAllVillage($search);
  	$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;
  }
示例#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();
 }
示例#4
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();
		
	}