!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/proyectos/tdfonline/php/datos/   drwxr-xr-x
Free 14.77 GB of 61.93 GB (23.85%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     dt_comentario.php (3.84 KB)      -rw-rw-r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
class dt_comentario extends toba_datos_tabla
{
    function 
get_listado($filtro=array(), $order='ORDER BY t_c.id_comentario DESC')
    {
            
        
$where = array();

        if (isset(
$filtro['id_nota'])) {
            
$where[] = "t_n.id_nota = '".$filtro['id_nota']."'";
        }

        if (isset(
$filtro['estado_comentario'])) {
            if(
$filtro['estado_comentario'] == 10){ //caso especial, para traer los del usuario actual pendientes de aprobacion y los aprobados
                
$where[] = "(t_c.estado = '1' OR (t_c.estado = '0' and t_c.usuario_alta = '".toba::proyecto()->get_id()."') )";
            }else{
                
$where[] = "t_c.estado = '".$filtro['estado_comentario']."'";
            }
        }

        if (isset(
$filtro['estado_nota'])) {
            
$where[] = "t_n.estado = '".$filtro['estado_nota']."'";
        }

        if (isset(
$filtro['estado']) and count($filtro['estado'])>0) {
            
$primero true;
            foreach(
$filtro['estado'] as $estado){
                if(
$primero){
                    
$primero false;
                    
$in_estado.= $estado;
                }else{
                    
$in_estado.= ','.$estado;
                }
            }
            
$where[] = "t_c.estado IN ($in_estado) ";
        }

        if (isset(
$filtro['fecha_desde'])) {
            list(
$y,$m,$d)=explode("-",$filtro['fecha_desde']); //2011-03-31
            
$fecha_desde $y."-".$m."-".$d;
            
$where[] = "t_c.fecha_alta >= ".quote($fecha_desde);
        }
        if (isset(
$filtro['fecha_hasta'])) {
            list(
$y,$m,$d)=explode("-",$filtro['fecha_hasta']); //2011-03-31
            
$fecha_hasta $y."-".$m."-".$d." 23:59:59";
            
$where[] = "t_c.fecha_alta <= ".quote($fecha_hasta);
        }  

        if (isset(
$filtro['usuario_alta'])) {
            
$where[] = "t_c.usuario_alta = '".$filtro['usuario_alta']."'";
        }    

        
/*$sql = "SELECT
            t_c.id_comentario,
            t_c.fecha_alta,
            t_c.usuario_alta,
            t_c.texto,
            t_c.estado,
            t_c.id_nota,
            t_u.nombre,
            t_n.id_nota||' .'||t_n.titulo as nota_descripcion
        FROM
            comentario as t_c,    nota as t_n , desarrollo.apex_usuario as t_u
        WHERE t_c.id_nota = t_n.id_nota 
          AND t_u.usuario = t_c.usuario_alta
        $order";*/
        
$sql "SELECT
            t_c.id_comentario,
            t_c.fecha_alta,
            t_c.usuario_alta,
            t_c.texto,
            t_c.estado,
            t_c.id_nota,
            t_n.id_nota||' .'||t_n.titulo as nota_descripcion
        FROM
            comentario as t_c,    nota as t_n 
        WHERE t_c.id_nota = t_n.id_nota 
        
$order";        

        if (
count($where)>0) {
            
$sql sql_concatenar_where($sql$where);
        }

        
$datos toba::db('tdfonline')->consultar($sql);

        if(
count($datos)>0){
            foreach(
$datos as $key => $dato){

                
$sql "SELECT     t_u.nombre FROM desarrollo.apex_usuario as t_u    WHERE t_u.usuario = '".$dato['usuario_alta']."'";
                
$dato_usuario toba::db('tdfonline')->consultar_fila($sql);

                
$datos[$key]['nombre'] = $dato_usuario['nombre'];

                switch(
$dato['estado']){

                    case 
0:
                        
$datos[$key]['estado_descripcion'] = 'Pendiente';
                        break;

                    case 
1:
                        
$datos[$key]['estado_descripcion'] = 'Aprobado';
                        break;

                    case 
2:
                        
$datos[$key]['estado_descripcion'] = 'Rechazado';
                        break;

                    case 
3:
                        
$datos[$key]['estado_descripcion'] = 'Cancelado';
                        break;

                    default:
                        
$datos[$key]['estado_descripcion'] = 'Sin definir';
                }
            }
        }

        return 
$datos;
    }


    function 
get_descripciones()
    {
        
$sql "SELECT id_comentario, usuario_alta FROM comentario ORDER BY usuario_alta";
        return 
toba::db('tdfonline')->consultar($sql);
    }

    function 
set_estado($id_comentario,$estado){
        
$sql "UPDATE comentario SET estado = $estado WHERE id_comentario = '$id_comentario'";
        
toba::db('tdfonline')->ejecutar($sql);    
    }

    function 
insertar($datos){
        

        
$sql "INSERT INTO comentario(fecha_alta, usuario_alta, texto, id_nota, estado)    
                VALUES ('"
.$datos['fecha_alta']."', '".$datos['usuario_alta']."', '".$datos['texto']."', '".$datos['id_nota']."', '".$datos['estado']."');";

        try {
            
toba::db('tdfonline')->ejecutar($sql);
            return 
true;
        } catch (
Exception $e) {
            return 
false;
        }
    }

}
?>

:: 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: 0.7951 ]--