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


Viewing file:     ci_notas.php (19.13 KB)      -rw-rw-r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
class ci_notas extends toba_ci
{
    protected 
$s__datos_filtro;
    protected 
$s__id_nota;
    protected 
$s__secciones;
    protected 
$s__datos;

    protected 
$s__DOCS_SLIM         =  array("foto""foto_2""foto_3");
    protected 
$s__EXT_IMAGEN         =  array(".png",".bmp",".gif",".jpg",".jpe",".jpeg",".PNG",".BMP",".GIF",".JPG",".JPE",".JPEG");


    
//-----------------------------------------------------------------------------------
    //---- Configuraciones --------------------------------------------------------------
    //-----------------------------------------------------------------------------------

    
function conf()
    {
        if (!empty(
$_REQUEST['ai'])){
            
$pos strpos($_REQUEST['ai'], '||')+2;
            
$operacion substr($_REQUEST['ai'],$pos);
            if (
$operacion == '3477'){
                
$this->set_pantalla('pant_edicion');
                
$this->pantalla()->eliminar_evento('volver');
            }
        }  
    }


    
//---- Filtro -----------------------------------------------------------------------

    
function conf__filtro(toba_ei_formulario $filtro)
    {
        if (isset(
$this->s__datos_filtro)) {
            
$filtro->set_datos($this->s__datos_filtro);
        }
    }

    function 
evt__filtro__filtrar($datos)
    {
        
$this->s__datos_filtro $datos;
    }

    function 
evt__filtro__cancelar()
    {
        unset(
$this->s__datos_filtro);
    }

    
//---- Cuadro -----------------------------------------------------------------------

    
function conf__cuadro(toba_ei_cuadro $cuadro)
    {

        
$limit $cuadro->get_tamanio_pagina();
        
$offset $limit * ($cuadro->get_pagina_actual() - 1);
        
        
$filtro $this->s__datos_filtro;
        
$filtro['string_limit'] = "LIMIT $limit OFFSET $offset";
    
        
$total_registros $this->dep('datos')->tabla('nota')->get_total_registros($filtro);
        
$this->s__datos $this->dep('datos')->tabla('nota')->get_listado($filtro);
        
        
$cuadro->set_total_registros($total_registros);
        
$cuadro->set_datos($this->s__datos);
    }

    function 
evt__cuadro__eliminar($datos)
    {
        
/*
        $this->dep('datos')->resetear();
        $this->dep('datos')->cargar($datos);
        $this->dep('datos')->eliminar_todo();
        $this->dep('datos')->resetear();
        */

        
if($this->dep('datos')->tabla('nota')->eliminar_nota($datos['id_nota'])){
            
toba::notificacion()->agregar("Nota ".$seleccion['id_nota']." eliminada.""info");
        }
    }

    function 
evt__cuadro__seleccion($datos)
    {
        
$this->s__id_nota $datos['id_nota'];

        
$this->dep('datos')->cargar($datos);
        
$this->set_pantalla('pant_edicion');
    }


    function 
evt__cuadro__activar_desactivar($datos)
    {
        
$this->dep('datos')->tabla('nota')->activar_desactivar($datos['id_nota']);
        
$this->resetear();
    }

