Hola Charly, tengo una Web creada con TWeb para php, y cuando la ejecuto en forma local se ejecuta en forma correcta pero cuando la subo a un servidor Linux me tira el siguiente error:
Fatal error: Class 'TSession' not found in /home/ca141014/public_html/index2.php on line 11
Código: Seleccionar todo
<?php
include_once( 'config.php' );
include_once( 'config_db.php' );
include ( TWEB_PATH . 'core.php' );
include_once( 'pantalla.php' );
define ( 'IMATGE', 'images/LogoB03.png' );
define ( 'TITLE', 'Sistema de Registro de Productor Forestal' );
// Autenticación...
$oSessio = new TSession( APP_NAME );
$oSessio->Valid( URL_APP );
// ----------------------------------------------------------------------------
$oFont = new TFont( 'Verdana', 14, true, true, false, CLR_GRAY );
$oWeb = new TWeb( 'Dir. General de Bosques y Fauna...' );
$oWeb->SetIcon( 'images/Ico_Bosques.png' );
// $oWeb->SetColor( CLR_HGRAY );
$oWeb->SetBackground( 'images/Fondo_Agri.jpg' );
// $oWeb->SetBrush( 'images/stucco.gif' );
$oWeb->Activate();
?>
<script>
function Especies() {
var oOptions = new Object();
oOptions[ 'title' ] = 'Listado de Especies';
oOptions[ 'modal' ] = true;
oOptions[ 'centered' ] = true ;
oOptions[ 'resizable' ] = false;
oOptions[ 'dialogextend'] = false;
TLoadDialog( null, 'src/view/Lista_especies.php', null, oOptions )
}
function Consultar_Guia() {
var oOptions = new Object();
oOptions[ 'title' ] = 'Consulta de GuÃa';
oOptions[ 'modal' ] = true;
oOptions[ 'centered' ] = true ;
oOptions[ 'resizable' ] = false;
oOptions[ 'dialogextend'] = false;
TLoadDialog( null, 'src/view/Consu_Guia.php', null, oOptions )
}
function Lis_Legajos() {
var oOptions = new Object();
oOptions[ 'title' ] = 'Consultar Legajos';
oOptions[ 'modal' ] = true;
oOptions[ 'centered' ] = true ;
oOptions[ 'resizable' ] = false;
oOptions[ 'dialogextend'] = false;
TLoadDialog( null, 'src/view/Lista_legajo.php', null, oOptions )
}
function asig_plan() {
var oOptions = new Object();
oOptions[ 'title' ] = 'Asignar Plan';
oOptions[ 'modal' ] = true;
oOptions[ 'centered' ] = true ;
oOptions[ 'resizable' ] = false;
oOptions[ 'dialogextend'] = false;
var oParam = new Object();
oParam[ 'id_tipo' ] = 1
TLoadDialog( null, 'src/view/Asigna_plan.php', oParam, oOptions )
}
function Regis_Produ() {
var oOptions = new Object();
oOptions[ 'title' ] = 'Registrar Productor';
oOptions[ 'modal' ] = true;
oOptions[ 'centered' ] = true ;
oOptions[ 'resizable' ] = false;
oOptions[ 'dialogextend'] = false;
var oParam = new Object();
oParam[ 'id_tipo' ] = 1
TLoadDialog( null, 'src/view/Registrar.php', oParam, oOptions )
}
function Regis_Propie() {
var oOptions = new Object();
oOptions[ 'title' ] = 'Registrar Propiedad';
oOptions[ 'modal' ] = true;
oOptions[ 'centered' ] = true ;
oOptions[ 'resizable' ] = false;
oOptions[ 'dialogextend'] = false;
var oParam = new Object();
oParam[ 'id_tipo' ] = 2
TLoadDialog( null, 'src/view/Registrar_Propie.php', oParam, oOptions )
}
function Regis_Empresa() {
var oOptions = new Object();
oOptions[ 'title' ] = 'Registrar Empresa';
oOptions[ 'modal' ] = true;
oOptions[ 'centered' ] = true ;
oOptions[ 'resizable' ] = false;
oOptions[ 'dialogextend'] = false;
var oParam = new Object();
oParam[ 'id_tipo' ] = 2
TLoadDialog( null, 'src/view/Registrar_Empre.php', oParam, oOptions )
}
function Propiedades() {
var oOptions = new Object();
oOptions[ 'title' ] = 'Propiedades de un Productor Determinado';
oOptions[ 'centered' ] = true ;
oOptions[ 'modal' ] = true;
oOptions[ 'resizable' ] = false;
oOptions[ 'dialogextend'] = false;
TLoadDialog( null, 'src/view/Propiedades.php', null, oOptions )
}
function Establecimientos() {
var oOptions = new Object();
oOptions[ 'title' ] = 'Establecimientos de un Operador Determinado';
oOptions[ 'centered' ] = true ;
oOptions[ 'modal' ] = true;
oOptions[ 'resizable' ] = false;
oOptions[ 'dialogextend'] = false;
TLoadDialog( null, 'src/view/Establecimientos.php', null, oOptions )
}
function Planes() {
var oOptions = new Object();
oOptions[ 'title' ] = 'Listado de Programas - Beneficios';
oOptions[ 'centered' ] = true ;
oOptions[ 'modal' ] = true;
oOptions[ 'resizable' ] = false;
oOptions[ 'dialogextend'] = false;
TLoadDialog( null, 'src/view/lista_planes.php', null, oOptions )
}
function Exe_Warning() { MsgInfo( 'Warning...' ); }
function Exe_Config() { MsgInfo( 'Config...' ); }
function Exe_Exit() { MsgInfo( 'Exit...' ); }
function Exe_Invoice() { MsgInfo( 'Invoice...' ); }
function Exe_Report() { MsgInfo( 'Reporting...' ); }
function Listar_Todos() {
var oOptions = new Object();
oOptions[ 'title' ] = 'Propiedades de un Productor Determinado';
oOptions[ 'centered' ] = true ;
oOptions[ 'modal' ] = true;
oOptions[ 'resizable' ] = false;
oOptions[ 'dialogextend'] = false;
TLoadDialog( null, 'src/view/Lista_produ_todos.php', null, oOptions )
}
function Exe_Warning() { MsgInfo( 'Warning...' ); }
function Exe_Config() { MsgInfo( 'Config...' ); }
function Exe_Exit() { MsgInfo( 'Exit...' ); }
function Exe_Invoice() { MsgInfo( 'Invoice...' ); }
function Exe_Report() { MsgInfo( 'Reporting...' ); }
function Logout() {
if ( ! MsgYesNo( 'Cerrar sesión ?' ) )
return null
var oPar = new Object();
oPar[ 'action' ] = 'logout';
MsgServer( 'src/control/c_access.php', Logout_Post, oPar );
}
function Logout_Post( dat ) {
window.location.href = 'index.php';
}
</script>
<?php
$cLang = TGet( 'lang', 'ES' );
$oWnd = new TWindow();
// Puedes ver documentacion de los parámetros en http://ignitersworld.com/lab/contextMenu.html
// TWeb_SetupBtnItems( array( 'triggerOn' => 'hover') );
$oTitle = new TPanel( $oWnd, 'main_A', 0, 0, '100%', 25, '#3d3d80' );
$oImg = new TImage( $oTitle, null, 5, 5 , 'images/Ico_Bosques.png', 16, 16 );
$oSay = new TSay( $oTitle, null, 1, 30, 'Sistema de Registro de Productor Forestal',500 );
$oSay->SetFont( $oFont );
$oMenu = new TMenu( $oWnd, 'my_menu', 25 );
$oSubMenu = $oMenu->AddMenu( 'A0', 'Legajos', '' , '' );
$oSubMenu->AddItem( 'A0_1', 'Consulta', 'Lis_Legajos' , '' );
$oSubMenu = $oMenu->AddMenu( 'A1', 'Productores' );
$oSubMenu->AddItem( 'A1_1', 'Registrar', 'Regis_Produ' , '' );
$oSubMenu->AddItem( 'A1_2', 'Propiedades', 'Propiedades', '' );
// $oSubMenu->AddItem( 'A1_3', 'Actualizar', 'Exe_Config' , "images/tools.png" );
$oSubMenu->AddItem( 'A1_3', 'GuÃas', 'Consultar_Guia', '' );
$oLis =$oSubMenu->AddItem( 'A1_4', 'Listar', null, '' );
$oLis->AddItem( 'A1_4A', 'Todos' , '', '' );
$oLis->AddItem( 'A1_4B', 'p/Departamento', '' , '' );
$oLis->AddItem( 'A1_4C', 'p/CategorÃa', '', '' );
$oLis = $oSubMenu->AddItem( 'A1_5', 'Informes', null, '' );
$oSubMenu = $oMenu->AddMenu( 'A2', 'Propiedades' );
$oSubMenu->AddItem( 'A2_1', 'Registrar' , 'Regis_Propie', '' );
$oLis =$oSubMenu->AddItem( 'A2_2', 'Planes', null, '' );
$oLis->AddItem( 'A2_2A', 'Asignar', 'asig_plan', '' );
$oLis->AddItem( 'A2_2B', 'Consultar', '', '' );
$oLis->AddItem( 'A2_2C', 'Listar', '', '' );
$oSubMenu->AddItem( 'A2_3', 'Listar' , '', '' );
$oSubMenu->AddItem( 'A2_4', 'Informes' , '', '' );
$oSubMenu = $oMenu->AddMenu( 'A3', 'Empresas Forestales' );
$oSubMenu->AddItem( 'A3_1', 'Registrar' , 'Regis_Empresa', '' );
$oSubMenu->AddItem( 'A3_3', 'Listar' , '', '' );
$oSubMenu->AddItem( 'A3_4', 'Informes' , '', '' );
$oSubMenu = $oMenu->AddMenu( 'A4', 'Parámetros' );
$oSubMenu->AddItem( 'A4_1', 'Especies', 'Especies', '' );
$oSubMenu->AddItem( 'A4_2', 'Planes', '', '' );
$oSubMenu = $oMenu->AddMenu( 'A5', 'Salir' );
$oSubMenu->AddItem( 'A5_1', 'Salir' , 'Logout' , "images/clip.png" );
$oPanel = new TPanel( $oWnd, 'main_B', 50, 0, '100%', 70, CLR_HGRAY );
$oPanel = new TPanel( $oWnd, 'mypanel', 50, 1, null, null );
$oPanel->SetRight( 10 );
$oPanel->SetBottom( 10 );
$oPanel->SetBorderInset();
$oPanel->AddDialog( 'Main_Logo' , 'Dlg_Logo' );
$oPanel->AddDialog( 'Main_Modul', 'Dlg_Panel' );
$oPanel->cId_Init = 'Main_Logo' ;
$oWnd->Activate();
$oWeb->End();
$oWeb->ViewLog();
function Dlg_Logo() {
$oWnd = new TPanel( null, 'Main_Logo', 0, 0, '100%', '100%' );
// $o = new TLogo( $oWnd, 'logo_main', 'images/Fondo_.png' ); // 124 Kb.
$oWnd->Activate();
}
function Dlg_Panel() {
$nAncho = $_SESSION['PantallaAncho'];
$oWnd = new TPanel( null, 'Main_Panel', 0, 0, '100%', '100%' );
$o = new TImage( $oWnd, 'inicio' , 0.1, 0.1, IMATGE, $nAncho,140 ); //1400
$o->SetBorderInset();
$o->SetShadow();
$oWnd->Activate();
}
?>
[code]
a continuación pongo el código del congif.php
[code]
<?php
// Descripció del Programa...
define( "APP_NAME" , "SiGFoD" );
define( "APP_VERSIO" , "0.123" );
define( "APP_DESCRIPCIO" , "Sistema de Guias Forestales Digitales" );
define( "APP_FIRST_UPDATE" , "01/08/2020" );
define( "APP_LAST_UPDATE" , "27/08/2020" );
define( "APP_AUTOR" , "3D Computación - Ing. Carlos A. Ducca" );
// Definició de Paths...
// Si ejecutamos en XAMPP...
if ( $_SERVER['SERVER_NAME'] == 'localhost' ) {
define( "__CONFIG__" , true );
define( 'TWEB_PATH' , 'tweb/' ); // Path relativo. Obligatorio definir esta variable para la carga de las librerias TWEB
// FOLDER_TWEB debe marcar la ruta donde esta instalado TWeb desde el Root.
// SI por ejemplo tienes instalada Tweb en el directorio de pruebas entonces tu deberas especificar 'pruebas/tweb'
define( 'FOLDER_TWEB' , 'tweb/tweb' );
define( 'ABSPATH' , $_SERVER['DOCUMENT_ROOT'] . '/' . FOLDER_TWEB . '/' );
// -------------------------------------------------------------------------------
define( 'PATH_TWEB' , ABSPATH );
define( 'PATH_APP' , dirname( __FILE__ ) );
define( 'PATH_SRC' , PATH_APP . '/src/' );
define( 'PATH_VIEW' , PATH_APP . '/src/view/' );
define( 'PATH_MODEL' , PATH_APP . '/src/model/' );
define( 'PATH_CONTROL' , PATH_APP . '/src/control/' );
define( 'PATH_IMAGES' , 'images/' );
define( 'PATH_OUTPUT' , PATH_APP . "/output/" );
define( 'PATH_LOG' , PATH_APP . "/output/log/");
define( 'PATH_UPLOAD' , PATH_APP . "/output/upload/");
define( 'PATH_TMP' , PATH_APP . "/output/tmp/");
define( 'PATH_REPORT' , PATH_APP . "/output/report/");
define( 'PATH_LIB' , PATH_APP . "/lib/");
define( 'PATH_TCPDF' , ABSPATH . "/libs/tcpdf/");
define( 'URL_APP' , "index.php");
} else {
// En este caso la configuración es la misma, pero podria ser que segun como
// este configurado el servidor, podriamnos cambiarlo de esta manera.
define( "__CONFIG__" , true );
define( 'TWEB_PATH' , '../../../tweb/' ); // Path relativo. Obligatorio definir esta variable para la carga de las librerias TWEB
define( 'FOLDER_TWEB' , 'tweb' );
define( 'ABSPATH' , $_SERVER['DOCUMENT_ROOT'] . '/' . FOLDER_TWEB . '/' );
define( 'PATH_TWEB' , ABSPATH );
define( 'PATH_APP' , dirname( __FILE__ ) );
define( 'PATH_SRC' , PATH_APP . '/src/' );
define( 'PATH_VIEW' , PATH_APP . '/src/view/' );
define( 'PATH_MODEL' , PATH_APP . '/src/model/' );
define( 'PATH_CONTROL' , PATH_APP . '/src/control/' );
define( 'PATH_IMAGES' , 'images/' );
define( 'PATH_OUTPUT' , PATH_APP . "/output/" );
define( 'PATH_LOG' , PATH_APP . "/output/log/");
define( 'PATH_UPLOAD' , PATH_APP . "/output/upload/");
define( 'PATH_TMP' , PATH_APP . "/output/tmp/");
define( 'PATH_REPORT' , PATH_APP . "/output/report/");
define( 'PATH_LIB' , PATH_APP . "/lib/");
//define( 'PATH_TCPDF' , PATH_APP . "/lib/tcpdf/");
define( 'PATH_TCPDF' , ABSPATH . "/libs/tcpdf/");
define( 'URL_APP' , "index.php");
}
// Configuración Errores...
ini_set('display_errors', 1);
ini_set('log_errors', 1);
error_reporting( E_ERROR | E_PARSE );
// Mostraremos en la barra inferior en que entorno trabajamos, si es local o en internet
function Server() {
$cServer = strtolower( $_SERVER['SERVER_NAME'] ) ;
if ( $cServer == 'localhost' ) {
$cTxt = 'Server Local';
} else {
$cTxt = $cServer;
}
return $cTxt;
}
// Funciones de soporte
// Validacion de datos de la autenticacion...
function App_GetUser() {
$oSessio = new TSession( APP_NOM );
return $oSessio->GetUser();
}
function App_GetIp() {
$oSessio = new TSession( APP_NOM );
return $oSessio->GetIp();
}
function App_GetModuls() {
$oSessio = new TSession( APP_NOM );
return $oSessio->GetVar( 'aModuls');
}
function App_GetVars() {
$oSessio = new TSession( APP_NOM );
return $oSessio->GetVars();
}
/* Level:
-1.- NO
0.- Lectura
1.- Escritura
*/
function App_Permis( $cModul = '', $lExit = true ) {
$nLevel = -1;
$cModul = strtoupper( $cModul );
$oSessio = new TSession( APP_NOM );
$cId_Perfil = $oSessio->GetVar( 'id_perfil');
if ( $cId_Perfil == 'ALL' ) {
$nLevel = 1;
} else {
$aModuls = $oSessio->GetVar( 'aModuls');
if ( gettype($aModuls) == 'array' ) {
foreach ( $aModuls as $aReg ) {
if ( $aReg[ 'modul' ] == $cModul ) {
$nLevel = ( $aReg[ 'editar' ] ) ? 1 : 0;
break;
}
}
} else {
$nLevel = -1;
}
}
if ( $nLevel === -1 && $lExit ) {
header("HTTP/1.0 902 SysError 1" );
exit();
}
return $nLevel;
}
?>