public static function formNewScaffStep3($datForm)
 {
     $ess_master_tables = new ess_master_tables();
     $arrTablas = array();
     foreach ($ess_master_tables->find(NULL, 'name') as $tabla) {
         $arrTablas[$tabla->id] = $tabla->name;
     }
     $arrTablas['other'] = OPF_myLang::getPhrase('OPF_SCAFF_48');
     $myForm = new OPF_myForm('formNewScaffStep3');
     $myForm->addComment('field_selec', '<div align="center"><b>' . OPF_myLang::getPhrase('OPF_SCAFF_16') . '</b></div>');
     $myForm->addComment('field_etq', '<div align="center"><b>' . OPF_myLang::getPhrase('OPF_SCAFF_29') . '</b></div>');
     foreach ($_SESSION['temp_scaff_info']['combos'] as $combo) {
         $myForm->addComment('field_selec_' . $combo, '<div align="center">' . $combo . '</div>');
         $value = '';
         if (isset($_SESSION['temp_scaff_info']['combos_rel']['type_' . $combo])) {
             $value = $_SESSION['temp_scaff_info']['combos_rel']['type_' . $combo];
         }
         $myForm->addEvent('type_' . $combo, 'onchange', 'onChangeTable', 'type_' . $combo);
         $myForm->addComment('type_' . $combo, '<div align="center">' . $myForm->getSelect('type_' . $combo, $arrTablas, $value) . '</div>');
     }
     $myForm->addButton('btn0', OPF_myLang::getPhrase('OPF_SCAFF_13'), 'back.gif');
     $myForm->addEvent('btn0', 'onclick', 'newScaff', 2);
     $myForm->addButton('btn1', OPF_myLang::getPhrase('OPF_SCAFF_14'), 'next.gif');
     $myForm->addEvent('btn1', 'onclick', 'toScaffStep4');
     return $myForm->getForm(2);
 }
 /**
  * Guardar los cambios en un registro
  * @param array $params
  * @return string
  */
 public function onClickSaveReg($params, $id = '')
 {
     $requiredFields = array('name');
     if ($this->MYFORM_validate($params, $requiredFields)) {
         $ess_master_tables = new ess_master_tables();
         if ($id) {
             $ess_master_tables->find($id);
         }
         $ess_master_tables->name = $params['name'];
         $ess_master_tables->description = $params['description'];
         $ess_master_tables->user_id = $_SESSION['user_id'];
         $ess_master_tables->datetime = date("Y-m-d H:i:s");
         if ($ess_master_tables->save()) {
             $this->closeModalWindow();
             $this->MYLIST_reload('lst_tablas');
             $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMBIOS_GUARDADOS'), 5, 'ok');
             if (!$id) {
                 $this->onClickGetDetList($ess_master_tables->getLastInsertId());
             }
         } else {
             $this->messageBox($ess_master_tables->getSqlLog() . "\n" . $ess_master_tables->getErrorLog(), 'error');
         }
     } else {
         $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMPOS_REQUERIDOS'), 5, 'error');
     }
     return $this->response;
 }
 public function __construct($id, $detail_id = '')
 {
     $this->table_id = $id;
     $this->detail_id = $detail_id;
     $ess_master_tables = new ess_master_tables();
     $ess_master_tables->find($this->table_id);
     $this->table_name = $ess_master_tables->name;
 }