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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| <body>
<br>
<h1>Selection</h1>
<br>
<?php
$mysqli = new mysqli("localhost", "root", "", "cms");
if (mysqli_connect_errno()) {
printf("Echec de la connexion : %s\n", mysqli_connect_error());
}
if(isset($_GET['choix'])){
$choix = $_GET['choix'];
Switch($choix)
{
Case ($choix == 2):
$sql = "SELECT t_rendezvous.HoraireDebut, tbl_clientfournisseur.Nom, tbl_clientfournisseur.Adresse, tbl_clientfournisseur.Localité
FROM tbl_clientfournisseur INNER JOIN (t_rendezvous INNER JOIN tbl_eventsorte ON t_rendezvous.IdEvent = tbl_eventsorte.IdEvent) ON tbl_clientfournisseur.IdClient = t_rendezvous.NP
WHERE (((tbl_eventsorte.IdEvent)=2))";
break;
Case ($choix == 3):
break;
}
}
$resultat = mysqli_query($mysqli, $sql) or die(mysql_error());
if($resultat != false){
$Nmax = 6; // nombre par page
$Ncur = 0; // n° de la fiche courante
$Ndeb=@$_GET["num"];
}
echo "<p>";
echo "<table border='1'>
<tr>
<th>Debut</th>
<th>Chez qui</th>
<th>Adresse</th>
<th>Sorte Event</th>
</tr>";
while(($row = mysqli_fetch_assoc($resultat))&& ($Ncur<$Nmax+$Ndeb)){
if($Ncur>=$Ndeb) {
echo "<tr>";
echo "<td>" . filter_var($row['HoraireDebut'],FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "</td>";
echo "<td>" . filter_var($row['Nom'],FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "</td>";
echo "<td>" . filter_var($row['Adresse'],FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "</td>";
echo "<td>" . filter_var($row['Localité'],FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "</td>";?>
<?php }
$Ncur++;
}
echo "</table>";
echo "<br>";
?>
<table cellpadding=3>
<tr>
<?php
if($Ndeb > 0)
{ ?> <td><form method="post" action="structure.php?page=select&choix=<?php echo $choix;?>&num=<?php echo $Ndeb-$Nmax;?>">
<input type="submit" value="Precedent" width="75px"></form></td><?php }?>
<td> <?php $Npag = ceil(mysqli_num_rows($resultat)/$Nmax);
for($i = 1;$i<=$Npag;$i++) {
if($Ndeb == ($i-1)*$Nmax) { ?>Page <?php echo $i; ?>
<?php } else { ?><a href="?page=select&choix=<?php echo $choix; ?>&num=<?php echo ($i-1)*$Nmax; ?>"> <?php echo $i; ?> </a><?php }
} ?></td>
<?php
if($row) { ?><td><form method="post" action="structure.php?page=select&choix=<?php echo $choix; ?>&num=<?php echo $Ncur; ?>">
<input type="submit" value="Prochain" width="75px"></form>
</td><?php }?>
</tr>
</table>
<?php
$sql = "";
?> |
Partager