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
| <?php
// On inclut la connexion à la base
include('include/db_inc_pdo.php');
// On écrit notre requête
$sql = 'SELECT datearrive, datedepart, idperiode, nombre, prixlocation, caution, apaiement, dateapaiement, bpaiement, datebpaiement, cpaiement, datecpaiement, linge, litbaby, degatspayes, nonpaye, remarques, restitution, datelettre, appart, envoitarifs, envoidescriptif, paragraphesup, confirmation, enfants, annul, locataires.nom, locataires.prenom
FROM dateloca INNER JOIN locataires ON dateloca.idnoms = locataires.idnoms ORDER BY datearrive desc';
// On prépare la requête
$query = $pdo->prepare($sql);
// On exécute la requête
$query->execute();
// On stocke le résultat dans un tableau associatif
$result = $query->fetchAll(PDO::FETCH_ASSOC);
include("menu.php");
?>
<link rel="stylesheet" href="menu/dropdown_three.css" type="text/css">
<link rel="stylesheet" href="style.css" type="text/css">
<html lang="fr">
<body>
<h1>Liste des locations </h1>
<table>
<thead>
<th>ID</th>
<th>Nom</th>
<th>Prenom</th>
<th>Date arrivée</th>
<th>Date de départ</th>
</thead>
<tbody>
<?php
foreach($result as $produit){
?>
<tr>
<td><?= $produit['idperiode'] ?></td>
<td><?= $produit['nom'] ?></td>
<td><?= $produit['prenom'] ?></td>
<td><?= $produit['datearrive'] ?></td>
<td><?= $produit['datedepart'] ?></td>
<td>
<a href="adresse_essai1.php?idperiode=<?= $produit['idperiode'] ?>">Voir</a>
</tr>
<?php
}
?>
</tbody>
</table>
</body>
</html> |