Пример #1
0
	public function editAction()
	{
		if($this->getRequest()->isPost()){
				$calldata=$this->getRequest()->getPost();
				$db_call = new Group_Model_DbTable_DbCallteral();
				try{
					$db = $db_call->updatecallteral($calldata);
					Application_Form_FrmMessage::Sucessfull('EDIT_SUCCESS', self::REDIRECT_URL. '/callteral/index');
				} catch (Exception $e) {
					Application_Form_FrmMessage::message("INSERT_FAIL");
				    Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
				}
		}
		$id = $this->getRequest()->getParam('id');
		
		$db = new Group_Model_DbTable_DbCallteral();
		$row  = $db->getecallteralbyid($id);
		if(empty($id) OR empty($row) ){
			Application_Form_FrmMessage::Sucessfull('RECORD_NOT_EXIST', self::REDIRECT_URL. '/callteral/index');
		}
		
		$this->view->client_id = $row['client_id'];
		$this->view->branch_id = $row['branch_id'];
		$this->view->rows = $db->getCallecteralDetailById($id);
		
		$fm = new Group_Form_Frmcallterals();
		$frm = $fm->FrmCallTeral($row);
		Application_Model_Decorator::removeAllDecorator($frm);
		$this->view->frm_callteral = $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();
		
		
    }
Пример #2
0
 function rptCalleteralsAction(){
 	$db  = new Report_Model_DbTable_DbLnClient();
 	$key = new Application_Model_DbTable_DbKeycode();
 	$this->view->data=$key->getKeyCodeMiniInv(TRUE);
 	$this->view->calleteral_list = $db->geteAllcallteral();
 	$fm=new Group_Form_Frmcallterals();
 	$frm=$fm->FrmCallTeral();
 	$this->view->frm_callteral=$frm;
 	if($this->getRequest()->isPost()){
 		$data = $this->getRequest()->getPost();
 		if(isset($data['btn_search'])){
 			$this->view->calleteral_list = $db->geteAllcallteral($data);
 		}
 	}else {
 		$search = array(
 				'adv_search' => '',
 				'status_search' => -1,
 				'start_date'=> date('Y-m-d'),
 				'end_date'=>date('Y-m-d'));
 	}
 	$this->view->result=$search;
 }