    function 
conf_evt__cuadro__activar_desactivar($evento$fila)
    {
        if (
$this->s__datos[$fila]['estado'] == 'A') {
            
#$evento->anular();  
            #$evento->set_etiqueta('Desactivar');
            
$evento->set_imagen('no-visible.png');

        }elseif(
$this->s__datos[$fila]['estado'] == 'I') {
            
#$evento->anular();
            #$evento->set_etiqueta('Activar');
            
$evento->set_imagen('visible.png');
        }else{
            
$evento->anular();
        }
    }

    
//---- Formulario -------------------------------------------------------------------

    
function conf__formulario(toba_ei_formulario $form)
    {
        if (
$this->dep('datos')->esta_cargada()) {

            
$datos $this->dep('datos')->tabla('nota')->get();    
            
//----Secciones-----------------------------------------------
            
$secciones $this->dep('datos')->tabla('seccion_nota')->get_filas(nulltrue);
            
            
$array_seleccionados = array();
            if(
count($secciones)>0){
                foreach (
$secciones as $s){
                    
$array_seleccionados[] = $s['id_seccion'];
                }
            }
            
            
$datos['secciones'] = $array_seleccionados;
            
//------------------------------------------------------------


        
}

        
//Imagenes docs ------------------------
        
$et_drop  "Arrastra la imagen aqu&iacute;"
        foreach (
$this->s__DOCS_SLIM as $value) {

            
$img '';
            if(
is_file('fotos/'.$datos[$value])){
                
$img '<img src="fotos/'.$datos[$value].'?'.time().'" alt="">';
            }
            
$img .= '<input type="file" name="slim_'.$value.'" required />'//input para agregar

            /*
            https://www.easycalculation.com/es/area/aspectratio.php
            360x230  1.57:1 (72:46)
            760 x 480 (190:120)
            750 x 440 1.70:1 (150:88)
            */
            
switch ($value) { 
                case 
'foto':
                    
$datos["script_cropper_$value"] ='
                    <link rel="stylesheet" href="css/slim.min.css">
                    
                    <div class="slim" style="border-radius: 10px; width: 360px; height: 212px; margin-bottom:20px" 
                            data-label="'
.$et_drop.'"
                            data-size="750,440"
                            data-ratio="150:88"> 
                        '
.$img.'
                    </div>
                    '
;    
                    break;
                case 
'foto_2':

                    
$datos["script_cropper_$value"] ='
                    <div class="slim" style="border-radius: 10px; width: 360px; height: 212px; margin-bottom:20px" 
                            data-label="'
.$et_drop.'"
                            data-size="750,440"
                            data-ratio="150:88"> 
                        '
.$img.'
                    </div>'
;    
                    break;  
//750 x 480

                
case 'foto_3':

                    
$datos["script_cropper_$value"] ='
                    <div class="slim" style="border-radius: 10px; width: 360px; height: 212px; margin-bottom:20px" 
                            data-label="'
.$et_drop.'"
                            data-size="750,440"
                            data-ratio="150:88">  
                        '
.$img.'
                    </div>
                    <script src="js/slim.kickstart.min.js?'
.time().'"></script>';    
                    break;

            }
    
        }

        
//----------------------------------------


        
$form->set_datos($datos);


    }

    function 
evt__formulario__modificacion($datos)
    {
        
        
//subimos archivo de foto
        
$folder_path "../www/fotos/";
        
$folder_path_audio "../www/audios/";
        
$folder_path_video "../www/videos/";
        
$folder_path_docs "../www/docs/";
        if (empty(
$this->s__id_nota)) { //agrega

            //---------------audio nota -----------
            
if (isset($datos['audio']) and !empty($datos['audio']['name'])) {// Mover audio al servidor.
                    
$nombre_audio date("YmdHis").'_'.$datos['audio']['name'];
                    
$destino$folder_path_audio.$nombre_audio;
                    
move_uploaded_file($datos['audio']['tmp_name'], $destino ) ;
                    if ( 
is_file$destino ) ){// Le asigno solo el nombre al audio para que se guarde en la base y no de error
                            
$datos['audio'] = $nombre_audio;
                    }
            }else{
                    
$datos['audio'] = $datos['audio']['name'];
            }

            
//---------------video_mp4 nota -----------
            
if (isset($datos['video_mp4']) and !empty($datos['video_mp4']['name'])) {// Mover video al servidor.
                    
$nombre_video_mp4 date("YmdHis").'_'.$datos['avideo_mp4udio']['name'];
                    
$destino$folder_path_video.$nombre_video_mp4;
                    
move_uploaded_file($datos['video_mp4']['tmp_name'], $destino ) ;
                    if ( 
is_file$destino ) ){// Le asigno solo el nombre al video para que se guarde en la base y no de error
                            
$datos['video_mp4'] = $nombre_video_mp4;
                    }
            }else{
                    
$datos['video_mp4'] = $datos['video_mp4']['name'];
            }

            
//foto_autor-------------------------------------------------------
            
if (isset($datos['foto_autor']) and !empty($datos['foto_autor']['name'])) {// Mover foto_autor al servidor.
                    
$nombre_foto_autor date("YmdHis").'_'.$datos['foto_autor']['name'];
                    
$destino$folder_path.$nombre_foto_autor;
                    
move_uploaded_file($datos['foto_autor']['tmp_name'], $destino ) ;
                    if ( 
is_file$destino ) ){// Le asigno solo el nombre al foto_autor para que se guarde en la base y no de error
                            
$datos['foto_autor'] = $nombre_foto_autor;
                    }
            }else{
                    
$datos['foto_autor'] = $datos['foto_autor']['name'];
            }


            
