Exemple #1
0
 function rptZoneAction(){
 	$db  = new Report_Model_DbTable_DbParamater();
 	$this->view->zone_list = $db->getAllZone();
 	$key = new Application_Model_DbTable_DbKeycode();
 	$this->view->data=$key->getKeyCodeMiniInv(TRUE);
 	$frm = new Other_Form_FrmZone();
 	$frm_co=$frm->FrmAddZone();
 	Application_Model_Decorator::removeAllDecorator($frm_co);
 	$this->view->frm_zone = $frm_co;
 	if($this->getRequest()->isPost()){
 		$data = $this->getRequest()->getPost();
 		//print_r($data);exit();
 		if(isset($data['btn_search'])){
 			$this->view->zone_list = $db->getAllZone($data);
 		}else{
 		$collumn = array("zone_id","zone_num","modify_date","status");
 		$this->exportFileToExcel('ln_zone',$db->getAllZone(),$collumn);
 		}
 	}else $search = array('txtsearch' => '');
 }
Exemple #2
0
   function editAction(){
   	$db = new Other_Model_DbTable_DbZone();
	   	if($this->getRequest()->isPost()){
	   		try{
	   			$_data = $this->getRequest()->getPost();
	   			$db->addZone($_data);
	   			Application_Form_FrmMessage::Sucessfull($this->tr->translate('EDIT_SUCCESS'),self::REDIRECT_URL.'/zone/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->getZoneById($id);
	   	if(empty($row)){
	   		$this->_redirect('/other/zone');
	   	}
	   	$frm = new Other_Form_FrmZone();
	   	$frm_co=$frm->FrmAddZone($row);
	   	Application_Model_Decorator::removeAllDecorator($frm_co);
	   	$this->view->frm_zone = $frm_co;
   }
 function editAction()
 {
     $db = new Other_Model_DbTable_DbZone();
     if ($this->getRequest()->isPost()) {
         try {
             $_data = $this->getRequest()->getPost();
             $db->addZone($_data);
             Application_Form_FrmMessage::Sucessfull("ការ​កែប្រែ​ជោគ​ជ័យ !", '/other/Zone');
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("ការ​កែប្រែ​មិន​ជោគ​ជ័យ");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam('id');
     $row = $db->getZoneById($id);
     if (empty($row)) {
         $this->_redirect('/other/Zone');
     }
     $frm = new Other_Form_FrmZone();
     $frm_co = $frm->FrmAddZone($row);
     Application_Model_Decorator::removeAllDecorator($frm_co);
     $this->view->frm_zone = $frm_co;
 }
Exemple #4
0
    public function frmPopupZone()
    {
        $tr = Application_Form_FrmLanguages::getCurrentlanguage();
        $frmzone = new Other_Form_FrmZone();
        $frm = $frmzone->FrmAddZone();
        Application_Model_Decorator::removeAllDecorator($frm);
        $str = '<div class="dijitHidden">
				<div data-dojo-type="dijit.Dialog"  id="frm_zone" >
			<form id="form_zone" dojoType="dijit.form.Form" method="post" enctype="application/x-www-form-urlencoded">
				<script type="dojo/method" event="onSubmit">
					if(this.validate()) {
						return true;
					}else {
						return false;
					}
		      </script>';
        $str .= '<table style="margin: 0 auto; width: 100%;" cellspacing="7">
					<tr>
						<td>Zone Name</td>
						<td>' . $frm->getElement('zone_name') . '</td>
					</tr>
					<tr>
						<td>Zone Number</td>
						<td>' . $frm->getElement('zone_number') . '</td>
					</tr>
					<tr>
						<td colspan="4" align="center">
						<input type="button" value="Save" label="Save" dojoType="dijit.form.Button"
						iconClass="dijitEditorIcon dijitEditorIconSave" onclick="addNewZone();"/>
						</td>
					</tr>
				</table>';
        $str .= '</form>		</div>
		</div>';
        return $str;
    }