<?php
 /**
 * @author ZEGARRA CORNE, Sergio
 * @copyright 2009
 */

 



if(($handle = @fopen("LPT1", "w")) === FALSE){
        die('No se puedo Imprimir, Verifique su conexion con el Terminal');
    }

//$dato = $_POST[$numasi];
$asiento=$_POST["numasi"];
$tiquete=$_POST["numtiq"];
$fecha=$_POST["fectiq"];
$hora=$_POST["hortiq"];
$destino=$_POST["presubrut"];
$valor=$_POST["pretot"];
$tipobus=$_POST["tipbus"];

fwrite($handle,chr(27). chr(64));//reinicio

//fwrite($handle, chr(27). chr(112). chr(48));//ABRIR EL /fwrite($handle, chr(27). chr(112). chr(48));//ABRIR EL CAJON
fwrite($handle, chr(27). chr(100). chr(0));//salto de linea VACIO
fwrite($handle, chr(27). chr(33). chr(9));//negrita
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle, chr(27). chr(32). chr(3));//ESTACIO ENTRE 
fwrite($handle, chr(27). chr(97). chr(1));//centrado

fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle, chr(27). chr(32). chr(3));//ESTACIO ENTRE LETRAS
fwrite($handle,"AutoTransportes Cepul S.A.");
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle,"Ced. Juridica 3-101-545451");
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle,"Tel. 2773-3835");
fwrite($handle,"=================================");
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle, chr(27). chr(32). chr(3));//ESTACIO ENTRE LETRAS
fwrite($handle, chr(27). chr(97). chr(0));//Izquierda
fwrite($handle,"N. Tiquete:" . $numtiq);
fwrite($handle, chr(27). chr(97). chr(2));//Derecha
fwrite($handle,"N. Tiquete:" . $numasi);
fwrite($handle, chr(27). chr(32). chr(0));//ESTACIO ENTRE LETRAS
fwrite($handle, chr(27). chr(100). chr(0));//salto de linea VACIO
fwrite($handle, chr(27). chr(33). chr(8));//negrita
fwrite($handle, chr(27). chr(100). chr(0));//salto de linea VACIO
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle,"TE AMO con todo mi corazon");
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea

fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea

fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle,"=================================");
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle,"De:" .$pretot );
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle,"================================="); 
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle, chr(27). chr(100). chr(1));//salto de linea
fwrite($handle, chr(27). chr(109). chr(0));//salto de linea
		
fclose($handle); // cierra el fichero PRN
$salida = shell_exec('lpr LPT1'); //lpr->puerto impresora, imprimir archivo PRN
?>

 