//adjunto-------------------------------------------------------
            
if (isset($datos['adjunto']) and !empty($datos['adjunto']['name'])) {// Mover adjunto al servidor.
                    
$nombre_adjunto date("YmdHis").'_'.$datos['adjunto']['name'];
                    
$destino$folder_path_docs.$nombre_adjunto;
                    
move_uploaded_file($datos['adjunto']['tmp_name'], $destino ) ;
                    if ( 
is_file$destino ) ){// Le asigno solo el nombre al adjunto para que se guarde en la base y no de error
                            
$datos['adjunto'] = $nombre_adjunto;
                    }
            }else{
                    
$datos['adjunto'] = $datos['adjunto']['name'];
            }


        }else{ 
//modificacion

            //audio nota ----------------------------------------------------------
            
if (isset($datos['audio']) and !empty($datos['audio']['name'])) {
                    
$nombre_audio date("YmdHis").'_'.$datos['audio']['name']; 
                    
$destino $folder_path_audio.$nombre_audio;
                    
move_uploaded_file($datos['audio']['tmp_name'], $destino ) ;
                    if ( 
is_file$destino ) ){
                            
$datos['audio'] = $nombre_audio;
                    }
            }elseif (isset(
$datos['audio']) and empty($datos['audio']['name'])) {
                    
$datos['audio'] = $datos['audio']['name'];
                   
            }else{
                            
                    
//Mantener el valor anterior 
                    
$url$this->dep('datos')->tabla('nota')->get_audio($this->s__id_nota);
                    if(empty(
$url['audio'])){
                            
$datos['audio'] = $datos['audio']['name'];
                    }else{
                            
$datos['audio'] = $url['audio'];
                    }
            }

            
//video_mp4 nota ----------------------------------------------------------
            
if (isset($datos['video_mp4']) and !empty($datos['video_mp4']['name'])) {
                    
$nombre_video_mp4 date("YmdHis").'_'.$datos['video_mp4']['name']; 
                    
$destino $folder_path_video.$nombre_video_mp4;
                    
move_uploaded_file($datos['video_mp4']['tmp_name'], $destino ) ;
                    if ( 
is_file$destino ) ){
                            
$datos['video_mp4'] = $nombre_video_mp4;
                    }
            }elseif (isset(
$datos['video_mp4']) and empty($datos['video_mp4']['name'])) {
                    
$datos['video_mp4'] = $datos['video_mp4']['name'];
                   
            }else{
                            
                    
//Mantener el valor anterior 
                    
$url$this->dep('datos')->tabla('nota')->get_video($this->s__id_nota);
                    if(empty(
$url['video_mp4'])){
                            
$datos['video_mp4'] = $datos['video_mp4']['name'];
                    }else{
                            
$datos['video_mp4'] = $url['video_mp4'];
                    }
            }


            
