function validateAccess($executed, $openAccess, $urlRedirect, $ESS_essentials)
{
    $isOpenAccess = false;
    foreach ($openAccess as $path) {
        if (str_replace(DS, '', strrchr(dirname(__FILE__), DS)) == 'essentials' && stripos($executed, $path) !== false) {
            $isOpenAccess = true;
            break;
        }
    }
    if ($isOpenAccess) {
        #TODO
    } else {
        if (isset($_SESSION['user_id'])) {
            if (isset($_GET['secure_opf_code'])) {
                if (!$ESS_essentials->isOwnerOnMod($ESS_essentials->unCrypNumbers($_GET['secure_opf_code']))) {
                    die(showErrorAccess(OPF_myLang::getPhrase('OPF_ACCESS_NOT_PERMITED_ERROR'), OPF_myLang::getPhrase('OPF_ACCESS_NOT_PERMITED_DETAIL')));
                }
            } else {
                die(showErrorAccess(OPF_myLang::getPhrase('OPF_ACCESS_NOT_VERIFY_ERROR'), OPF_myLang::getPhrase('OPF_ACCESS_NOT_VERIFY_DETAIL')));
            }
        } else {
            header('Location: ' . $urlRedirect);
        }
    }
}
 /**
  * Ejemplo de evento
  *
  * @param $params
  * @return string
  */
 public function onClikSavePasswd($datForm)
 {
     if ($this->MYFORM_validate($datForm, array('user_name', 'passwd1', 'passwd2'))) {
         $OPF_passwd = new OPF_passwd();
         if ($OPF_passwd->validateUser($datForm['user_name'])) {
             if ($OPF_passwd->validatePasswd($datForm['user_name'], $datForm['passwd'])) {
                 if (!strcmp($datForm['passwd1'], $datForm['passwd2'])) {
                     $ess_system_users = new ess_system_users();
                     $ess_system_users->find($_SESSION['user_id']);
                     $ess_system_users->passwd = md5($datForm['user_name'] . $datForm['passwd']);
                     if ($OPF_passwd->setNewPasswd($datForm['user_name'], $datForm['passwd1'])) {
                         $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMBIOS_GUARDADOS'), 3, 'ok');
                         $this->clear('user_name', 'value');
                         $this->clear('passwd', 'value');
                         $this->clear('passwd1', 'value');
                         $this->clear('passwd2', 'value');
                     } else {
                         $this->messageBox($ess_system_users->getErrorLog() . $ess_system_users->getSqlLog(), 'error');
                     }
                 } else {
                     $this->notificationWindow(OPF_myLang::getPhrase('OPF_PASSWD_1'), 3, 'error');
                 }
             } else {
                 $this->notificationWindow(OPF_myLang::getPhrase('OPF_PASSWD_2'), 3, 'error');
             }
         } else {
             $this->notificationWindow(OPF_myLang::getPhrase('OPF_PASSWD_3'), 3, 'error');
             $this->redirect('../OPF_logout/');
         }
     } else {
         $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMPOS_REQUERIDOS'), 3, 'error');
     }
     return $this->response;
 }
 public function getListUsrs()
 {
     $myAct = new OPF_myActiveRecord();
     $arrReplace = array('OPF_FIELD_MODIFICAR' => OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), 'OPF_FIELD_ELIMINAR' => OPF_myLang::getPhrase('OPF_FIELD_ELIMINAR'), 'OPF_FIELD_USUARIO' => OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 'OPF_FIELD_NOMBRE' => OPF_myLang::getPhrase('OPF_FIELD_NOMBRE'), 'OPF_FIELD_APELLIDO' => OPF_myLang::getPhrase('OPF_FIELD_APELLIDO'), 'OPF_FIELD_ACTUALIZADO' => OPF_myLang::getPhrase('OPF_FIELD_ACTUALIZADO'), 'OPF_FIELD_PERFIL' => OPF_myLang::getPhrase('OPF_FIELD_PERFIL'), 'OPF_ADMUSR_11' => OPF_myLang::getPhrase('OPF_ADMUSR_11'), 'OPF_ADMUSR_10' => OPF_myLang::getPhrase('OPF_ADMUSR_10'), 'OPF_FIELD_ESTADO' => OPF_myLang::getPhrase('OPF_FIELD_ESTADO'));
     $myList = new OPF_myList('lst_users', $myAct->loadSqlFromFile(dirname(__FILE__) . DS . 'sql' . DS . 'lst_users.sql', $arrReplace));
     $myList->width = 950;
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), 70);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_ELIMINAR'), 70);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 150);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_NOMBRE'), 150);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_APELLIDO'), 150);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_PERFIL'), 150);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_ACTUALIZADO'), 160);
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 'ess_system_users.user_name');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_NOMBRE'), 'ess_system_users.name');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_APELLIDO'), 'ess_system_users.lastname');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_PERFIL'), 'ess_profiles.name');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_ACTUALIZADO'), 'ess_system_users.datetime');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_ESTADO'), 'ess_system_users.status');
     $myList->setEventOnColumn(OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), 'onClickNewRecord');
     $myList->setEventOnColumn(OPF_myLang::getPhrase('OPF_FIELD_ELIMINAR'), 'onClickDeleteRecord', OPF_myLang::getPhrase('OPF_FIELD_CONFIRM_ELIMINAR'));
     $myList->setUseOrderMethod(true, OPF_myLang::getPhrase('OPF_FIELD_ACTUALIZADO'));
     $myList->setPagination(true, 50);
     $myList->setExportData(true, true, true);
     $myList->setGlobalEventOnColumn(OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), array(OPF_myLang::getPhrase('OPF_ADMUSR_8') => 'habilitaUsuarios', OPF_myLang::getPhrase('OPF_ADMUSR_9') => 'inhabilitaUsuarios'));
     return $myList->getList(true, true);
 }
 public function getFormChngPasswd()
 {
     $myForm = new OPF_myForm('ChngPasswd');
     $myForm->addText(OPF_myLang::getPhrase('OPF_PASSWD_4'), 'user_name');
     $myForm->addPassword(OPF_myLang::getPhrase('OPF_PASSWD_5'), 'passwd');
     $myForm->addPassword(OPF_myLang::getPhrase('OPF_PASSWD_6'), 'passwd1');
     $myForm->addPassword(OPF_myLang::getPhrase('OPF_PASSWD_7'), 'passwd2');
     $myForm->addButton('btn_save', OPF_myLang::getPhrase('LABEL_BTN_SAVE'), 'save.gif');
     $myForm->addEvent('btn_save', 'onclick', 'onClikSavePasswd');
     return $myForm->getForm(1);
 }
 public static function router($app, $module, $event, $params, $ajax_conf = array(), $name_utility = '')
 {
     $security = APP_PATH . $app . DS . 'security.php';
     include $security;
     # Es una utilidad?
     if ($name_utility) {
         $pathScript = ROOT_PATH . DS . 'resources' . DS . 'utility' . DS . $name_utility . '.php';
         include $pathScript;
     } else {
         $pathModel = APP_PATH . $app . DS . $module . DS . 'dataModel.php';
         $pathHandler = APP_PATH . $app . DS . $module . DS . 'handlerEvent.php';
         $pathIndex = APP_PATH . $app . DS . $module . DS . 'index.php';
         if (file_exists($pathIndex)) {
             include $pathModel;
             include $pathHandler;
             if (class_exists('controller')) {
                 global $objAjax;
                 switch (AJAX_ENGINE) {
                     case 'xajax':
                         require PLUGINS_PATH . 'xajax/xajax_core/xajax.inc.php';
                         # Agilizar el rendimiento
                         $objxAjax = new xajax();
                         $objxAjax->setFlag("debug", $ajax_conf[AJAX_ENGINE]['debug']);
                         $objxAjax->setFlag('decodeUTF8Input', $ajax_conf[AJAX_ENGINE]['decodeUTF8Input']);
                         $objxAjax->setWrapperPrefix($ajax_conf[AJAX_ENGINE]['wrapper_prefix']);
                         $GLOBALS['objAjax'] = $objxAjax;
                         define('PATH_XAJAX_JS', 'plugin/xajax/');
                         break;
                 }
                 $controller = new controller();
                 $controller->processRequest();
                 if (method_exists($controller, $event)) {
                     $reflectionMethod = new ReflectionMethod('controller', $event);
                     $reflectionMethod->invokeArgs($controller, $params);
                 } else {
                     if ($event != 'default_event') {
                         $msgError = '<div class="error"><b>' . OPF_myLang::getPhrase('ERROR_LABEL') . ':</b>&nbsp;' . OPF_myLang::getPhrase('ROUTER_METHOD_NOT_FOUND') . '&nbsp;&quot;' . $event . '&quot;</div>';
                         die($msgError);
                     }
                 }
                 include $pathIndex;
             } else {
                 $msgError = '<div class="error"><b>' . OPF_myLang::getPhrase('ERROR_LABEL') . ':</b>&nbsp;' . OPF_myLang::getPhrase('ROUTER_CLASS_NOT_FOUND') . '&nbsp;&quot;' . 'controller' . '&quot;</div>';
                 die($msgError);
             }
         } else {
             die('Error: 404 / The module "' . $app . '/' . $module . '" does not exist.');
         }
     }
 }
 public function closeSessionOnUser($id)
 {
     $ess_usronline = new ess_usronline();
     $exito = false;
     $ess_usronline->find($id);
     if (@unlink(session_save_path() . '/' . $ess_usronline->sesname)) {
         $exito = true;
     }
     $ess_usronline->delete($id);
     if ($exito) {
         $this->notificationWindow(OPF_myLang::getPhrase('OPF_USRONLINE_1'), 5, 'ok');
         $this->MYLIST_reload('users_on_line');
     } else {
         $this->notificationWindow(OPF_myLang::getPhrase('OPF_USRONLINE_2'), 5, 'error');
     }
     return $this->response;
 }
 public static function getListBit()
 {
     $myAct = new OPF_myActiveRecord();
     $arrReplace = array('OPF_FIELD_ID' => OPF_myLang::getPhrase('OPF_FIELD_ID'), 'OPF_FIELD_DATETIME' => OPF_myLang::getPhrase('OPF_FIELD_DATETIME'), 'OPF_FIELD_IP' => OPF_myLang::getPhrase('OPF_FIELD_IP'), 'OPF_FIELD_USUARIO' => OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 'OPF_FIELD_URL' => OPF_myLang::getPhrase('OPF_FIELD_URL'));
     $myList = new OPF_myList('lst_bit', $myAct->loadSqlFromFile(dirname(__FILE__) . DS . 'sql' . DS . 'bit.sql', $arrReplace));
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_ID'), 100);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_DATETIME'), 130);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_IP'), 100);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 100);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_URL'), 570);
     $myList->setUseOrderMethod(true, OPF_myLang::getPhrase('OPF_FIELD_ID'), 'DESC');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_ID'), 'ess_bit.id');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_DATETIME'), 'ess_bit.datetime');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_IP'), 'ess_bit.ip');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_URL'), 'ess_bit.url');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 'ess_system_users.user_name');
     $myList->setPagination(true, 20);
     $myList->setExportData(true, true, true);
     return $myList->getList(true, true);
 }
 public function onClickSave($datForm, $id = '')
 {
     $requiredFields = array('description', 'ord');
     if ($this->MYFORM_validate($datForm, $requiredFields)) {
         $error = false;
         $ess_menu = new ess_menu();
         if ($id) {
             $ess_menu->find($id);
         }
         $ess_menu->description = $datForm['description'];
         if ($datForm['menu_id']) {
             $ess_menu->menu_id = $datForm['menu_id'];
         }
         $ess_menu->ord = $datForm['ord'];
         $ess_menu->url = $datForm['url'];
         $ess_menu->icon = $datForm['icon'];
         $ess_menu->usuario_id = $_SESSION['user_id'];
         $ess_menu->datetime = date("Y-m-d H:i:s");
         if ($id == $datForm['menu_id'] && $id) {
             $error = true;
         }
         if (!$error) {
             if ($ess_menu->save()) {
                 $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMBIOS_GUARDADOS'), 3, 'ok');
                 $this->closeModalWindow();
                 $this->MYLIST_reload('lst_menu');
             } else {
                 $this->messageBox($ess_menu->getSqlLog() . $ess_menu->getErrorLog(), 'error');
             }
         } else {
             $this->messageBox(OPF_myLang::getPhrase('OPF_MENU_3'), 'error');
         }
     } else {
         $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMPOS_REQUERIDOS'), 3, 'error');
     }
     return $this->response;
 }
 public function buildDinamicListUsersOnLine()
 {
     $actRecord = new OPF_myActiveRecord();
     $arrRpl = array('OPF_FIELD_CERRAR' => OPF_myLang::getPhrase('OPF_FIELD_CERRAR'), 'OPF_FIELD_USUARIO' => OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 'OPF_FIELD_IP' => OPF_myLang::getPhrase('OPF_FIELD_IP'), 'OPF_FIELD_INGRESO' => OPF_myLang::getPhrase('OPF_FIELD_INGRESO'), 'OPF_FIELD_FILE' => OPF_myLang::getPhrase('OPF_FIELD_FILE'), 'OPF_FIELD_PESO' => OPF_myLang::getPhrase('OPF_FIELD_PESO'), 'OPF_FIELD_ACTUALIZADO' => OPF_myLang::getPhrase('OPF_FIELD_ACTUALIZADO'));
     $myList = new OPF_myList('users_on_line', $actRecord->loadSqlFromFile(dirname(__FILE__) . DS . 'sql' . DS . 'user_online.sql', $arrRpl));
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_CERRAR'), 60);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 150);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_IP'), 150);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_INGRESO'), 150);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_FILE'), 200);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_PESO'), 100);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_ACTUALIZADO'), 90);
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 'ess_system_users.user_name');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_IP'), 'ess_usronline.ip');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_INGRESO'), 'ess_usronline.datetime');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_FILE'), 'ess_usronline.sesname');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_PESO'), 'ess_usronline.size');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_ACTUALIZADO'), 'ess_usronline.filectime');
     $myList->width = 900;
     $myList->setEventOnColumn(OPF_myLang::getPhrase('OPF_FIELD_CERRAR'), 'closeSessionOnUser', OPF_myLang::getPhrase('OPF_USRONLINE_3'));
     $myList->setExportData(true, true, true);
     $myList->setUseOrderMethod(true, OPF_myLang::getPhrase('OPF_FIELD_INGRESO'));
     return $myList->getList(true, true);
 }
 /**
  * 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 getList()
 {
     $myAct = new OPF_myActiveRecord();
     $arRpl = array('OPF_FIELD_MODIFICAR' => OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), 'OPF_FIELD_ELIMINAR' => OPF_myLang::getPhrase('OPF_FIELD_ELIMINAR'), 'OPF_FIELD_ID' => OPF_myLang::getPhrase('OPF_FIELD_ID'), 'OPF_FIELD_PADRE' => OPF_myLang::getPhrase('OPF_FIELD_PADRE'), 'OPF_FIELD_DESCRIPCION' => OPF_myLang::getPhrase('OPF_FIELD_DESCRIPCION'), 'OPF_FIELD_ICON' => OPF_myLang::getPhrase('OPF_FIELD_ICON'), 'OPF_FIELD_URL' => OPF_myLang::getPhrase('OPF_FIELD_URL'), 'OPF_FIELD_ORDEN' => OPF_myLang::getPhrase('OPF_FIELD_ORDEN'), 'OPF_FIELD_USUARIO' => OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 'OPF_FIELD_DATETIME' => OPF_myLang::getPhrase('OPF_FIELD_DATETIME'));
     $myList = new OPF_myList('lst_menu', $myAct->loadSqlFromFile(dirname(__FILE__) . DS . 'sql' . DS . 'list_menu.sql', $arRpl));
     $myList->width = 1100;
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), 80);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_ELIMINAR'), 80);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_ID'), 50);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_PADRE'), 125);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_DESCRIPCION'), 125);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_ICON'), 60);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_ORDEN'), 40);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 100);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_DATETIME'), 120);
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_ID'), 'ess_menu.id');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_PADRE'), 'same.description');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_DESCRIPCION'), 'ess_menu.description');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_ICON'), 'ess_menu.icon');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_URL'), 'ess_menu.url');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_ORDEN'), 'ess_menu.ord');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 'ess_system_users.user_name');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_DATETIME'), 'ess_menu.datetime');
     $myList->setUseOrderMethod(true, OPF_myLang::getPhrase('OPF_FIELD_DATETIME'), 'DESC');
     $myList->setExportData(true, true, true);
     $myList->setEventOnColumn(OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), 'onClickAddModRecord');
     $myList->setEventOnColumn(OPF_myLang::getPhrase('OPF_FIELD_ELIMINAR'), 'onClickDeleteRecord', OPF_myLang::getPhrase('OPF_FIELD_CONFIRM_ELIMINAR'));
     $myList->setPagination(true, 50);
     return $myList->getList(true, true);
 }
 public function toScaffStep2($datForm)
 {
     if ($this->MYFORM_validate($datForm, array('table_name'))) {
         $myAct = new OPF_myActiveRecord();
         if (!isset($_SESSION['temp_scaff_info'])) {
             $_SESSION['temp_scaff_info'] = array();
         }
         $resSql = scaffold::getResultSelectFields($myAct, $datForm['table_name']);
         if (!$resSql) {
             $this->messageBox(OPF_myLang::getPhrase('OPF_SCAFF_10'), 'warning');
         } else {
             $_SESSION['temp_scaff_info']['table_name'] = $datForm['table_name'];
             $this->newScaff($datForm, 2);
         }
     } else {
         $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMPOS_REQUERIDOS'), 5, 'error');
     }
     return $this->response;
 }
 public function onClickSave($datForm, $id = '')
 {
     if ($this->MYFORM_validate($datForm, array('name', 'description'))) {
         $ess_profiles = new ess_profiles();
         if ($id) {
             $ess_profiles->find($id);
         }
         $ess_profiles->name = $datForm['name'];
         $ess_profiles->description = $datForm['description'];
         $ess_profiles->user_id = $_SESSION['user_id'];
         $ess_profiles->datetime = date("Y-m-d H:i:s");
         if ($ess_profiles->save()) {
             $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMBIOS_GUARDADOS'), 3, 'ok');
             $this->closeModalWindow();
             $this->MYLIST_reload('lst_profiles');
         } else {
             $this->messageBox($ess_profiles->getErrorLog(), 'error');
         }
     } else {
         $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMPOS_REQUERIDOS'), 3, 'error');
     }
     return $this->response;
 }
<?php

/**
 * Vista inicial.
 *
 * @author José Ignacio Gutiérrez Guzmán <*****@*****.**>
 * @link http://www.osezno-framework.org/
 * @copyright Copyright &copy; 2007-2012 Osezno PHP Framework
 * @license http://www.osezno-framework.org/license.txt
 */
