<?php

	header( 'content-type: text/html; charset=utf-8' );
	include('database.php');
	include('fonctions.php');	
	DB_connexion(); 
	
	//require('html_table.php');
	
	$annee = date('Y');	
	$table = "reservation" .$annee;
	$mois = "avril"
	
	$sql = "SELECT * FROM " .$table ." WHERE annee ='$annee' and mois ='$mois' and mode = 'actif' ";			
	//echo $sql;
	mysqli_query($connexion, "SET NAMES 'utf8'");		
	$result = mysqli_query($connexion, $sql );
	$tab_jour = array();
	
	echo '
			<TABLE>
			<TR
			<TD>S. No.</TD>
			<TD>Name</TD>
			<TD>Age</TD>
			<TD>Sex</TD>
			<TD>Location</TD>
			</TR>';
	
				
	while ($data = mysqli_fetch_assoc ($result))				
	{	
				$jour = $data['rendezvous'];		
				$semaine = $data['semaine'];		
				
				$seance1 = $data['seance1'];
				$seance2 = $data['seance2'];
				$seance3 = $data['seance3'];
				$seance4 = $data['seance4'];
				$seance5 = $data['seance5'];
				$seance6 = $data['seance6'];
				$seance7 = $data['seance7'];
				$seance8 = $data['seance8'];

				echo '
						<TR>
						<TD>$jour</TD>
						<TD>$semaine</TD>
						<TD>$seance1</TD>
						<TD>$seance2</TD>
						<TD>$seance3</TD>
						<TD>$seance4</TD>
						<TD>$seance5</TD>
						<TD>$seance6</TD>
						<TD>$seance7</TD>
						<TD>$seance8</TD>
						</TR>		';	
				
				
	}

				echo '</TABLE>';

/*
$htmlTable='<TABLE>
<TR>
<TD>S. No.</TD>
<TD>Name</TD>
<TD>Age</TD>
<TD>Sex</TD>
<TD>Location</TD>
</TR>

<TR>
<TD>1</TD>
<TD>Azeem</TD>
<TD>24</TD>
<TD>Male</TD>
<TD>Pakistan</TD>
</TR>

<TR>
<TD>2</TD>
<TD>Atiq</TD>
<TD>24</TD>
<TD>Male</TD>
<TD>Pakistan</TD>
</TR>

<TR>
<TD>3</TD>
<TD>Shahid</TD>
<TD>24</TD>
<TD>Male</TD>
<TD>Pakistan</TD>
</TR>

<TR>
<TD>4</TD>
<TD>Roy Montgome</TD>
<TD>36</TD>
<TD>Male</TD>
<TD>USA</TD>
</TR>

<TR>
<TD>5</TD>
<TD>M.Bony</TD>
<TD>18</TD>
<TD>Female</TD>
<TD>&nbsp;</TD>
</TR>
</TABLE>';

$pdf=new PDF_HTML_Table();
$pdf->AddPage();
$pdf->SetFont('Arial','',10);
$pdf->WriteHTML("Start of the HTML table.<BR>$htmlTable<BR>End of the table.");
$pdf->Output();*/
?>
