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