/**
 * Asignar contenidos a areas de la plantilla
 */
OPF_osezno::assign('path_js_tree', BASE_URL_PATH);
if (isset($_SESSION['profile_id'])) {
    $struct_menu = new struct_menu();
    OPF_osezno::assign('menu_struct', $struct_menu->getJsMenu());
}
$ess_system_users = new ess_system_users();
$ess_system_users->find($_SESSION['user_id']);
OPF_osezno::assign('user_login', OPF_myLang::getPhrase('OPF_LOGIN_31') . '&nbsp;' . $ess_system_users->name);
OPF_osezno::assign('open_all', OPF_myLang::getPhrase('OPF_OPTIONS_1'));
OPF_osezno::assign('close_all', OPF_myLang::getPhrase('OPF_OPTIONS_2'));
OPF_osezno::assign('home_etq', '&nbsp;<b>' . OPF_myLang::getPhrase('APP_DESC') . '</b>');
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') === FALSE) {
    OPF_osezno::assign('essentials', 'OseznoPHP');
}
/**
 * Mostrar la plantilla
 */
OPF_osezno::call_template('options' . DS . 'options.tpl');
 public static function formNewScaffStep1()
 {
     $myForm = new OPF_myForm('formNewScaffStep1');
     $myForm->addComment('cm1:3', '');
     $myForm->addComment('cm2:3', '');
     $myForm->addComment('cm3:3', '');
     $myForm->addComment('cm4:3', '');
     $myForm->addComment('cm5:3', '');
     $myForm->addComment('cm6:3', '');
     $myForm->addComment('cm7:3', '');
     $table = '';
     if (isset($_SESSION['temp_scaff_info']['table_name'])) {
         $table = $_SESSION['temp_scaff_info']['table_name'];
     }
     $myForm->addHelp('table_name', OPF_myLang::getPhrase('OPF_SCAFF_39'));
     $myForm->addText(OPF_myLang::getPhrase('OPF_SCAFF_38'), 'table_name:3', $table);
     $myForm->addComment('cm8:3', '');
     $myForm->addComment('cm9:3', '');
     $myForm->addComment('cm10:3', '');
     $myForm->addComment('cm11:3', '');
     $myForm->addComment('cm12:3', '');
     $myForm->addComment('cm13:3', '');
     $myForm->addComment('cm14:3', '');
     $myForm->addComment('cm15', '');
     $myForm->addComment('cm16', '');
     $myForm->addButton('btn1', OPF_myLang::getPhrase('OPF_SCAFF_14'), 'next.gif');
     $myForm->addEvent('btn1', 'onclick', 'toScaffStep2');
     return $myForm->getForm(3);
 }
