+if (isset($save_report_selections) && $save_report_selections > 0 && isset($_POST['REP_ID'])) { // save parameters from Report Center
+ for($i=0; $i<10; $i++) { // 2010-10-06 Joe Hunt
+ if (isset($_POST['PARAM_'.$i]) && !is_array($_POST['PARAM_'.$i])) {
+ $rep = $_POST['REP_ID'];
+ setcookie("select[$rep][$i]", $_POST['PARAM_'.$i], time()+60*60*24*$save_report_selections); // days from $save_report_selections
+ }
+ }
+}
+
+if (isset($_GET['xls']))
+{
+ $filename = $_GET['filename'];
+ $unique_name = $_GET['unique'];
+ $path = company_path(). '/pdf_files/';
+ header("Content-type: application/vnd.ms-excel");
+ header("Content-Disposition: attachment; filename=$filename" );
+ header("Expires: 0");
+ header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
+ header("Pragma: public");
+ echo file_get_contents($path.$unique_name);
+ exit();
+}
+elseif (isset($_GET['xml']))
+{
+ $filename = $_GET['filename'];
+ $unique_name = $_GET['unique'];
+ $path = company_path(). '/pdf_files/';
+ header("content-type: text/xml");
+ header("Content-Disposition: attachment; filename=$filename");
+ header("Expires: 0");
+ header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
+ header("Pragma: public");
+ echo file_get_contents($path.$unique_name);
+ exit();
+}
+