tranlsation function xl()
[openemr.git] / interface / billing / get_claim_file.php
blobc75fb524391af8975175468b0f1da261633b4427
1 <?php
3 require(dirname(__FILE__) . "/../globals.php");
5 $fname = $_GET['key'];
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") {
20 <html>
21 <head>
22 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
23 </head>
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.";
32 </ul>
33 </body>
34 </html>
35 <?
37 else {
39 $fp = fopen($fname, 'r');
41 header("Pragma: public");
42 header("Expires: 0");
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
56 fpassthru($fp);
58 exit;