<?php

/**
 * Vista inicial.
 *
 * @author José Ignacio Gutiérrez Guzmán <*****@*****.**>
 * @link http://www.osezno-framework.org/
 * @copyright Copyright &copy; 2007-2012 Osezno PHP Framework
 * @license http://www.osezno-framework.org/license.txt
 */
/**
 * Asignar contenidos a areas de la plantilla
 */
OPF_osezno::assign('nom_modulo', OPF_myLang::getPhrase('OPF_ADMUSR_TITLE'));
OPF_osezno::assign('desc_modulo', OPF_myLang::getPhrase('OPF_ADMUSR_DESC'));
$OPF_admUsr = new OPF_admUsr();
OPF_osezno::assign('content1', $OPF_admUsr->getBtnAgrUsr());
OPF_osezno::assign('content2', $OPF_admUsr->getListUsrs());
/**
 * Mostrar la plantilla
 */
OPF_osezno::call_template('modulo/modulo.tpl');
<?php

/**
 * Vista inicial.
 *
 * @author José Ignacio Gutiérrez Guzmán <*****@*****.**>
 * @link http://www.osezno-framework.org/
 * @copyright Copyright &copy; 2007-2012 Osezno PHP Framework
 * @license http://www.osezno-framework.org/license.txt
 */
