3 require(dirname(__FILE__
) . "/../globals.php");
7 $fname = preg_replace("[/]","",$fname);
8 $fname = preg_replace("[\.\.]","",$fname);
9 $fname = preg_replace("[\\\\]","",$fname);
10 $fconfig = $GLOBALS['oer_config']['freeb'];
11 $fname = $fconfig['claim_file_dir'] . $fname;
15 if (!file_exists($fname)) {
16 echo "The claim file: " . $_GET['key'] . " could not be accessed.";
18 elseif ($_GET['action'] == "print") {
22 <link rel
=stylesheet href
="<?echo $css_header;?>" type
="text/css">
24 <body
<?
echo $top_bg_line;?
> topmargin
=0 rightmargin
=0 leftmargin
=2 bottommargin
=0 marginwidth
=2 marginheight
=0>
25 <br
><p
><h3
>Printing results
:</h3
><a href
="billing_report.php">back
</a
><ul
>
27 $estring = $fconfig['print_command'] . " -P " . $fconfig['printer_name'] . " " . $fconfig['printer_extras'] . " " . $fname;
28 //echo $estring . "<br>";
29 $rstring = exec(escapeshellcmd($estring));
30 echo "Document $fname sent to printer.";
39 $fp = fopen($fname, 'r');
41 header("Pragma: public");
43 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
45 if (strtolower(substr($fname,(strlen($fname)-4))) == ".pdf") {
46 header("Content-Type: application/pdf");
48 elseif (strtolower(substr($fname,(strlen($fname)-4))) == ".edi") {
49 header("Content-Type: text/plain");
52 header("Content-Length: " . filesize($fname));
53 header("Content-Disposition: attachment; filename=" . basename($fname));
55 // dump the picture and stop the script