-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindexSecretaire.php
More file actions
96 lines (94 loc) · 5.09 KB
/
indexSecretaire.php
File metadata and controls
96 lines (94 loc) · 5.09 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
91
92
93
94
95
96
<?php
include "components/header.php";
require_once "database/function.php";
// Vérification du rôle de l'utilisateur
if (!isset($_SESSION['user']) || $_SESSION['user']['role'] !== 'secretaire') {
header("Location: index.php");
exit();
}
// Utiliser la fonction etatRdv() pour changer l'état du rendez-vous
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && isset($_POST['idRdv'])) {
$rdv_id = $_POST['idRdv'];
$action = $_POST['action'];
if ($action === 'confirmer') {
etatRdv($rdv_id, 'confirmé');
} elseif ($action === 'annuler') {
etatRdv($rdv_id, 'annulé');
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AccueilSecretaire</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4Q6Gf2aSP4eDXB8Miphtr37CMZZQ5oXLH2yaXMJ2w8e2ZtHTl7GptT4jmndRuHDT" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
</head>
<body class="d-flex flex-column min-vh-100">
<div class="text-center" style="padding: 15px;">
<h4 style="color: #6c757d;">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 du jour</h1>
</div>
<div class="card-body">
<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>Actions</th>
</tr>
</thead>
<tbody>
<?php
$rdvs = listerRdvJour(); // À adapter selon votre fonction réelle
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>
<div class='d-flex gap-2'>
<form method='post' action='' style='display:inline;'>
<input type='hidden' name='idRdv' value='" . htmlspecialchars($rdv['id']) . "'>
<button type='submit' name='action' value='confirmer' class='btn btn-success btn-sm' title='Confirmer'>
<i class='bi bi-check-circle'></i>
</button>
</form>
<form method='post' action='' style='display:inline;'>
<input type='hidden' name='idRdv' value='" . htmlspecialchars($rdv['id']) . "'>
<button type='submit' name='action' value='annuler' class='btn btn-danger btn-sm' title='Annuler'>
<i class='bi bi-x-circle'></i>
</button>
</form>
</div>
</td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="mt-auto">
<?php include "components/footer.php"; ?>
</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>
</body>
</html>