session_destroy();
/**
 * Asignar contenidos a areas de la plantilla
 */
OPF_osezno::assign('msg_close_session', OPF_myLang::getPhrase('OPF_LOGOUT_1'));
/**
 * Mostrar la plantilla
 */
OPF_osezno::call_template('logout' . DS . 'logout.tpl');
 /**
  * Obtiene campo de unica seleccion.
  *
  * Obtiene un campo de unica seleccion con los valores por parametro.
  * Opera de identica forma al metodo addSelect solo que aqui se retorna inmediatamente el codigo HTML y no se agrega a la salida del formulario.
  * @param string $name Nombre
  * @param array  $value Valor
  * @param string $selected Valor seleccionado por defecto
  * @param string $size Tamano del campo
  * @param string $truncar_hasta Truncar Numero maximo de caracteres por opcion
  * @param boolean $multiple Es un campo de seleccion multiple.
  */
 public function getSelect($name = '', $value = '', $selected = '', $size = '', $truncar_hasta = 0, $multiple = false)
 {
     $buf = '';
     $string_multiple = '';
     if ($multiple) {
         $string_multiple = ' multiple';
     }
     $buf .= "\t\t" . '<select ' . $this->checkIfIsDisabled($name) . ' ' . $this->checkIsHelping($name) . ' class="' . $this->styleClassFields . '" name="' . $name . '" id="' . $name . '"' . $string_multiple . ' size="' . $size . '" ' . $this->checkExistEventJs($name) . '>' . "\n";
     if (is_array($value)) {
         if ($this->selectUseFirstValue) {
             $buf .= "\t\t" . '<option value="">' . OPF_myLang::getPhrase($this->selectStringFirstLabelOption) . '</option>' . "\n";
         }
         $selectedIsArray = false;
         if (is_array($selected)) {
             $selectedIsArray = true;
         }
         foreach ($value as $id => $value) {
             $sel = '';
             if (!$selectedIsArray) {
                 if (!strcmp($id, $selected)) {
                     $sel = ' selected';
                 }
             } else {
                 if (in_array($id, $selected)) {
                     $sel = ' selected';
                 }
             }
             if ($truncar_hasta) {
                 $value = substr($value, 0, $truncar_hasta);
             }
             $buf .= "\t\t" . '<option value="' . $id . '"' . $sel . '>' . $value . '</option>' . "\n";
         }
         $buf .= '</select>' . "\n";
     }
     $this->arrayFormElementType[$name] = 'select';
     return $buf;
 }
