Location: PHPKode > projects > Reportmaker > reportmaker_1.0/index.php
<?php
/*
 * Created on Apr 22, 2007
 *
 * nik600 developer
 */
 require_once("etc/settings.php");
 require_once("lib/db_nik/dbnik.class.php");
 require_once("processreport.class.php");
 require_once("render_report.class.php");
 
 /*
  * connessione al database per eventuale reperimento di dati
  * */
 $db			=	new dbnik(DB_TYPE,DB_HOST,DB_USER,DB_PASS,DB_NAME);
 
 /*
  * leggo il report da file
  * */
 if($_GET["file"]=="esempio"){
 $report		=	file_get_contents("esempio.xml");
}else{
 $report		=	file_get_contents("raggruppamenti.xml");
}


 
 if(isset($_GET["debug"])){
 	 define("DEBUG",$_GET["debug"]);
 }else{
 	 define("DEBUG",false);
 }
 
 $parametri=array();
 
 /*
  * processo i dati del report
  * */
 $processreport	=	new processreport($report,$db,$parametri);
 
 $report		=	$processreport->process();
 
 if(!isset($_GET["output"])){
 	$output="html";
 }else{
 	$output=$_GET["output"];
 }
 /*
  * rappresento il report
  * */
 $render_report	=	new render_report($report,$output);
 
 try{
 $render_report->render();
 }catch(Exception $e){
 	echo "<h1>Errore durante la generazione del report</h1>";
	echo "<p>".$e->getMessage()."</p>";
 }
?>
Return current item: Reportmaker