File "funciones.php"
Full path: /var/www/html/recibos/funciones.php
File size: 1.79 KiB (1829 bytes)
MIME-type: text/x-php
Charset: utf-8
<?php
function limpiarCadena($valor)
{
$valor = str_ireplace("SELECT","",$valor);
$valor = str_ireplace("COPY","",$valor);
$valor = str_ireplace("DELETE","",$valor);
$valor = str_ireplace("DROP","",$valor);
$valor = str_ireplace("DUMP","",$valor);
$valor = str_ireplace(" OR ","",$valor);
$valor = str_ireplace("%","",$valor);
$valor = str_ireplace("LIKE","",$valor);
$valor = str_ireplace("--","",$valor);
$valor = str_ireplace("^","",$valor);
$valor = str_ireplace("[","",$valor);
$valor = str_ireplace("]","",$valor);
$valor = str_ireplace("'\'","",$valor);
$valor = str_ireplace("!","",$valor);
$valor = str_ireplace("ยก","",$valor);
$valor = str_ireplace("?","",$valor);
$valor = str_ireplace("=","",$valor);
$valor = str_ireplace("&","",$valor);
return $valor;
}
function crear(){
$source_pdf="sample.pdf";
$output_folder="pdf";
if (!file_exists($output_folder)) { mkdir($output_folder, 0777, true);}
exec("pdftohtml -c -noframes -zoom 2.0 -i -xml -nomerge 2>&1 $source_pdf $output_folder/horarios",$b);
//var_dump($a);
echo "<br>";
require "leerpdf/zdividir.php";
require "ftp/index.php";
set_time_limit(300);
$xml = simplexml_load_file("pdf/horarios.xml");
$i=0;
foreach ($xml->page as $nodo)
{
$atributos = $nodo->attributes();
$i++;
foreach($nodo->text as $texto){
$nombre=$texto->attributes();
if(($nombre['top']==221)and($nombre['left']==149)){
$texto=str_replace('/',' ',$texto);
$c=explode(',',$texto);
$final=$c[1]." ".$c[0];
echo $final."\n ";
split_pdf("sample.pdf",$final,$i);
}
}
}
}
?>