<?php

/**
 * Vista inicial.
 *
 * @author José Ignacio Gutiérrez Guzmán <*****@*****.**>
 * @link http://www.osezno-framework.org/
 * @copyright Copyright &copy; 2007-2012 Osezno PHP Framework
 * @license http://www.osezno-framework.org/license.txt
 */
/**
 * Asignar contenidos a areas de la plantilla
 */
OPF_osezno::assign('nom_modulo', OPF_myLang::getPhrase('OPF_PROFILES_TITLE'));
OPF_osezno::assign('desc_modulo', OPF_myLang::getPhrase('OPF_PROFILES_DESC'));
$OPF_profiles = new OPF_profiles();
OPF_osezno::assign('content1', $OPF_profiles->getFormStartUp());
OPF_osezno::assign('content2', $OPF_profiles->getListProfiles());
/**
 * Mostrar la plantilla
 */
OPF_osezno::call_template('modulo' . DS . 'modulo.tpl');
 public function getListProfiles()
 {
     $myAct = new OPF_myActiveRecord();
     $arrRpl = array('OPF_FIELD_MODIFICAR' => OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), 'OPF_FIELD_ELIMINAR' => OPF_myLang::getPhrase('OPF_FIELD_ELIMINAR'), 'OPF_FIELD_PERFIL' => OPF_myLang::getPhrase('OPF_FIELD_PERFIL'), 'OPF_FIELD_DESCRIPCION' => OPF_myLang::getPhrase('OPF_FIELD_DESCRIPCION'), 'OPF_FIELD_USUARIO' => OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 'OPF_FIELD_DATETIME' => OPF_myLang::getPhrase('OPF_FIELD_DATETIME'), 'OPF_FIELD_MENU' => OPF_myLang::getPhrase('OPF_FIELD_MENU'));
     $myList = new OPF_myList('lst_profiles', $sql = $myAct->loadSqlFromFile(dirname(__FILE__) . DS . 'sql' . DS . 'lstProfiles.sql', $arrRpl));
     $myList->setEventOnColumn(OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), 'onClickAddRecord');
     $myList->setEventOnColumn(OPF_myLang::getPhrase('OPF_FIELD_ELIMINAR'), 'onClickDeleteRecord', OPF_myLang::getPhrase('OPF_FIELD_CONFIRM_ELIMINAR'));
     $myList->setEventOnColumn(OPF_myLang::getPhrase('OPF_FIELD_MENU'), 'onClickEditMenu');
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), 80);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_ELIMINAR'), 80);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 100);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_MENU'), 80);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_PERFIL'), 140);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_DATETIME'), 120);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_DESCRIPCION'), 400);
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_PERFIL'), 'ess_profiles.name');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_DESCRIPCION'), 'ess_profiles.description');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 'ess_system_users.user_name');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_DATETIME'), 'ess_profiles.datetime');
     $myList->setPagination(true, 20);
     $myList->setExportData(true, true, true);
     $myList->setUseOrderMethod(true, '');
     return $myList->getList(true, true);
 }
 * Asignar contenidos a areas de la plantilla
 */
