<?php
require_once "cls_print.php";
error_reporting(1);
if($_REQUEST["txtFile"]!="") {

	$filename= "../report/".$_REQUEST["txtFile"];
	$html = file_get_contents($filename);
	$pa = new PrintAnything();
	$con3 = $pa->addPrintContext($html);
	echo "Printing...";
?>
<script language="javascript" type="text/javascript">
    PA_GoPrint_<?php echo $con3;?>();
    setTimeout(function() {
        window.location.href = '<?php echo $_SERVER['HTTP_REFERER']; ?>';
    }, 500); // Delay for 1 second to give the print dialog time to show
</script>
<?php	
}
?>