<html> 
 <head>
 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>DEBUG</title>
 </head>
<body>

<?php 
//Fichiers contenant les fonctions utilis&eacute;es dans le script.
require("../outils/gui.php");
require("../outils/session.php");
require("../outils/mise_en_page.php");
require("gestion-poste.php");

//V&eacute;rifier si la session est valide.
$Bsession_id = $_GET["Bsession_id"];
verifierSession($Bsession_id);

//V&eacute;rifier les droits de l'utilisateur.
$privilege_base = lirePrivilege($Bsession_id);
if ($privilege_base != 2)
	die("Vous n'avez pas les droits!");

//********************************************************************************************
// remplir les variables *********************************************************************	
//********************************************************************************************
//RECHERCHE DANS LA TABLE BASE_CONTRAT
$sql = "SELECT code_contrat, numero_contrat, num_client, date_emission, date_debut, date_fin, cal_debut, cal_fin, heure_debut, heure_fin, nuite, refere, etat, credit, depot, depot_lock 
        FROM base_contrat;";
		
// Ex&eacute;cute la requ&ecirc;te et mettre les r&eacute;sultats dans $result
$result = mysqli_query($GLOBALS["___mysqli_ston"], $sql)
	or die ("Ne peut lire dans la table des membres".$sql);
// obtenir le nombre d'enregistrement. 0 si invalide, 1 si valide.
$num = mysqli_num_rows($result);

// met la valeur dans les variables
if ($num)
{
	$i = 0;
	$row = mysqli_fetch_row($result);
	$code_contrat = ($row[$i++]);
	$numero_contrat = ($row[$i++]);
	$num_client = ($row[$i++]);
	$date_emission = ($row[$i++]);
	$date_debut = ($row[$i++]);
	$date_fin = ($row[$i++]);
	$cal_debut = ($row[$i++]);
	$cal_fin = ($row[$i++]);
	$heure_debut = ($row[$i++]);
	$heure_fin = ($row[$i++]);
	$nuite = ($row[$i++]);
	$refere = ($row[$i++]);
	$etat = ($row[$i++]);
	$credit = ($row[$i++]);
	$depot = ($row[$i++]);
	$depot_lock = ($row[$i++]);
}
else
{
	die ("Il y a un probl&egrave;me dans la base de donn&eacute;es !".$sql);
}
((mysqli_free_result($result) || (is_object($result) && (get_class($result) == "mysqli_result"))) ? true : false);


print("<table><tr>");
print("<td>code_contrat</td>");
print("<td>numero_contrat</td>");
print("<td>num_client</td>");
print("<td>date_emission</td>");
print("<td>date_debut</td>");
print("<td>date_fin</td>");
print("<td>cal_debut</td>");
print("<td>cal_fin</td>");
print("<td>heure_debut</td>");
print("<td>heure_fin</td>");
print("<td>nuite</td>");
print("<td>refere</td>");
print("<td>etat</td>");
print("<td>credit</td>");
print("<td>depot</td>");
print("<td>depot_lock</td>");

print("</tr><tr>");

print("<td>".$code_contrat."</td>");
print("<td>".$numero_contrat."</td>");
print("<td>".$num_client."</td>");
print("<td>".$date_emission."</td>");
print("<td>".$date_debut."</td>");
print("<td>".$date_fin."</td>");
print("<td>".$cal_debut."</td>");
print("<td>".$cal_fin."</td>");
print("<td>".$heure_debut."</td>");
print("<td>".$heure_fin."</td>");
print("<td>".$nuite."</td>");
print("<td>".$refere."</td>");
print("<td>".$etat."</td>");
print("<td>".$credit."</td>");
print("<td>".$depot."</td>");
print("<td>".$depot_lock."</td>");

print("</tr></table>");

?>

</body>
</html>	
