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
|
<?php
connexion();
$select = "select * from Suivi
WHERE id='$id'";
$result = mysql_query($select) or die ('Erreur : '.mysql_error() );
$total = mysql_num_rows($result);
// si on a récupéré un résultat on l'affiche.
if($total!=0) {
// debut du tableau
echo '<tr height="15px"> </tr>'."\n";
echo '<table class="pretty-table" width="90%">'."\n";
print "\n";
echo '<tr>';
echo '<th width="25%"><b><u>Intitule</u></b></th>';
echo '<th width="45%"><b><u>Action</u></b></th>';
echo '<th width="4%"><b><u>Duree</u></b></th>';
echo '</tr>'."\n";
// lecture et affichage des résultats sur 2 colonnes, 1 résultat par ligne.
while($row = mysql_fetch_array($result)) {
echo '<tr>';
echo '<td >'.$row["intitule"].'</td>';
echo '<td >'.$row["action"].'</td>';
if ($row["duree"] == 1) { $duree = "1H" ;}
if ($row["duree"] == 2) { $duree = "2H" ;}
if ($row["duree"] == 3) { $duree = "3H" ;}
if ($row["duree"] == 4) { $duree = "1/2 J" ;}
if ($row["duree"] == 7) { $duree = "1J" ;}
echo '<td >'.$duree.'</td>';
echo '</tr>'."\n";
}
echo '</table>'."\n";
// fin du tableau.
deconnexion();
}
?> |
Partager