1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title> gestion de projet </title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<?php
$conn =("host=localhost port=5432 dbname= gdt user=postgres password=gabero");
$dbconn = pg_connect("$conn");
// connexion à une base de données nommée "gdt" sur l'hôte "localhost" avec un
// nom d'utilisateur"postgres" et un mot de passe"gabero"
// éxecution de la requète SQL
$sql = pg_query("SELECT projet.id-projet,projet.nom-projet,projet.id-date,projet.id-nature,
projet.code-localisation,projet.code-etat,projet.code-mo,projet.resultat-projet,projet.montant-projet,
localisation.libellé,mo.libellé,nature.libellé,date.debut-date,etat.libellé FROM projet INNER JOIN date,projet INNER JOIN etat,projet INNER JOIN nature,projet INNER JOIN mo,projet INNER JOIN localistion
ON projet.code-localisation = localisation.code-localisation
AND projet.id-date = date.id-date
AND projet.code-mo = mo.code-mo
AND projet.id-nature = nature.id-nature
AND projet.code-etat = etat.code-etat) ;
where id-nature = 1,id-date =1,code-etat =1,code-localisation =1,code-mo =1 ");
//En-tete du tableau
echo "<table border=\"1\" >
<caption><strong> PROJET</strong></caption>
<tr>
<td>id-projet</td>
<td>nom-projet</td>
<td>code-mo</td>
<td>resultat-projet</td>
<td>montant-projet</td>
<td>code-localisation</td>
<td>id-nature</td>
<td>id-date</td>
<td>code-etat</td>
</tr>";
// utilisation de la boucle tant que
while($infos = pg_fetch_array($sql)) {
// affichage des resultats
echo"<tr>";//ligne du tableau
echo "<td>";echo $infos['id-projet'];echo "</td>";
echo "<td>";echo $infos['nom-projet'];echo "</td>";
echo "<td>";echo $infos['code-mo'] ;echo "</td>";
echo "<td>";echo $infos['resultat-projet'] ;echo "</td>";
echo "<td>";echo $infos['montant-projet'] ;echo "</td>";
echo "<td>";echo $infos['code-localisation'] ;echo "</td>";
echo "<td>";echo $infos['id-nature'] ;echo "</td>";
echo "<td>";echo $infos['id-date'] ;echo "</td>";
echo "<td>";echo $infos['code-etat'];echo "</td>";
echo"</tr>"; //fermeture de la ligne
} //fermeture du tant que
echo "</table>";//fermeture du tableau
pg_close($dbconn);
?>
</body>
</html> |
Partager