コード例 #1
0
 /**
  * Registrar los cambios del detalle
  *
  * @param unknown_type $datForm
  */
 public function onClickSaveItemTable($datForm, $table_id, $detail_id = '')
 {
     if ($this->MYFORM_validate($datForm, array('item_desc'))) {
         $ess_master_tables_detail = new ess_master_tables_detail();
         if ($detail_id) {
             $ess_master_tables_detail->find($detail_id);
         }
         $ess_master_tables_detail->item_cod = $datForm['item_cod'];
         $ess_master_tables_detail->item_desc = $datForm['item_desc'];
         $ess_master_tables_detail->master_tables_id = $table_id;
         $ess_master_tables_detail->user_id = $_SESSION['user_id'];
         $ess_master_tables_detail->datetime = date("Y-m-d H:i:s");
         if ($ess_master_tables_detail->save()) {
             $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMBIOS_GUARDADOS'), 3, 'ok');
             $this->closeModalWindow();
             $this->MYLIST_reload('lst_tablas_detalle');
         } else {
             $this->messageBox($ess_master_tables_detail->getErrorLog(), 'ERROR');
         }
     } else {
         $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMPOS_REQUERIDOS'), 3, 'error');
     }
     return $this->response;
 }