Added remote printing support.
[fa-stable.git] / reporting / prn_redirect.php
1 <?php
2 /*
3         Print request redirector. This file is fired via print link or 
4         print button in reporting module. 
5 */
6 $path_to_root = "../";
7 $page_security = 2;     // this level is later overriden in rep file
8 include_once($path_to_root . "includes/session.inc");
9
10 if (!isset($_POST['REP_ID'])) { // print link clicked
11         $def_pars = array(0, 0, '', '', 0, '', '', 0); //default values
12         $rep = $_POST['REP_ID'] = $_GET['REP_ID'];
13         for($i=0; $i<8; $i++) {
14                 $_POST['PARAM_'.$i] = isset($_GET['PARAM_'.$i]) 
15                         ? $_GET['PARAM_'.$i] : $def_pars[$i];
16         }
17 }
18                 $rep = $_POST['REP_ID'];
19             $rep_file = $comp_path.'/'.user_company().
20                      "/reporting/rep$rep.php";
21                 if (!file_exists($rep_file)) {
22                     $rep_file = $path_to_root ."/reporting/rep$rep.php";
23                 }
24         require($rep_file);
25         exit();
26
27 ?>