!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_tdfonline/php/nucleo/lib/   drwxr-xr-x
Free 14.92 GB of 61.93 GB (24.09%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     toba_info_relacion_entre_tablas.php (1.78 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
 * @package Fuentes
 */
class toba_info_relacion_entre_tablas
{
    static protected 
$relaciones = array();

    static function 
cargar_relaciones($fuente_datos$proyecto=null)
    {
        
self::$relaciones[$fuente_datos] = toba_proyecto::get_info_relacion_entre_tablas($fuente_datos$proyecto);
    }

    
/**
    *    Indica las columnas por las que se relacionan dos tablas de un modelo de datos
    *    retorna un array asociativo con un indice por tabla y un array con el listado de columnas en la segunda dimension.
    */
    
static function get_relacion($tabla_1$tabla_2$fuente_datos=null$proyecto=null)
    {
        if(!
$fuente_datos$fuente_datos toba_admin_fuentes::instancia()->get_fuente_predeterminada(true$proyecto);
        if(!isset(
self::$relaciones[$fuente_datos]) ) {
            
self::cargar_relaciones($fuente_datos$proyecto);    
        }
        
//Busco la relacion
        
if(isset(self::$relaciones[$fuente_datos][$tabla_1][$tabla_2])) {
            
$respuesta[$tabla_1]=self::$relaciones[$fuente_datos][$tabla_1][$tabla_2]['cols_1'];
            
$respuesta[$tabla_2]=self::$relaciones[$fuente_datos][$tabla_1][$tabla_2]['cols_2'];
        } else {
            
//La busco con el indice invertido
            
if(isset(self::$relaciones[$fuente_datos][$tabla_2][$tabla_1])) {
                
$respuesta[$tabla_1]=self::$relaciones[$fuente_datos][$tabla_2][$tabla_1]['cols_2'];
                
$respuesta[$tabla_2]=self::$relaciones[$fuente_datos][$tabla_2][$tabla_1]['cols_1'];
            } else {
                throw new 
toba_error('Informacion del modelo de datos de la fuente: '$fuente_datos ". No existe la relacion: $tabla_1 - $tabla_2);
            }
        }
        return 
$respuesta;
    }

    
/**
     * Controla que un grupo de tablas esten vinculadas por Fks
     * @param Array de tablas ordenadas segun su relacion
     * @todo IMPLEMENTAR!
     */
    
static function validar_camino($camino)
    {
        
    }
}

?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 1.0086 ]--