$OPF_login = new OPF_login();
OPF_osezno::assign('nom_modulo', 'Essentials');
OPF_osezno::assign('desc_modulo', 'Essentials Osezno PHP Framework');
if ($OPF_login->existsDB()) {
    if ($OPF_login->existsStruct()) {
        OPF_osezno::assign('content1', $OPF_login->getFormLogin());
    } else {
        OPF_osezno::assign('content1', $OPF_login->getFormInstall('tables'));
    }
} else {
    $disabled = false;
    OPF_osezno::assign('onload', 'onLoadShowWel()');
    if (!strstr(strtoupper(ini_get('default_charset')), "UTF")) {
        $disabled = true;
    }
    if (isset($_SERVER['HTTP_ACCEPT_CHARSET'])) {
        if (!strstr(strtoupper($_SERVER['HTTP_ACCEPT_CHARSET']), "UTF")) {
            $disabled = true;
        }
    }
    if ($disabled) {
        OPF_osezno::assign('content2', '<div align="center" id="content2" class="error">' . OPF_myLang::getPhrase('OPF_LOGIN_32') . '</div>');
    }
    OPF_osezno::assign('content1', $OPF_login->getFormInstall('db', array(), $disabled));
}
/**
 * Mostrar la plantilla
 */
OPF_osezno::call_template('login' . DS . 'login.tpl');
<?php

