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 if (!strpos($fname,'-batch')) $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 <?php
if (function_exists(html_header_show
)) html_header_show(); ?
>
29 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
31 <body
class="body_top">
32 <br
><p
><h3
><?php
xl('Printing results:','e')?
></h3
><a href
="billing_report.php"><?php
xl('back','e')?
></a
><ul
>
34 $estring = $fconfig['print_command'] . " -P " . $fconfig['printer_name'] . " " . $fconfig['printer_extras'] . " " . $fname;
35 $rstring = exec(escapeshellcmd($estring));
36 echo xl("Document") . $fname . xl("sent to printer.");
44 $fp = fopen($fname, 'r');
46 header("Pragma: public");
48 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
49 header("Content-Type: $content_type");
50 header("Content-Length: " . filesize($fname));
51 header("Content-Disposition: attachment; filename=" . basename($fname));
53 // dump the picture and stop the script