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


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


/**
 * Funciones varias relacionadas con transformación de distintos formatos en diferentes medios
 * @package SalidaGrafica
 */
class toba_formateo
{
    protected 
$tipo_salida;
    
    function 
__construct($tipo_salida)
    {
        
$this->tipo_salida $tipo_salida;
    }
    
    protected function 
get_separador()
    {
        if (
$this->tipo_salida == 'html') {
            return 
'&nbsp;';
        } else {
            return 
' ';
        }        
    }

    function 
formato_escapar($valor)
    {
        
$salida stripslashes($valor);        
        if (
$this->tipo_salida != 'excel') {
            return 
$salida;
        } else {
            return array(
$salidanull);
        }
    }

    function 
formato_NULO($valor)
    {
        if (
$this->tipo_salida != 'excel') {
            return 
$valor;
        } else {
            return array(
$valornull);
        }
    }

    function 
formato_decimal($valor)
    {
        if (
$this->tipo_salida != 'excel') {
            if (
strpos($valor,'.') === false) {
                return 
number_format($valor,0,',','.');    
            }else{
                return 
number_format($valor,2,',','.');
            }            
        } else {
            return array(
$valor, array('numberformat' => 
                        array(
'code' => PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00)
                    ));    
        }        
    }    

    function 
formato_decimal_estricto($valor)
    {
        if (
$this->tipo_salida != 'excel') {
                return 
number_format($valor,2,',','.');
        } else {
            
$estilo = array($valor, array('numberformat' => 
                        array(
'code' => PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00)
                    ));    
            
            
            return 
$estilo;
        }        
    }
    
    function 
formato_porcentaje($valor)
    {
        
//Es trucho forzar desde aca, los datos tienen que esta bien
        //if($valor<0)$valor=0;
        
if ($this->tipo_salida != 'excel') {
            return 
number_format($valor,2,',','.') . $this->get_separador()."%";
        } else {
            return array(
$valor 100, array('numberformat' => 
                        array(
'code' => PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00)
                    ));            
        }
    }    
    
    function 
formato_moneda($valor)
    {
        
//Es trucho forzar desde aca, los datos tienen que esta bien
        //if($valor<0)$valor=0;
        
if ($this->tipo_salida != 'excel') {
            return 
'$'.$this->get_separador(). number_format($valor,2,',','.');
        } else {
            return array(
$valor, array('numberformat' => 
                        array(
'code' => PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE)
                ));
        }
    }

    function 
formato_tiempo($valor)
    {
        if (
$this->tipo_salida != 'excel') {
            return 
"<b>" number_format($valor,2,',','.') . '</b>'.
                
$this->get_separador().'seg.';

        } else {
            return array(
$valornull);
        }                
    }
    
    function 
formato_tiempo_ms($valor)
    {
        if (
$this->tipo_salida != 'excel') {
            return 
"<b>" number_format($valor 1000,2,',','.') . '</b>'.
                
$this->get_separador().'ms';

        } else {
            return array(
$valornull);
        }                
    }    

    function 
formato_millares($valor)
    {
        if (
$this->tipo_salida != 'excel') {
            if (
is_numeric($valor)) {
                return 
number_format($valor,0,',','.');
            } else {
                return 
$valor;
            }            
        } else {
            return array(
$valor, array('numberformat' => 
                            array(
'code' => PHPExcel_Style_NumberFormat::FORMAT_NUMBER)
                    ));    
        }

    }
    
    function 
formato_numero($valor)
    {    
        return 
$this->formato_decimal($valor);
    }
    
    function 
formato_forzar_cadena($valor)
    {
        if (
$this->tipo_salida != 'excel') {
            return 
$valor;
        } else {
            return array(
" ".$valor, array());
        }        
    }

    function 
formato_mayusculas($valor)
    {
        
$salida strtoupper($valor);
        if (
$this->tipo_salida != 'excel') {
            return 
$salida;
        } else {
            return array(
$salidanull);
        }
    }