/**
 * Vista inicial.
 *
 * @author José Ignacio Gutiérrez Guzmán <*****@*****.**>
 * @link http://www.osezno-framework.org/
 * @copyright Copyright &copy; 2007-2012 Osezno PHP Framework
 * @license http://www.osezno-framework.org/license.txt
 */
/**
 * Asignar contenidos a areas de la plantilla
 */
$user_on_line = new user_on_line();
$user_on_line->buildFiles();
OPF_osezno::assign('nom_modulo', OPF_myLang::getPhrase('OPF_USRONLINE_TITLE'));
OPF_osezno::assign('desc_modulo', OPF_myLang::getPhrase('OPF_USRONLINE_DESC'));
OPF_osezno::assign('content1', $user_on_line->buildDinamicListUsersOnLine());
/**
 * Mostrar la plantilla
 */
OPF_osezno::call_template('modulo' . DS . 'modulo.tpl');
<?php

/**
 * Vista inicial.
 *
 * @author José Ignacio Gutiérrez Guzmán <*****@*****.**>
 * @link http://www.osezno-framework.org/
 * @copyright Copyright &copy; 2007-2012 Osezno PHP Framework
 * @license http://www.osezno-framework.org/license.txt
 */
/**
 * Asignar contenidos a areas de la plantilla
 */