//foto_autor ----------------------------------------------------------
            
if (isset($datos['foto_autor']) and !empty($datos['foto_autor']['name'])) {
                    
$nombre_foto_autor date("YmdHis").'_'.$datos['foto_autor']['name']; 
                    
$destino=$folder_path.$nombre_foto_autor;
                    
move_uploaded_file($datos['foto_autor']['tmp_name'], $destino ) ;
                    if ( 
is_file$destino ) ){
                            
$datos['foto_autor'] = $nombre_foto_autor;
                    }
            }elseif (isset(
$datos['foto_autor']) and empty($datos['foto_autor']['name'])) {
                    
$datos['foto_autor'] = $datos['foto_autor']['name'];
            }else{
                
                
//Mantener el valor anterior 
                
$url$this->dep('datos')->tabla('nota')->get_foto_autor($this->s__id_nota);
                if(empty(
$url['foto_autor'])){
                        
$datos['foto_autor'] = $datos['foto_autor']['name'];
                }else{
                        
$datos['foto_autor'] = $url['foto_autor'];
                }
            }

            
//adjunto ----------------------------------------------------------
            
if (isset($datos['adjunto']) and !empty($datos['adjunto']['name'])) {
                    
$nombre_adjunto date("YmdHis").'_'.$datos['adjunto']['name']; 
                    
$destino=$folder_path_docs.$nombre_adjunto;
                    
move_uploaded_file($datos['adjunto']['tmp_name'], $destino ) ;
                    if ( 
is_file$destino ) ){
                            
$datos['adjunto'] = $nombre_adjunto;
                    }
            }elseif (isset(
$datos['adjunto']) and empty($datos['adjunto']['name'])) {
                    
$datos['adjunto'] = $datos['adjunto']['name'];
            }else{
                
                
//Mantener el valor anterior 
                
$url$this->dep('datos')->tabla('nota')->get_adjunto($this->s__id_nota);
                if(empty(
$url['adjunto'])){
                        
$datos['adjunto'] = $datos['adjunto']['name'];
                }else{
                        
$datos['adjunto'] = $url['adjunto'];
                }
            }


        }

        
        if (empty(
$this->s__id_nota)) { //agrego, buscamos el ultimo id
        
$datos['fecha_alta']    = date("Y-m-d H:i:s");
        
$datos['usuario_alta']     = toba::usuario()->get_id();                                     
        }


        
//seteamos secion de secciones
        
$this->s__secciones $datos['secciones'];


        
//reemplazamos divs del html de nota, por parrafos
        
$datos['nota'] = str_replace("<div>""<p>"$datos['nota']);
        
$datos['nota'] = str_replace("</div>""</p>"$datos['nota']);
        



        
//SLIM------------------------
        
require_once('slim.php');

        
// Get posted data
        #$images = Slim::getImages("slim_foto");
        
        
