Exemple #1
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;
 }
 public function indexAction()
 {
     try {
         $db_make = new Driverguide_Model_DbTable_Dbvehicleprice();
         if ($this->getRequest()->isPost()) {
             $search = $this->getRequest()->getPost();
         } else {
             $search = array('adv_search' => '', 'make' => -1, 'model' => -1, 'submodel' => -1, 'search_status' => -1);
         }
         $rows = $db_make->getAllVehiclePrice($search);
         $list = new Application_Form_Frmtable();
         $collumns = array("Vehicle Ref", "Frame No", "Licence No", "Year", "Make", "Model", "Sub Model", "Type ", "Tax", "Date", "Status");
         $link = array('module' => 'driverguide', 'controller' => 'vehicleprice', 'action' => 'edit');
         $this->view->list = $list->getCheckList(0, $collumns, $rows, array('reffer' => $link, 'licence_plate' => $link, 'frame_no' => $link, 'year' => $link, 'sub_model' => $link, 'model_id' => $link, 'type' => $link));
     } catch (Exception $e) {
         Application_Form_FrmMessage::message("Application Error");
         Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
     }
     $db = new Application_Model_DbTable_DbGlobal();
     $model = $db->getAllMake();
     $this->view->all_make = $model;
 }
Exemple #3
0
 function editAction()
 {
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         try {
             $db_make = new Vehicle_Model_DbTable_DbVehicle();
             if (isset($data['save_close'])) {
                 $db_make->updateVehicle($data);
                 Application_Form_FrmMessage::Sucessfull($this->tr->translate("EDIT_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 = new Vehicle_Model_DbTable_DbVehicle();
     $rows_v = $db->getVehicleById($id);
     $this->view->row_vehicle = $rows_v;
     $rows_engin = $db->getAllEnGince();
     $this->view->rows_engine = $rows_engin;
     $rows_type = $db->getAllType();
     $this->view->rows_type = $rows_type;
     $rows_tran = $db->getAllTransmisstion();
     $this->view->rows_tran = $rows_tran;
     $rows_veh_typ = $db->getAllVehicleType();
     $this->view->rows_veh_typ = $rows_veh_typ;
     //select store mark
     $db = new Application_Model_DbTable_DbGlobal();
     $model = $db->getAllMake();
     array_unshift($model, array('id' => -1, 'name' => 'បន្ថែម​អ្នក​ទទួល​ថ្មី'));
     $this->view->all_make = $model;
 }