-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindexMedecin.php
More file actions
90 lines (89 loc) · 4.64 KB
/
indexMedecin.php
File metadata and controls
90 lines (89 loc) · 4.64 KB
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
83
84
85
86
87
88
89
90
<?php
include "components/header.php";
require_once "database/function.php";
// recuperer l'ID du médecin depuis la session
$id_medecin = $_SESSION['user']['id'];
// Utiliser la fonction annulerRdv() pour annuler les rendez-vous
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['idRdv'])) {
$id_rdv = $_POST['idRdv'];
annulerRdv($id_rdv);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AccueilMedecin</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4Q6Gf2aSP4eDXB8Miphtr37CMZZQ5oXLH2yaXMJ2w8e2ZtHTl7GptT4jmndRuHDT" crossorigin="anonymous">
</head>
<body class="d-flex flex-column min-vh-100">
<div class="d-flex justify-content-center my-4">
<h4 class="text-secondary">
Bienvenue, <?php echo $_SESSION['user']['prenom'] . ' ' . $_SESSION['user']['nom']; ?>
</h4>
</div>
<!-- Créer un tableau au centre de la page avec une boucle pour afficher les rendez-vous de la semaine sans image en fond -->
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card mt-5 mb-5" style="margin-top: 120px; margin-bottom: 80px;">
<div class="card-header">
<h1 class="text-center">Rendez-vous de la semaine</h1>
</div>
<div class="card-body">
<?php if (isset($_POST['idRdv'])): ?>
<div class="alert alert-success text-center mb-4">
Rendez-vous annulé avec succès !
</div>
<?php endif; ?>
<table class="table table-striped">
<thead>
<tr>
<th>Date</th>
<th>Type</th>
<th>Heure de debut</th>
<th>Heure de fin</th>
<th>Statut</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$rdvs = listerRdvJourMedecin($id_medecin);
foreach ($rdvs as $rdv) {
echo "<tr>";
echo "<td>" . htmlspecialchars($rdv['date']) . "</td>";
echo "<td>" . htmlspecialchars($rdv['type']) . "</td>";
echo "<td>" . htmlspecialchars($rdv['heure_debut']) . "</td>";
echo "<td>" . htmlspecialchars($rdv['heure_fin']) . "</td>";
echo "<td>" . htmlspecialchars($rdv['statut']) . "</td>";
echo "<td>";
if ($rdv['statut'] !== 'Annulé') {
echo '<form method="post" style="display:inline;">
<input type="hidden" name="idRdv" value="' . htmlspecialchars($rdv['id']) . '">
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm(\'Voulez-vous vraiment annuler ce rendez-vous ?\')" title="Annuler">
<i class="bi bi-x-circle"></i>
</button>
</form>';
} else {
echo '<span class="text-muted">Annulé</span>';
}
echo "</td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/js/bootstrap.bundle.min.js" integrity="sha384-j1CDi7MgGQ12Z7Qab0qlWQ/Qqz24Gc6BM0thvEMVjHnfYGF0rmFCozFSxQBxwHKO" crossorigin="anonymous"></script>
<div class="mt-auto">
<?php include "components/footer.php"; ?>
</div>
</body>
</html>