$OPF_passwd = new OPF_passwd();
OPF_osezno::assign('nom_modulo', OPF_myLang::getPhrase('OPF_PASSWD_TITLE'));
OPF_osezno::assign('desc_modulo', OPF_myLang::getPhrase('OPF_PASSWD_DESC'));
OPF_osezno::assign('content1', $OPF_passwd->getFormChngPasswd());
/**
 * Mostrar la plantilla
 */
OPF_osezno::call_template('modulo' . DS . 'modulo.tpl');
 public function getFormLogin()
 {
     $myForm = new OPF_myForm('frm_login');
     $myForm->setAutoComplete('user_opf_ess', false);
     $user_opf_ess = '';
     $mark = false;
     if (isset($_COOKIE['user_opf_ess'])) {
         $user_opf_ess = $_COOKIE['user_opf_ess'];
         $mark = true;
     }
     $myForm->addText(OPF_myLang::getPhrase('OPF_LOGIN_2'), 'user_opf_ess', $user_opf_ess);
     $myForm->addPassword(OPF_myLang::getPhrase('OPF_LOGIN_3'), 'passwd_opf_ess');
     $myForm->addCheckBox(OPF_myLang::getPhrase('OPF_LOGIN_5'), 'rem_usr', $mark);
     $myForm->addButton('btn_log', OPF_myLang::getPhrase('OPF_LOGIN_4'), 'ok.gif');
     $myForm->addEvent('btn_log', 'onclick', 'onClickLogIn');
     return $myForm->getForm(1);
 }
 public function getListForTableDetail()
 {
     $myAct = new OPF_myActiveRecord();
     $arrReplace = array('OPF_FIELD_MODIFICAR' => OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), 'OPF_FIELD_ELIMINAR' => OPF_myLang::getPhrase('OPF_FIELD_ELIMINAR'), 'OPF_FIELD_CODIGO' => OPF_myLang::getPhrase('OPF_FIELD_CODIGO'), 'OPF_FIELD_DESCRIPCION' => OPF_myLang::getPhrase('OPF_FIELD_DESCRIPCION'), 'OPF_FIELD_USUARIO' => OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 'OPF_FIELD_ACTUALIZADO' => OPF_myLang::getPhrase('OPF_FIELD_ACTUALIZADO'), 'master_tables_id' => $this->table_id);
     $myList = new OPF_myList('lst_tablas_detalle', $myAct->loadSqlFromFile(dirname(__FILE__) . '/sql/lst_tablas_detalle.sql', $arrReplace));
     $myList->width = 760;
     $myList->setGlobalEventOnColumn(OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), array(OPF_FIELD_ELIMINAR => 'onClickDeleteItems'));
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), 70);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_ELIMINAR'), 60);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_CODIGO'), 100);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 90);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_ACTUALIZADO'), 130);
     $myList->setWidthColumn(OPF_myLang::getPhrase('OPF_FIELD_DESCRIPCION'), 310);
     $myList->setPagination(true, 10);
     $myList->setEventOnColumn(OPF_myLang::getPhrase('OPF_FIELD_MODIFICAR'), 'onClickUpdateDetail');
     $myList->setEventOnColumn(OPF_myLang::getPhrase('OPF_FIELD_ELIMINAR'), 'onClickDeleteItems', OPF_myLang::getPhrase('OPF_FIELD_CONFIRM_ELIMINAR'));
     $myList->setExportData(true, true, true);
     $myList->setUseOrderMethod(true, OPF_myLang::getPhrase('OPF_FIELD_ACTUALIZADO'));
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_CODIGO'), 'ess_master_tables_detail.item_cod');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_DESCRIPCION'), 'ess_master_tables_detail.item_desc');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_USUARIO'), 'ess_system_users.user_name');
     $myList->setRealNameInQuery(OPF_myLang::getPhrase('OPF_FIELD_ACTUALIZADO'), 'ess_master_tables_detail.datetime');
     return $myList->getList(true);
 }