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() { $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() { $db = new Group_Model_DbTable_DbClient(); if ($this->getRequest()->isPost()) { $data = $this->getRequest()->getPost(); try { $db->addClient($data); Application_Form_FrmMessage::Sucessfull("EDIT_SUCCESS", "/group"); } catch (Exception $e) { Application_Form_FrmMessage::message("Application Error"); Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage()); } } $fm = new Group_Form_FrmClient(); $id = $this->getRequest()->getParam("id"); $row = $db->getClientById($id); $this->view->id = $row['id']; $frm = $fm->FrmAddClient($row); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_client = $frm; $this->view->old_photo = $row['photo']; }
function rptClientAction($table='ln_account_name'){ $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' => '', 'status' => -1, 'branch_id' => 0, 'province'=>0, 'district'=>'', 'commune'=>'', 'village'=>'', 'start_date'=> date('Y-m-d'), 'end_date'=>date('Y-m-d')); } $this->view->result=$search; $db = new Report_Model_DbTable_DbLnClient(); $this->view->client_list =$db->getAllLnClient($search); $frm = new Application_Form_FrmAdvanceSearch(); $frm = $frm->AdvanceSearch(); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_search = $frm; $fm = new Group_Form_FrmClient(); $frm = $fm->FrmAddClient(); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_client = $frm; $db= new Application_Model_DbTable_DbGlobal(); $this->view->district = $db->getAllDistricts(); $this->view->commune = $db->getCommune(); $this->view->village = $db->getVillage(); }
public function frmPopupindividualclient() { $tr = Application_Form_FrmLanguages::getCurrentlanguage(); $fm = new Group_Form_FrmClient(); $frms = $fm->FrmAddClient(); Application_Model_Decorator::removeAllDecorator($frms); $str = "<div class='dijitHidden'>\n\t\t\t\t<div data-dojo-type='dijit.Dialog' id='frmpop_client' >\n\t\t\t\t\t<form id='addclient' dojoType='dijit.form.Form' method='post' enctype='application/x-www-form-urlencoded'>\n\t\t<script type='dojo/method' event='onSubmit'>\n\t\tif(this.validate()) {\n\t\t return true;\n\t } else {\n\t return false;\n\t }\n\t </script>"; $str .= '<table style="margin: 0 auto; width: 100%;" cellspacing="7"> <tr> <td>' . $tr->translate("NAME_KHMER") . '</td> <td>' . $frms->getElement('name_kh') . '</td> <td>' . $tr->translate("NAME_ENG") . '</td> <td>' . $frms->getElement('name_en') . '</td> <td>' . $tr->translate("SEX") . '</td> <td>' . $frms->getElement('sex') . '</td> </tr> <tr> <td>' . $tr->translate("SITU_STATUS") . '</td> <td>' . $frms->getElement('situ_status') . '</td> <td>' . $tr->translate("NATIONAL_ID") . '</td> <td>' . $frms->getElement('client_d_type') . '</td> <td>' . $tr->translate("NUMBER") . '</td> <td>' . $frms->getElement('national_id') . '</td> </tr> <tr> <td>' . $tr->translate("JOB_TYPE") . '</td> <td>' . $frms->getElement('job') . '</td> <td>' . $tr->translate("PHONE") . '</td> <td>' . $frms->getElement('phone') . '</td> <td>' . $tr->translate("DOB") . '</td> <td>' . $frms->getElement('dob_client') . '</td> </tr> <tr> <td>' . $tr->translate("PROVINCE") . '</td> <td>' . $frms->getElement('province') . '</td> <td>' . $tr->translate("DISTRICT") . '</td> <td>' . $frms->getElement('district') . '</td> <td>' . $frms->getElement('COMMUNE') . '</td> <td>' . $frms->getElement('commune') . '</td> </tr> <tr> <td>' . $tr->translate('VILLAGE') . '</td> <td>' . $frms->getElement('village') . '</td> <td>' . $tr->translate('STREET') . '</td> <td>' . $frms->getElement('street') . '</td> <td>' . $tr->translate('HOUSE') . '</td> <td>' . $frms->getElement('house') . '</td> </tr> <tr> <td colspan="6" align="center" colspan="3"> <input type="button" value="Save" label="Save" dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" onclick="addNewindividual();"/> </td> </tr> </table>'; $str .= '</form></div> </div>'; return $str; }
public function frmPopupClient() { $tr = Application_Form_FrmLanguages::getCurrentlanguage(); $frmco = new Group_Form_FrmClient(); $frm = $frmco->FrmAddClient(); Application_Model_Decorator::removeAllDecorator($frm); $str = '<div class="dijitHidden"> <div data-dojo-type="dijit.Dialog" id="frm_client" > <form id="form_client" name="form_client" />'; $str .= '<table style="margin: 0 auto; width: 100%;" cellspacing="7"> <tr> <td>Is Group</td> <td>' . $frm->getElement('is_group') . '</td> <td>Client N</td> <td>' . $frm->getElement('client_no') . '</td> </tr> <tr> <td>Name Khmer</td> <td>' . $frm->getElement('name_kh') . '</td> <td>Name Eng</td> <td>' . $frm->getElement('name_en') . '</td> </tr> <tr> <td>Sex</td> <td>' . $frm->getElement('sex') . '</td> <td>Status</td> <td>' . $frm->getElement('situ_status') . '</td> </tr> <tr> <td>Province</td> <td>' . $frm->getElement('province') . '</td> <td>District</td> <td>' . $frm->getElement('district') . '</td> </tr> <tr> <td>Commune</td> <td>' . $frm->getElement('commune') . '</td> <td>' . $tr->translate("Village") . '</td> <td>' . $frm->getElement('village') . '</td> </tr> <tr> <td>Street</td> <td>' . $frm->getElement('street') . '</td> <td>' . $tr->translate("House N.") . '</td> <td>' . $frm->getElement('house') . '</td> </tr> <tr> <td>ID Type</td> <td>' . $frm->getElement('id_type') . '</td> <td>' . $tr->translate("ID Card") . '</td> <td>' . $frm->getElement('id_no') . '</td> </tr> <tr> <td>' . $tr->translate("Phone") . '</td> <td>' . $frm->getElement('phone') . '</td> <td>' . $tr->translate("Spouse Name") . '</td> <td>' . $frm->getElement('spouse') . '</td> </tr> <tr> <td>' . $tr->translate("Status") . '</td> <td>' . $frm->getElement('status') . '</td> <td>' . $tr->translate("Note") . '</td> <td>' . $frm->getElement('desc') . '</td> </tr> <tr> <td colspan="4" align="center"> <input type="button" value="Save" label="Save" dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" onclick="addNewClient();"/> </td> </tr> </table>'; $str .= ' </form> </div> </div>'; return $str; }
public function editAction(){ $db = new Group_Model_DbTable_DbClient(); if($this->getRequest()->isPost()){ try{ $data = $this->getRequest()->getPost(); //print_r($data);exit(); $id= $db->addClient($data); if($data['chackcall']==1){ Application_Form_FrmMessage::message("វានឹងបន្ថែមទ្រព្យបញ្ចាំរបស់អតិថិជនដោយស្វ័យប្រវត្តិ!"); Application_Form_FrmMessage::redirectUrl("/group/callteral/add/id/".$id); } Application_Form_FrmMessage::Sucessfull('EDIT_SUCCESS',"/group/index"); }catch (Exception $e){ Application_Form_FrmMessage::message("EDIT_FAILE"); echo $e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage()); } } $id = $this->getRequest()->getParam("id"); $row = $db->getClientById($id); $this->view->row=$row; $this->view->photo = $row['photo_name']; 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; $dbpop = new Application_Form_FrmPopupGlobal(); $this->view->frm_popup_village = $dbpop->frmPopupVillage(); $this->view->frm_popup_comm = $dbpop->frmPopupCommune(); $this->view->frm_popup_district = $dbpop->frmPopupDistrict(); $this->view->frm_popup_clienttype = $dbpop->frmPopupclienttype(); $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; }