    function 
formato_indivisible($valor)
    {
        if (
$this->tipo_salida == 'html') {
            return 
"<span style='white-space:nowrap'>$valor</span>";
        } elseif (
$this->tipo_salida == 'pdf') {
            return 
$valor;
        } else {
            return array(
$valornull);
        }
    }
    
    function 
formato_may_ind($valor)
    {
        
$salida str_replace (" ",$this->get_separador(),strtoupper(trim($valor)));        
        if (
$this->tipo_salida != 'excel') {
            return 
$salida;
        } else {
            return array(
$salidanull);
        }        
        
    }
    
    function 
formato_salto_linea_html($valor)
    {
        if (
$this->tipo_salida == 'html') {
            return  
str_replace ("\n","<br />",$valor);
        } elseif (
$this->tipo_salida == 'pdf') {
            return 
$valor;
        } else {
            return array(
$valornull);
        }        
    }

    function 
formato_fecha($fecha){
        if (isset(
$fecha) && ($fecha!='')) {
            
$desc cambiar_fecha($fecha,'-','/');
        } else {
            
$desc '';
        };
        if (
$this->tipo_salida != 'excel') {
            return 
$desc;
        } else {
            return array(
$desc, array('numberformat' => 
                    array(
'code' => PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY)
                ));                            
        }
    }
    
    function 
formato_fecha_hora($fecha)
    {
        if (isset(
$fecha) && ($fecha!='')) {
            
$desc cambiar_fecha($fecha,'-','/'true);
        } else {
            
$desc '';
        };
        if (
$this->tipo_salida != 'excel') {
            return 
$desc;
        } else {
            return array(
$desc, array('numberformat' => 
                array(
'code' => PHPExcel_Style_NumberFormat::FORMAT_DATE_DATETIMEFULL )
            ));                            
        }
    }    
    
    function 
formato_hora($hora
    {
        if (isset(
$hora) && ($hora !='')) {
            
$desc $hora;
        } else {
            
$desc '';
        };
        if (
$this->tipo_salida != 'excel') {
            return 
$desc;
        } else {
            
$desc cambiar_hora_formato_12($desc);
            return array(
$desc, array('numberformat' =>
                    array(
'code' => PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME1 )));
        }
    }

    function 
formato_checkbox($valor)
    {
        if (
$valor === true || $valor === '1' || $valor === || $valor === 'S' || $valor === 's') {
            
$html "SI";
        } else {
            
$html "NO";
        }
        if (
$this->tipo_salida != 'excel') {
            return 
$html;
        } else {
            return array(
$htmlnull);
        }
    }

    function 
formato_html_br($valor)
    {
        
$html str_replace("\n","<br>",$valor);
        if (
$this->tipo_salida != 'excel') {
            return 
$html;
        } else {
            return array(
$valornull);
        }
    }

    function 
formato_imagen_toba($valor)
    {
        return 
toba_recurso::imagen_toba($valortrue);
    }

    function 
formato_imagen_proyecto($valor)
    {
        return 
toba_recurso::imagen_proyecto($valortrue);
    }

    function 
formato_superficie($valor)
    {
        
//Es trucho forzar desde aca, los datos tienen que esta bien
        //if($valor<0)$valor=0;
        
$salida number_format(doubleval($valor),2,',','.') . $this->get_separador() . "Km²";
        if (
$this->tipo_salida != 'excel') {
            return 
$salida;
        } else {
            return array(
$valor, array('numberformat' => 
                            array(
'code' => '0.00 k\m')
                    ));    
        }
    }    

    function 
formato_cuit($valor)
    {
        if (isset(
$valor) && $valor!='') {
            
$length strlen($valor);
            
$salida substr($valor02) . '-' substr($valor2$length 3) . '-' substr($valor$length 1$length);
        } else {
            
$salida '';
        }
        if (
$this->tipo_salida != 'excel') {
            return 
$salida;
        } else {
            return array(
$salidanull);
        }
    }
    
    function 
formato_pre($valor)
    {
        if (
$this->tipo_salida != 'excel') {
            return 
'<pre>'.$valor.'</pre>';
        } else {
            return array(
$valornull);
        }
    }    
}
?>

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