Esempio n. 1
0
 public function indexAction()
 {
     try {
         $db = new Other_Model_DbTable_Dbvillage();
         if ($this->getRequest()->isPost()) {
             $search = $this->getRequest()->getPost();
         } else {
             $search = array('adv_search' => '', 'search_status' => -1, 'province_name' => 0, 'district_name' => '', 'commune_name' => '');
         }
         $rs_rows = $db->getAllVillage($search);
         $glClass = new Application_Model_GlobalClass();
         $rs_rows = $glClass->getImgActive($rs_rows, BASE_URL, true, null, 1);
         $list = new Application_Form_Frmtable();
         $collumns = array("VILLAGENAME_KH", "VILLAGE_NAME", "DISPLAY_BY", "COMMNUE_NAME", "DISTRICT_NAME", "PROVINCE_NAME", "DATE", "STATUS", "BY");
         $link = array('module' => 'other', 'controller' => 'village', 'action' => 'edit');
         $this->view->list = $list->getCheckList(0, $collumns, $rs_rows, array('village_name' => $link, 'village_namekh' => $link));
     } catch (Exception $e) {
         Application_Form_FrmMessage::message("Application Error");
         echo $e->getMessage();
         Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
     }
     $frm = new Other_Form_FrmVillage();
     $frm = $frm->FrmAddVillage();
     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();
     $this->view->result = $search;
 }
Esempio n. 2
0
      function getAllvillageAction(){
		if($this->getRequest()->isPost()){
			$data = $this->getRequest()->getPost();
			$db = new Other_Model_DbTable_Dbvillage();
			$rows = $db->getAllvillagebyCommune($data['commune_id']);
			array_unshift($rows, array ( 'id' => -1, 'name' => 'បន្ថែម​អ្នក​ទទួល​ថ្មី') );
			print_r(Zend_Json::encode($rows));
			exit();
		}
	}