fix for attendance form
[openemr.git] / custom / qrda_download.php
blobf18a309fe90751e789bbce4c7b41c5d953c78df3
1 <?php
2 /**
4 * QRDA Download
6 * Copyright (C) 2015 Ensoftek, Inc
8 * LICENSE: This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
19 * @package OpenEMR
20 * @author Ensoftek
21 * @link http://www.open-emr.org
24 // This program exports(Download) to QRDA Category III XML.
27 //STOP FAKE REGISTER GLOBALS
28 $fake_register_globals=false;
30 require_once("../interface/globals.php");
32 $qrda_fname = $_GET['qrda_fname'];
33 check_file_dir_name($qrda_fname);
34 if($qrda_fname != ""){
35 $qrda_file_path = $GLOBALS['OE_SITE_DIR'] . "/documents/cqm_qrda/";
36 $xmlurl = $qrda_file_path.$qrda_fname;
38 header("Pragma: public"); // required
39 header("Expires: 0");
40 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
41 header("Cache-Control: private",false); // required for certain browsers
42 header('Content-type: application/xml');
43 header("Content-Disposition: attachment; filename=\"".basename($xmlurl)."\";" );
44 header("Content-Transfer-Encoding: binary");
45 header("Content-Length: ". filesize($xmlurl));
46 ob_clean();
47 flush();
48 readfile( $xmlurl );
49 }else{
50 echo xlt("File path not found.");