public function editAction()
 {
     $_dbmodel = new Accounting_Model_DbTable_DbGeneraljurnal();
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         try {
             $_db = new Accounting_Model_DbTable_DbJournal();
             $_db->upDateJournal($_data);
             Application_Form_FrmMessage::Sucessfull("INSERT_SUCCESS", "/accounting/generaljurnal");
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("INSERT_FAIL");
             Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
         }
     }
     $id = $this->getRequest()->getParam('id');
     $row = $_dbmodel->getjurnalEntryById($id);
     $this->view->jdetail = $_dbmodel->getjurnalEntryDetail($id);
     $fm = new Accounting_Form_FrmGeneraljurnal();
     $frm = $fm->FrmGeneraljurnal($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm_fixedasset = $frm;
     $db = new Accounting_Model_DbTable_DbJournal();
     $this->view->row_parents = $db->getAllParrentAccount(1);
     $this->view->row_accountname = $db->getAllParrentAccount(1, 1);
 }
Beispiel #2
0
 public function editAction()
 {
     $id = $this->getRequest()->getParam('id');
     $db = new Other_Model_DbTable_DbCommune();
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         //print_r($_data);exit();
         try {
             $db->addCommune($_data, $id);
             Application_Form_FrmMessage::Sucessfull($this->tr->translate("EDIT_SUCCESS"), self::REDIRECT_URL . '/commune/');
         } catch (Exception $e) {
             Application_Form_FrmMessage::message($this->tr->translate("EDIT_FAIL"));
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $row = $db->getCommuneById($id);
     $this->view->row = $row;
     $fm = new Other_Form_FrmCommune();
     $frm = $fm->FrmAddCommune($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm_commune = $frm;
     $db = new Application_Model_DbTable_DbGlobal();
     $this->view->district = $db->getAllDistricts();
 }
 public function indexAction()
 {
     try {
         $db = new Tellerandexchange_Model_DbTable_DbSpread();
         if ($this->getRequest()->isPost()) {
             $search = $this->getRequest()->getPost();
         } else {
             $search = array('client_id' => -1, 'status' => -1, 'from_date' => date('Y-m-d'), 'to_date' => date('Y-m-d'));
         }
         $rs_rows = $db->getAllSpreadList($search);
         $glClass = new Application_Model_GlobalClass();
         $rs_rows = $glClass->getImgActive($rs_rows, BASE_URL, true);
         $list = new Application_Form_Frmtable();
         $collumns = array("ពីប្រាក់", "ទៅប្រាក់", "ទិញចូល", "លក់ចេញ", "អត្រាកណ្តាល", "កាលបរិច្ឆេទ", "STATUS");
         $link = array('module' => 'tellerandexchange', 'controller' => 'Spread', 'action' => 'edit');
         $this->view->list = $list->getCheckList(0, $collumns, $rs_rows, array('buy_type' => $link, 'sell_type' => $link, 'rate_in' => $link, 'rate_out' => $link));
     } catch (Exception $e) {
         Application_Form_FrmMessage::message("Application Error");
         echo $e->getMessage();
         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;
 }
 function editAction()
 {
     $db = new Global_Model_DbTable_DbGroup();
     if ($this->getRequest()->isPost()) {
         try {
             $data = $this->getRequest()->getPost();
             $db->AddNewGroup($data);
             if (!empty($data['save_close'])) {
                 Application_Form_FrmMessage::Sucessfull("ការ​បញ្ចូល​ជោគ​ជ័យ !", '/global/group');
             }
             Application_Form_FrmMessage::message("ការ​បញ្ចូល​ជោគ​ជ័យ !");
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("ការ​បញ្ចូល​មិន​ជោគ​ជ័យ");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam("id");
     $this->view->row = $db->getGroupById($id);
     $db = new Application_Model_DbTable_DbGlobal();
     $this->view->degree = $db->getAllDegree();
     $faculty = $db->getAllMajor();
     array_unshift($faculty, array('id' => -1, 'name' => 'Add New'));
     $this->view->faculty = $faculty;
     $room = $db->getAllRoom();
     array_unshift($room, array('id' => -1, 'name' => 'Add New'));
     $this->view->room = $room;
     $db = new Application_Model_GlobalClass();
     $this->view->subject_opt = $db->getTeachersunjectOption();
     $tsub = new Global_Form_FrmTeacher();
     $frm_techer = $tsub->FrmTecher();
     Application_Model_Decorator::removeAllDecorator($frm_techer);
     $this->view->frm_techer = $frm_techer;
 }
Beispiel #5
0
 function editAction()
 {
     $db_deposite = new Capital_Model_DbTable_DbCapital();
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         try {
             if (isset($_data["save"])) {
                 $db_deposite->updateCapital($_data);
                 Application_Form_FrmMessage::Sucessfull("ការ​បញ្ចូល​ជោគ​ជ័យ !", '/capital/capital/add');
             } elseif (isset($_data["save_close"])) {
                 $db_deposite->updateCapital($_data);
                 Application_Form_FrmMessage::Sucessfull("ការ​បញ្ចូល​ជោគ​ជ័យ !", '/capital/capital');
             } else {
                 Application_Form_FrmMessage::redirectUrl("/capital/capital");
             }
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("ការ​បញ្ចូល​មិន​ជោគ​ជ័យ");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam("id");
     $row = $db_deposite->getpartnerById($id);
     $deposite = new Capital_Form_FrmCapitale();
     $frm = $deposite->frmCapital($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm = $frm;
 }
Beispiel #6
0
 public function editAction()
 {
     $db_model = new Driverguide_Model_DbTable_Dbvehicleprice();
     $id = $this->getRequest()->getParam('id');
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         $db = new Driverguide_Model_DbTable_DbTaxiprice();
         try {
             if (!empty($data['save_close'])) {
                 $db->updateVehicletaxi($data);
                 Application_Form_FrmMessage::Sucessfull("INSERT_SUCCESSS", "/driverguide/taxiprice");
             }
         } catch (Exception $e) {
             //echo $e->getMessage();exit();
             Application_Form_FrmMessage::message("Application Error");
             Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
         }
     }
     $db = new Application_Model_GlobalClass();
     $this->view->pro_option = $db->getAllLocationOption();
     $db = new Application_Model_DbTable_DbGlobal();
     $this->view->rs_tax = $db->getAllTax();
     $this->view->vehicle = $db_model->getVehecleName();
     $db = new Driverguide_Model_DbTable_DbTaxiprice();
     $row = $this->view->row_taxi = $db->getVehicleTaxiById($id);
     //print_r($row);exit();
 }
Beispiel #7
0
  function addAction()
  {
		if($this->getRequest()->isPost()){
			$_data = $this->getRequest()->getPost();
			try {
				$_dbmodel = new Loan_Model_DbTable_DbLoanIL();
				$_dbmodel->addNewLoanIL($_data);
// 				Application_Form_FrmMessage::Sucessfull("INSERT_SUCCESS","/loan/index/index");
			}catch (Exception $e) {
				echo $err =$e->getMessage();exit();
				Application_Form_FrmMessage::message("INSERT_FAIL");
				$err =$e->getMessage();
				Application_Model_DbTable_DbUserLog::writeMessageError($err);
			}
		}
		$frm = new Loan_Form_FrmLoan();
		$frm_loan=$frm->FrmAddLoan();
		Application_Model_Decorator::removeAllDecorator($frm_loan);
		$this->view->frm_loan = $frm_loan;
		$frmpopup = new Application_Form_FrmPopupGlobal();
		$this->view->frmpupopclient = $frmpopup->frmPopupClient();
		$this->view->frmPopupCO = $frmpopup->frmPopupCO();
		$this->view->frmPopupZone = $frmpopup->frmPopupZone();
		$this->view->frmPopupCommune = $frmpopup->frmPopupCommune();
		$this->view->frmPopupDistrict = $frmpopup->frmPopupDistrict();
		$this->view->frmPopupVillage = $frmpopup->frmPopupVillage();
		
		
		
		
		
		
	}	
 public function editAction()
 {
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         $db = new Menu_Model_DbTable_DbCombo();
         try {
             $db->updateMenuCombo($_data);
             if (!empty($_data['btnsaveclose'])) {
                 Application_Form_FrmMessage::message('កាកែរប្រែបាន​​ជោគ​ជ័យ');
             } else {
                 Application_Form_FrmMessage::Sucessfull('កាកែរប្រែបាន​​ជោគ​ជ័យ', self::REDIRECT_URL . '/index');
             }
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("កាកែរប្រែមិន​បាន​​ជោគ​ជ័យ");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam("id");
     $db_combo_type = new Menu_Model_DbTable_DbCombo();
     $row = $db_combo_type->editAllRowCombo($id);
     $this->view->rows = $row;
     $frm = new Menu_Form_FrmMenuCombo();
     $this->view->form = $frm->FrmMenu($row);
 }
	public function editAction()
	{
		$db = new Group_Model_DbTable_DbReturnCollteral();
		if($this->getRequest()->isPost()){
			$data=$this->getRequest()->getPost();
		try {
				$db->updateReturnCollteral($data);
				Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', self::REDIRECT_URL . '/Returncollteral/index');
			} catch (Exception $e) {
				$this->view->msg = 'ការ​បញ្ចូល​មិន​ជោគ​ជ័យ';
			}
		}
		
		$id = $this->getRequest()->getParam('id');
		if(empty($id)){
			Application_Form_FrmMessage::Sucessfull($this->tr->translate('EDIT_SUCCESS'), self::REDIRECT_URL);
		}
		$row  = $db->getReturnCollteralbyid($id);
		$this->view->row = $row;
		$this->view->rows = $db->getAllReturnCollateralDetail($id);
		
		$fm = new Group_Form_Frmchangecollteral();
		$frm = $fm->FrmChangeCollteral($row);
		Application_Model_Decorator::removeAllDecorator($frm);
		$this->view->frm_changeCollteral = $frm;
		
		$db = new Application_Model_DbTable_DbGlobal();
		$this->view->allclient = $db->getAllClient();
		$this->view->allclient_number = $db->getAllClientNumber();
		$db = new Application_Model_GlobalClass();
		$this->view->collect_option = $db->getCollecteralOption();
		$this->view->owner_type = $db->getCollecteralTypeOption();
		
    }
 public function updateCustomerAction()
 {
     if ($this->getRequest()->isPost()) {
         try {
             $post = $this->getRequest()->getPost();
             $customer = new sales_Model_DbTable_DbCustomer();
             $customer->updateCustomer($post);
             $this->_redirect('/sales/customer/index');
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("Update customer failed !");
         }
     }
     $id = $this->getRequest()->getParam('id') ? $this->getRequest()->getParam('id') : '0';
     $sql = "SELECT c.customer_id,c.type_price,c.cust_name, c.add_remark, c.contact_name,c.add_name, c.phone, \n\t\t\t\t\tc.fax,c.email, c.website,c.customer_remark,c.is_active\n\t\t\t\t\tFROM tb_customer AS c,tb_price_type as tp\n\t\t\t\t\tWHERE tp.type_id=c.type_price\n\t\t\t\t\tAND c.customer_id = " . $id . " LIMIT 1";
     $db = new Application_Model_DbTable_DbGlobal();
     $row = $db->getGlobalDbRow($sql);
     // lost item info
     $formStock = new sales_Form_FrmVendor($row);
     $formStockEdit = $formStock->AddCustomerForm($row);
     Application_Model_Decorator::removeAllDecorator($formStockEdit);
     // omit default zend html tag
     $this->view->customer_frm = $formStockEdit;
     //control action
     $formControl = new Application_Form_FrmAction(null);
     $formViewControl = $formControl->AllAction(null);
     Application_Model_Decorator::removeAllDecorator($formViewControl);
     $this->view->control = $formViewControl;
 }
 public function editAction()
 {
     $db_model = new Driverguide_Model_DbTable_Dbvehicleprice();
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         try {
             $id = $db_model->updateVehicleRental($data);
             Application_Form_FrmMessage::Sucessfull("Edit Success", "/driverguide/vehicleprice");
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("Application Error");
             Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
         }
     }
     $db = new Application_Model_GlobalClass();
     $this->view->package_option = $db->getAllPackageDayOption();
     $db = new Application_Model_DbTable_DbGlobal();
     $this->view->rs_tax = $db->getAllTax();
     $this->view->vehicle = $db_model->getVehecleName();
     $id = $this->getRequest()->getParam("id");
     $this->view->rows = $db_model->getVehiclePriceById($id);
     // 		print_r($db_model->getVehiclePriceById($id));
     $this->view->vehicle_id = $id;
     // 		$db=new Vehicle_Model_DbTable_DbVehicle();
     // 		$this->view->vehicle=$db->getVehicleById($id);
 }
Beispiel #12
0
 public function editAction()
 {
     $db_model = new Driverguide_Model_DbTable_DbDriver();
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         try {
             $id = $db_model->updateDriver($data);
             Application_Form_FrmMessage::Sucessfull("EDIT_SUCCESSS", "/driverguide");
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("Application Error");
             Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
         }
     }
     $db = new Application_Model_DbTable_DbGlobal();
     $client_type = $db->getclientdtype();
     array_unshift($client_type, array('id' => -1, 'name' => '---Add New ---'));
     $this->view->clienttype = $client_type;
     $dbpop = new Application_Form_FrmPopupGlobal();
     $this->view->frm_popup_clienttype = $dbpop->frmPopupclienttype();
     $id = $this->getRequest()->getParam("id");
     $row = $db_model->getDriverById($id);
     $this->view->rs = $row;
     $fm = new Group_Form_FrmClient();
     $frm = $fm->FrmaddGuide($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm_client = $frm;
 }
 public function editAction()
 {
     if ($this->getRequest()->isPost()) {
         try {
             $_data = $this->getRequest()->getPost();
             $_dbmodel = new Application_Model_DbTable_DbDept();
             $_dbmodel->UpdateDepartment($_data);
             Application_Form_FrmMessage::Sucessfull("ការកៃប្រែដោយជោគជ័យ !", "/global/faculty/index");
             //$this->_redirect("");
         } catch (Exception $e) {
             $err = $e->getMessage();
             Application_Form_FrmMessage::message("Application Error!");
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
             echo $e->getMessage();
             exit;
         }
     }
     $id = $this->getRequest()->getParam("id");
     $_db = new Application_Model_DbTable_DbGlobal();
     $_row = $_db->getDeptById($id);
     $frm = new Application_Form_FrmOther();
     $frm->FrmAddDept($_row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm_dept = $frm;
 }
 public function addSaleAgentAction()
 {
     if ($this->getRequest()->isPost()) {
         $post = $this->getRequest()->getPost();
         if (@$post['submit_add']) {
             $add_agent = new sales_Model_DbTable_DbSalesAgent();
             $add_agent->addSalesAgent($post);
             Application_Form_FrmMessage::message("Agent Has Been Inserted !");
         } elseif (@$post['submit_add_close']) {
             $add_agent = new sales_Model_DbTable_DbSalesAgent();
             $add_agent->addSalesAgent($post);
             $this->_redirect("sales/sale-agent/index");
         } else {
             $this->_redirect("sales/sale-agent/index");
         }
     }
     $formAgent = new sales_Form_FrmStock(null);
     $formShowAgent = $formAgent->showSaleAgentForm(null);
     Application_Model_Decorator::removeAllDecorator($formShowAgent);
     $this->view->form_agent = $formShowAgent;
     $formpopup = new Application_Form_FrmPopup(null);
     //for add location
     $formAdd = $formpopup->popuLocation(null);
     Application_Model_Decorator::removeAllDecorator($formAdd);
     $this->view->form_addstock = $formAdd;
 }
Beispiel #15
0
 public function indexAction()
 {
     try {
         $db = new Accounting_Model_DbTable_DbIndex();
         if ($this->getRequest()->isPost()) {
             $search = $this->getRequest()->getPost();
         } else {
             $search = array('adv_search' => '', 'status_search' => -1);
         }
         $rs_rows = $db->getAllIncomeAndExpense($search = null);
         //call frome model
         $this->view->tran_list = $rs_rows;
         $total_r = $db->getTotalRiel();
         foreach ($total_r as $reil) {
             $this->view->total_reil = $reil['total_amount'];
         }
         $total_d = $db->getTotalDollar();
         foreach ($total_d as $dollar) {
             $this->view->total_dollar = $dollar['total_amount'];
         }
         $total_b = $db->getTotalBat();
         foreach ($total_b as $bat) {
             $this->view->total_bat = $bat['total_amount'];
         }
     } catch (Exception $e) {
         Application_Form_FrmMessage::message("Application Error");
         echo $e->getMessage();
         Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
     }
     //      	$pructis=new Accounting_Form_Frmindex();
     //     	$frm = $pructis->FrmAddIndex();
     //     	Application_Model_Decorator::removeAllDecorator($frm);
     //      	$this->view->frm_info=$frm;
 }
 public function editAction()
 {
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         // 						print_r($data);exit();
         $db = new Table_Model_DbTable_DbTablesGroup();
         try {
             if (isset($data['btnsave_close'])) {
                 $data_table = $db->updateTableGroup($data);
                 Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', self::REDIRECT_URL_ADD_CLOSE);
             }
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("INSERT_FAIL");
             Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
         }
     }
     $id = $this->getRequest()->getParam('id');
     $db = new Table_Model_DbTable_DbTablesGroup();
     $row = $db->getTableGroupById($id);
     // 		print_r($row);exit();
     $db = $this->view->photo = $row['img_name'];
     $frm = new Table_Form_FrmTableGroup();
     $this->view->form = $frm->FrmTable($row);
     // 		Application_Model_Decorator::removeAllDecorator($frm);
     // 		$this->view->frm_fixedasset = $frm;
 }
Beispiel #17
0
 public function editAction()
 {
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         //print_r($data);exit();
         try {
             $db_make = new Vehicle_Model_DbTable_DbMake();
             if (!empty($data['save_close'])) {
                 $db_make->updateMake($data);
                 Application_Form_FrmMessage::Sucessfull($this->tr->translate("INSERT_SUCCESS"), self::REDIRECT_URL_ADD_CLOSE);
             }
         } catch (Exception $e) {
             Application_Form_FrmMessage::message($this->tr->translate("INSERT_FAIL"));
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam('id');
     $db_make = new Vehicle_Model_DbTable_DbMake();
     $rows = $db_make->getMakeById($id);
     $this->view->row = $rows;
     $db = new Application_Model_DbTable_DbGlobal();
     $status = $db->getViews(2);
     $this->view->status_view = $status;
 }
Beispiel #18
0
 public function editAction()
 {
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         $db = new Callecterall_Model_DbTable_DbCallecterall();
         try {
             if (isset($data['btn_save'])) {
                 $db->updatcallecterall($data);
                 Application_Form_FrmMessage::message('ការ​បញ្ចូល​​ជោគ​ជ័យ');
             }
             if (isset($data['btn_save_close'])) {
                 $db->updatcallecterall($data);
                 Application_Form_FrmMessage::message('ការ​បញ្ចូល​​ជោគ​ជ័យ');
                 Application_Form_FrmMessage::redirectUrl('/callecterall/Callecterall');
             }
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("INSERT_FAIL");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam('id');
     $db = new Callecterall_Model_DbTable_DbCallecterall();
     $row = $db->getcallecterallbyid($id);
     $fm = new Callecterall_Form_Frmcallecterall();
     $frm = $fm->Frmcallecterall($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->Form_Frmcallecterall = $frm;
 }
Beispiel #19
0
 public function editAction()
 {
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         //print_r($data);exit();
         try {
             $db_model = new Vehicle_Model_DbTable_DbModel();
             if (isset($data['save_close'])) {
                 $db_model->updateModel($data);
                 Application_Form_FrmMessage::Sucessfull($this->tr->translate("INSERT_SUCCESS"), self::REDIRECT_URL_CLOSE);
             }
         } catch (Exception $e) {
             Application_Form_FrmMessage::message($this->tr->translate("INSERT_FAIL"));
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam('id');
     $db_model = new Vehicle_Model_DbTable_DbModel();
     $row = $db_model->getModelById($id);
     $row = $this->view->row = $row;
     $db = new Application_Model_DbTable_DbGlobal();
     $model = $db->getAllMake();
     array_unshift($model, array('id' => -1, 'name' => 'បន្ថែម​អ្នក​ទទួល​ថ្មី'));
     $this->view->all_make = $model;
     $status = $db->getViews(2);
     $this->view->status_view = $status;
 }
 function editAction()
 {
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         $db_wihtdraw = new Keeping_Model_DbTable_DbOutmoney();
         try {
             if ($this->getRequest()->getPost("btn_save_close")) {
                 $db_wihtdraw->updateWithdrawKeeping($data);
                 Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', self::REDIRECT_URL_EXIT);
             }
         } catch (Exception $e) {
             $this->view->msg = 'ការ​បញ្ចូល​មិន​ជោគ​ជ័យ';
         }
     }
     $db_wihtdraw = new Keeping_Model_DbTable_DbOutmoney();
     $id = $this->getRequest()->getParam("id");
     //     	echo $id;exit();
     $row = $db_wihtdraw->getWithdrawKeepingById($id);
     if (empty($row)) {
     }
     $this->view->id = $row['id'];
     $withdraw_keeping = new Keeping_Form_FrmOutMoney();
     $frm = $withdraw_keeping->dokMoney($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm = $frm;
 }
    public function editAction()
    {
    if($this->getRequest()->isPost()){
			$data=$this->getRequest()->getPost();
			$db = new Group_Model_DbTable_DbCallecteralltype();
			try {
				$db->updatcallecterall($data);
				Application_Form_FrmMessage::message($this->tr->translate('EDIT_SUCCESS'));
				Application_Form_FrmMessage::redirectUrl('/other/callecteralltype');
			} catch (Exception $e) {
				Application_Form_FrmMessage::message("INSERT_FAIL");
				$err = $e->getMessage();
				Application_Model_DbTable_DbUserLog::writeMessageError($err);
			}
		
    	}
    	$id = $this->getRequest()->getParam('id');
    		
    	$db = new Callecterall_Model_DbTable_DbCallecterall();
    	$row  = $db->getcallecterallbyid($id);
    	$fm = new Callecterall_Form_Frmcallecterall();
	    $frm = $fm->Frmcallecterall($row); 
	    Application_Model_Decorator::removeAllDecorator($frm);
	    $this->view->Form_Frmcallecterall = $frm;
    		
    
    }
Beispiel #22
0
 public function indexAction()
 {
     try {
         $db = new Tellerandexchange_Model_DbTable_DbClient();
         if ($this->getRequest()->isPost()) {
             $search = $this->getRequest()->getPost();
         } else {
             $search = array('adv_search' => '', 'status' => -1);
         }
         $rs_rows = $db->getAllClients($search);
         $result = array();
         foreach ($rs_rows as $key => $rs) {
             $result[$key] = array('client_id' => $rs['client_id'], 'client_number' => $rs['client_number'], 'name_kh' => $rs['name_kh'], 'name_en' => $rs['name_en'], 'sex' => $this->sex[$rs['sex']], 'phone' => $rs['phone'], 'house' => $rs['house'], 'street' => $rs['street'], 'village_name' => $rs['village_name'], 'spouse_name' => $rs['spouse_name'], 'user_name' => $rs['user_name'], 'status' => $rs['status']);
         }
         $glClass = new Application_Model_GlobalClass();
         $rs_rows = $glClass->getImgActive($result, BASE_URL, true);
         $list = new Application_Form_Frmtable();
         $collumns = array("Term", "Loan N.", "Date Due", "OS", "Principal", "Interest Rate", "Paid Principal", "Paid Interest Rate", "CO", "By", "status");
         $link = array('module' => 'group', 'controller' => 'Client', 'action' => 'edit');
         $this->view->list = $list->getCheckList(0, $collumns, array(), array('client_number' => $link, 'name_kh' => $link, 'name_en' => $link));
     } catch (Exception $e) {
         Application_Form_FrmMessage::message("Application Error");
         echo $e->getMessage();
         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;
 }
Beispiel #23
0
 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     //clear session from search session
     //$this->clearSession();
     $session_user = new Zend_Session_Namespace('auth');
     $module = $request->getModuleName();
     $controller = $request->getControllerName();
     $action = $request->getActionName();
     $url = $module . "/" . $controller . "/" . $action;
     $_url = "";
     //have login
     if (isset($session_user->arr_acl)) {
         $arr_acl = $session_user->arr_acl;
         $valid_action = FALSE;
         foreach ($arr_acl as $acl) {
             if ($module == $acl["module"] && $controller == $acl["controller"]) {
                 $valid_action = TRUE;
                 break;
             } elseif ($module === "rsvAcl" && $controller === "user" && $action === "change-password") {
                 //all user level can change password all
                 $valid_action = TRUE;
                 break;
             } elseif ($module === "rsvAcl" && $session_user->level === "1") {
                 //user level 1 can access all action in module "rsvAcl"
                 $valid_action = TRUE;
                 break;
             }
         }
         //redirect to homepage
         if (!$valid_action) {
             //just open block below
             if ($url !== "default/index/index" && $url !== "default/error/error" && $url !== "default/index/changepassword" && $url !== "default/index/logout") {
                 $_url = '/';
             }
             $_have = false;
             foreach ($this->_exception_url as $i => $val) {
                 if ($url === $val) {
                     $_have = true;
                     break;
                 }
             }
             if (!$_have) {
                 $_url = '/';
             }
         } else {
             $_url = $this->rewriteUrl($url);
         }
     } else {
         //no login
         //redirect to login page
         if ($url !== "default/index/index") {
             $_url = "/";
         }
     }
     if (!empty($_url)) {
         // 	 		echo"url here". $_url;exit();
         $_url = "/home";
         Application_Form_FrmMessage::redirectUrl($_url);
     }
 }
Beispiel #24
0
 function editAction()
 {
     $db = new Other_Model_DbTable_DbHoliday();
     //$db->deleteHoliday();
     $db = new Other_Model_DbTable_DbHoliday();
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         try {
             $_major_id = $db->addHoliday($_data);
             Application_Form_FrmMessage::Sucessfull($this->tr->translate("EDIT_SUCCESS"), self::REDIRECT_URL . '/holiday/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->getHolidayById($id);
     if (empty($row)) {
         $this->_redirect('/other/holiday');
     }
     $frm = new Other_Form_FrmHoliday();
     $frm_holiday = $frm->FrmAddHoliday($row);
     Application_Model_Decorator::removeAllDecorator($frm_holiday);
     $this->view->frm_holiday = $frm_holiday;
 }
Beispiel #25
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();
		
	}
Beispiel #26
0
 public function editAction()
 {
     $db = new Group_Model_DbTable_DbClient();
     if ($this->getRequest()->isPost()) {
         try {
             $data = $this->getRequest()->getPost();
             $db->addClient($data);
             Application_Form_FrmMessage::Sucessfull($this->tr->translate('EDIT_SUCCESS'), "/group/client");
         } catch (Exception $e) {
             echo $e->getMessage();
             exit;
             Application_Form_FrmMessage::message("Application Error");
             echo $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
         }
     }
     $id = $this->getRequest()->getParam("id");
     $row = $db->getClientById($id);
     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;
 }
 public function editAction()
 {
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         $db = new Accounting_Model_DbTable_DbAsset();
         try {
             $db->updatasset($data);
             Application_Form_FrmMessage::message('ការ​បញ្ចូល​​ជោគ​ជ័យ');
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("INSERT_FAIL");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam('id');
     // 		if(empty($id)){
     // 			Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', self::REDIRECT_URL);
     // 		}
     $db = new Accounting_Model_DbTable_DbAsset();
     $row = $db->getassetbyid($id);
     $pructis = new Accounting_Form_Frmasset();
     $frm = $pructis->FrmAsset($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm_fixedasset = $frm;
 }
Beispiel #28
0
 function editAction()
 {
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         $db = new Stuff_Model_DbTable_DbStuff();
         try {
             if (!empty($data['save_close'])) {
                 $db->updateStuff($data);
                 Application_Form_FrmMessage::Sucessfull("INSERT_SUCCESS", self::REDIRECT_URL);
             }
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("INSERT_FAIL");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $db = new Application_Model_GlobalClass();
     $this->view->pro_option = $db->getAllPackageDayOption();
     $id = $this->getRequest()->getParam('id');
     $db_stuff = new Stuff_Model_DbTable_DbStuff();
     $row_stuff = $db_stuff->getStuffById($id);
     $rows_stuf_de = $db_stuff->getStuffDetailById($id);
     //print_r($rows_stuf_de);exit();
     $this->view->row_stuff = $row_stuff;
     $this->view->rows_detail = $rows_stuf_de;
 }
Beispiel #29
0
   function editAction(){
    $db = new Other_Model_DbTable_DbMyPosition();
	   	if($this->getRequest()->isPost()){
	   		$_data = $this->getRequest()->getPost();
	   		try{
	   			$db->upDatePosition($_data);
	   			Application_Form_FrmMessage::Sucessfull("ការ​បញ្ចូល​ជោគ​ជ័យ !",'/payroll/position');
	   		}catch(Exception $e){
	   			Application_Form_FrmMessage::message("ការ​បញ្ចូល​មិន​ជោគ​ជ័យ");
	   			$err =$e->getMessage();
	   			Application_Model_DbTable_DbUserLog::writeMessageError($err);
	   		}
	   	}
	   	$id = $this->getRequest()->getParam("id");//ចាប់ id from ln_position ;
	   	$row = $db->getPositionById($id);
	   	if(empty($row)){
	   		$this->_redirect('payroll/co');
	   	}
// 	   	if(!empty($row['save_new'])){
// 	   		Application_Form_FrmMessage::message('ការ​បញ្ចូល​​ជោគ​ជ័យ');
// 	   	}else{
// 	   		Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', self::REDIRECT_URL . '/position/index');
// 	   	}
        $frm = new Other_Form_FrmPosition();
		$frm_co=$frm->FrmAddPosition($row);
		Application_Model_Decorator::removeAllDecorator($frm_co);
		$this->view->frm_position = $frm_co;
		   	
   }
 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();
 }