<?php
	$module_name = "Anagrafiche";
	include_once( $docroot."/lib/permissions_check.php" );
	
	//carica report html
	$report = file_get_contents ($docroot."/templates/prt_pianificazione/prt_pianificazione.html");
	$body = file_get_contents ($docroot."/templates/prt_pianificazione/prt_pianificazione_body.html");

	include_once( "pdfgen_variables.php" );

	$search_tipo = $html->form('search_tipo');

	$titolo = "Stampa Pianificazione ";
		
		
	
		
	
	$body .= "<h3>".$titolo." dal ".date( "d/m/Y", strtotime($_SESSION['period_start']) )." al ".date( "d/m/Y", strtotime($_SESSION['period_end']) )."</h3>\n";
	$body .= "<table class=\"table_values\" cellspacing=\"0\" border=\"0\" cellpadding=\"0\" style=\"table-layout:fixed; border-color:#aaa;\">\n";
	$body .= "<col width=\"125\"><col width=\"125\"><col width=\"130\"><col width=\"130\"><col width=\"225\"><col width=\"150\">\n";
	
	$body .= "<thead>\n";
	$body .= "	<tr>\n";
	$body .= "		<th style='padding:2mm; background:#eee;'>Data Inizio</th>\n";
	$body .= "		<th style='padding:2mm; background:#eee;'>Data Fine</th>\n";
	$body .= "		<th style='padding:2mm; background:#eee;'>Tipologia</th>\n";
	$body .= "		<th style='padding:2mm; background:#eee;'>Stato</th>\n";
	$body .= "		<th style='padding:2mm; background:#eee;'>Ragione Sociale</th>\n";
	$body .= "		<th style='padding:2mm; background:#eee;'>Operatore</th>\n";
	$body .= "	</tr>\n";
	$body .= "</thead>\n";
	
	

	$body .= "<tbody>\n";
	
	$query=$_SESSION['query_controller'] ;
	
	$rs = $dbo->fetchArray($query);
	
	for( $i=0; $i<sizeof($rs); $i++ ){
	
		$body .= "	<tr>";
		$body .= "		<td>".$rs[$i]['orario_inizio']."</td>\n";
		$body .= "		<td>".$rs[$i]['orario_fine']."</td>\n";
		$body .= "		<td>".$rs[$i]['Tipo']."</td>\n";
		$body .= "		<td>".$rs[$i]['Stato']."</td>\n";
		$body .= "		<td>".$rs[$i]['Anagrafica']."</td>\n";
		$body .= "		<td>".$rs[$i]['Operatore']."</td>\n";
		$body .= "	</tr>\n";

	}
	
	
	
	$body .= "</tbody>\n";
	$body .= "</table>\n";
	
	
	
	$orientation = "L";
	$report_name = "prt_anagrafiche.pdf";
?>