foreach ($this->s__DOCS_SLIM as $value) {

            
$images Slim::getImages("slim_$value"); //$inputName = 'slim'

            // No image found under the supplied input name
            
if ($images == false) {

                if (
$datos["remover_$value"] == ) {  //b=/(\.png|\.bmp|\.gif|\.jpg|\.jpe|\.jpeg
                    
                    
$picture '';
                    
/*foreach ($this->s__EXT_IMAGEN as $ext) {
                        if(is_file('fotos/'.$this->s__id_preinscripcion.'_'.$value.$ext)){
                            $picture = 'fotos/'.$this->s__id_preinscripcion.'_'.$value.$ext;
                            break;
                        }
                    }*/
                    
if(is_file('fotos/'.$datos[$value])){
                        
$picture 'fotos/'.$datos[$value];
                    }

                    if(!empty(
$picture)){ 
                     @
unlink($picture);  
                    }

                    
$datos[$value] = null;
                }

            }else{

                
// Could be multiple slim croppers
                
foreach ($images as $image) {

                    
$files = array();

                    
// save output data if set
                    
if (isset($image['output']['data'])) {

                        
// Save the file
                        
$extension substr($image['output']['name'], -44);
                        if(
$extension =='jpeg'){ $extension =='.jpeg';} //b=/(\.png|\.bmp|\.gif|\.jpg|\.jpe|\.jpeg
                        
                        //$name = $this->s__id_preinscripcion.'_'.$value.strtolower($extension); 
                        
$name date("YmdHis").'_'.$value.strtolower($extension); 

                        
//revisa si hay otro archivo con el numero pero de otra extension, para quitarlo
                        /*foreach ($this->s__EXT_IMAGEN as $ext) {
                            if(is_file('docs/'.$this->s__id_preinscripcion.'_'.$value.$ext) and $extension <> $ext){
                                $picture = 'docs/'.$this->s__id_preinscripcion.'_'.$value.$ext;
                                @unlink($picture);
                                //break;
                            }
                        }*/

                        // We'll use the output crop data
                        
$data $image['output']['data'];

                        
// If you want to store the file in another directory pass the directory name as the third parameter.
                        
$file Slim::saveFile($data$name$folder_pathfalse);
                        
$output Slim::saveFile($data$name);
                        
array_push($files$output);
                        @
unlink($output['path']);    


                        
$datos[$value] = $name;                    
                    }

                    
// save input data if set
                    
if (isset ($image['input']['data'])) {

                        
// Save the file
                        
$extension substr($image['input']['name'], -44);
                        if(
$extension =='jpeg'){ $extension =='.jpeg';} //b=/(\.png|\.bmp|\.gif|\.jpg|\.jpe|\.jpeg
                        
                        //$name = $this->s__id_preinscripcion.'_'.$value.strtolower($extension); 
                        
$name date("YmdHis").'_'.$value.strtolower($extension); 

                        
// We'll use the output crop data
                        
$data $image['input']['data'];

                        
// If you want to store the file in another directory pass the directory name as the third parameter.
                        
$file Slim::saveFile($data$name$folder_pathfalse);

                        
$input Slim::saveFile($data$name);

                        
array_push($files$input);
                        
                        @
unlink($input['path']);      


                        
$datos[$value] = $name;    

                    }

                }
            }

        } 
//fin foreach values
        //-----------------------------------------------------------------------------------
        //-----------------------------------------------------------------------------------

        
$this->dep('datos')->tabla('nota')->set($datos);

    }

    function 
resetear()
    {
        
$this->dep('datos')->resetear();
        unset(
$this->s__id_nota);
        unset(
$this->s__secciones);
        
$this->set_pantalla('pant_seleccion');
    }

    
//---- EVENTOS CI -------------------------------------------------------------------

    
function evt__agregar()
    {
        
$this->set_pantalla('pant_edicion');
    }

    function 
evt__volver()
    {
        
$this->resetear();
    }

    function 
evt__eliminar()
    {
        
$this->dep('datos')->eliminar_todo();
        
$this->resetear();
    }

    function 
evt__guardar()
    {
        
$this->dep('datos')->sincronizar();

        
//-----Secciones----------------------------------------------
        
if (empty($this->s__id_nota)) { //agrego, buscamos el ultimo id
            
$id_nota $this->dep('datos')->tabla('nota')->get_last_nota();
        }else{
            
$id_nota $this->s__id_nota;
            
#$this->dep('datos')->tabla('seccion_nota')->eliminar_fila_nota($id_nota);
        
}

        
#$this->dep('datos')->tabla('seccion_nota')->insertar_fila_nota($id_nota,$this->s__secciones); 

        
$this->dep('datos')->tabla('seccion_nota')->eliminar_insertar_fila_nota($id_nota,$this->s__secciones);    
        
//------------------------------------------------------------

        
$this->resetear();
    }

}

?>

:: 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.8308 ]--