| 
									
										
										
										
											2011-12-06 23:02:14 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-24 16:27:28 +00:00
										 |  |  | /* | 
					
						
							|  |  |  |  * LibreNMS | 
					
						
							| 
									
										
										
										
											2012-05-09 10:01:42 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2015-03-24 16:27:28 +00:00
										 |  |  |  * Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa> | 
					
						
							| 
									
										
										
										
											2012-05-09 10:01:42 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2015-03-24 16:27:28 +00:00
										 |  |  |  * This program is free software: you can redistribute it and/or modify it | 
					
						
							|  |  |  |  * under the terms of the GNU General Public License as published by the | 
					
						
							|  |  |  |  * Free Software Foundation, either version 3 of the License, or (at your | 
					
						
							|  |  |  |  * option) any later version.  Please see LICENSE.txt at the top level of | 
					
						
							|  |  |  |  * the source code distribution for details. | 
					
						
							| 
									
										
										
										
											2012-05-09 10:01:42 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | if (strpos($_SERVER['PATH_INFO'], 'debug')) { | 
					
						
							|  |  |  |     $debug = '1'; | 
					
						
							|  |  |  |     ini_set('display_errors', 1); | 
					
						
							|  |  |  |     ini_set('display_startup_errors', 1); | 
					
						
							|  |  |  |     ini_set('log_errors', 1); | 
					
						
							|  |  |  |     ini_set('error_reporting', E_ALL); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | else { | 
					
						
							|  |  |  |     $debug = false; | 
					
						
							|  |  |  |     ini_set('display_errors', 0); | 
					
						
							|  |  |  |     ini_set('display_startup_errors', 0); | 
					
						
							|  |  |  |     ini_set('log_errors', 0); | 
					
						
							|  |  |  |     ini_set('error_reporting', 0); | 
					
						
							| 
									
										
										
										
											2012-04-06 15:01:58 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | require '../includes/defaults.inc.php'; | 
					
						
							|  |  |  | require '../config.php'; | 
					
						
							|  |  |  | require_once '../includes/definitions.inc.php'; | 
					
						
							|  |  |  | require '../includes/functions.php'; | 
					
						
							|  |  |  | require 'includes/functions.inc.php'; | 
					
						
							|  |  |  | require 'includes/authenticate.inc.php'; | 
					
						
							| 
									
										
										
										
											2015-03-24 16:27:28 +00:00
										 |  |  | require_once 'lib/tcpdf/tcpdf.php'; | 
					
						
							| 
									
										
										
										
											2012-04-06 15:01:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-24 16:27:28 +00:00
										 |  |  | $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); | 
					
						
							| 
									
										
										
										
											2012-04-06 15:01:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-24 16:27:28 +00:00
										 |  |  | $pdf->SetCreator($config['project_name']); | 
					
						
							|  |  |  | $pdf->SetAuthor($config['project_name']); | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128)); | 
					
						
							|  |  |  | $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); | 
					
						
							|  |  |  | $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); | 
					
						
							| 
									
										
										
										
											2012-04-06 15:01:58 +00:00
										 |  |  | $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); | 
					
						
							|  |  |  | $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); | 
					
						
							|  |  |  | $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); | 
					
						
							|  |  |  | $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | $pdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM); | 
					
						
							| 
									
										
										
										
											2012-04-06 15:01:58 +00:00
										 |  |  | $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); | 
					
						
							|  |  |  | $pdf->setFontSubsetting(true); | 
					
						
							| 
									
										
										
										
											2015-03-24 16:27:28 +00:00
										 |  |  | $pdf->SetFont('helvetica', '', 14, '', true); | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | $pdf->setTextShadow(array('enabled' => false, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal')); | 
					
						
							| 
									
										
										
										
											2012-04-06 15:01:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-24 16:27:28 +00:00
										 |  |  | if (isset($_GET['report']) && !empty($_GET['report'])) { | 
					
						
							|  |  |  |     $report = mres($_GET['report']); | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  |     $pdf->SetHeaderData('../../'.$config['title_image'], 40, ucfirst($report), $config['project_name'], array(0, 0, 0), array(0, 64, 128)); | 
					
						
							| 
									
										
										
										
											2015-04-16 10:08:19 +00:00
										 |  |  |     include_once "includes/reports/$report.pdf.inc.php"; | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | } | 
					
						
							|  |  |  | else { | 
					
						
							| 
									
										
										
										
											2015-03-24 16:27:28 +00:00
										 |  |  |     $report = 'report'; | 
					
						
							| 
									
										
										
										
											2012-04-06 15:01:58 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2011-12-06 23:02:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-24 16:27:28 +00:00
										 |  |  | $pdf->Output("$report.pdf", 'I'); |