Last active
January 4, 2016 06:49
-
-
Save ChrisGehm/8584595 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$id=""; | |
$fecha = ""; | |
$cliente = ""; | |
$para = ""; | |
$concepto = ""; | |
$responsable = ""; | |
$link = ""; | |
// Lee la plantilla | |
$plantilla1 = file_get_contents('plantilla1.rtf'); | |
// Agregamos los escapes necesarios | |
$plantilla1 = addslashes($plantilla1); | |
$plantilla1 = str_replace('\r','\\r',$plantilla1); | |
$plantilla1 = str_replace('\t','\\t',$plantilla1); | |
$plantilla1 = str_replace("\\'f1","'f1",$plantilla1); // Letra ñ | |
$plantilla1 = str_replace("\\'e1","'e1",$plantilla1); // Letra á | |
$plantilla1 = str_replace("\\'e9","'e9",$plantilla1); // Letra é | |
$plantilla1 = str_replace("\\'ed","'ed",$plantilla1); // Letra í | |
$plantilla1 = str_replace("\\'f3","'f3",$plantilla1); // Letra ó | |
$plantilla1 = str_replace("\\'fa","'fa",$plantilla1); // Letra ú | |
$plantilla1 = str_replace("\\'80","'80",$plantilla1); // Letra € Euro | |
$plantilla1 = str_replace("\\'º","'º",$plantilla1); // | |
// Datos de la plantilla | |
$id = $_POST["id"]; | |
$fecha = $_POST["fecha"]; | |
$cliente = $_POST["cliente"]; | |
$para = $_POST["para"]; | |
//$concepto = nl2br($_POST["concepto"]); | |
$concepto = $_POST["concepto"]; | |
$responsable = $_POST["responsable"]; | |
// Procesa la plantilla | |
eval( '$rtf = <<<EOF_RTF | |
' . $plantilla1 . ' | |
EOF_RTF; | |
' ); | |
// $plantilla = str_replace('$nombre',$nombre,$plantilla); | |
// Guarda el RTF generado, el nombre del RTF en este caso sera el nombre.rtf | |
// file_put_contents("$nombre.rtf",$plantilla); | |
//file_put_contents("recibos/$id-$cliente.rtf",$rtf); | |
file_put_contents("recibos/$id.rtf",$rtf); | |
//$link= $id.'-'.$cliente; | |
$link= $id; | |
?> | |
<div align="center"> | |
<img src="../imagenes/progreso.gif"> | |
<br> | |
<p >Generando...</p> | |
</div> | |
<?php | |
$guardar= "seminario/envio/generarrecibocompleto.php?id=".$link; | |
echo '<meta http-equiv=refresh content=2;URL=/'.$guardar.'>'; | |
?> | |
<?php | |
/*echo '<a href="/Seminario/envio/recibos/'.$link.'.rtf" style="color:#710678; font-weight:bold; font-size:15px; padding-left:15px;">Descargar</a>';*/ | |
echo '<br>'; | |
echo '<br>'; | |
echo '<a href="envio.php" >Volver</a>'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment