-
Notifications
You must be signed in to change notification settings - Fork 0
/
service.php
71 lines (69 loc) · 3.27 KB
/
service.php
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
<!DOCTYPE html>
<html>
<head>
<meta charset ="utf-8">
<title>Services</title>
<link rel="stylesheet" href="style.css">
<meta name='viewport' content="width=device-width, initial-scale=1">
</head>
<body>
<?php
include('header.php');
if($_SESSION['Service']==""){
echo '<meta http-equiv="refresh" content="0;url=add.php?add=service"/>';
}
?>
<nav class="nav">
<input placeholder="Rechercher un médecin..." id="searchBar">
<select id="serviceSearch">
<option> Tous </option>
<option> Urgence </option>
<option> Chirurgie </option>
<option> Dermathologie </option>
<option> Gastroentérologie </option>
<option> Gynécologie </option>
<option> Neurologie </option>
<option> Psychiatrie </option>
<option> Radiologie </option>
<option> Soins intensifs </option>
<option> Direction </option>
</select>
<button onclick="sort();"> Recherche </button>
</nav>
<main class="main">
<section class="section__right section--full">
<?php
try{
include_once('db.php');
$req= $bd->query('SELECT * FROM service ORDER BY Nom');
while($donnees = $req->fetch()){
echo '<section class="service"> <h2 class="service__section__title"><span class="serviceNom">'.$donnees['Nom'].'</span> - '.$donnees['NbrMed'].' Médecin(s)</h2>';
$sousreq= $bd->query('SELECT * FROM users WHERE Service ="'.$donnees['Nom'].'"');
while($service = $sousreq->fetch()){
if($donnees['MatriculeTitulaire']==$service['Matricule']){
$class='titulaire';
}else{
$class='';
}
echo '<article class="user '.$class.'">
<h2 class="user__name"> <span class="uppercase nom">'.$service["Nom"].'</span> '.$service["Prenom"].'</h2>
<p class="user__registre"> <span class="bold"> Matricule </span>: '.$service["Matricule"].' </p>
<p class=" user__info"> <span class="bold">Email </span>: '.$service["Email"].' </p>
<p class=" user__info"> <span class="bold">Service </span>: '.$donnees["Nom"].' </p>
</article>';
}
echo '</section>';
}
}catch(Exeption $e){
echo 'Erreur de connection a la DB'+$e;
}
?>
</main>
<footer class="footer">
<p> © 2016-2017 HEH ISFTR - développement </p>
<p> Florian Simond </p>
<p> Projet scolaire dans le cadre du cours de PHP </p>
</footer>
<script src="js/script.js"></script>
</body>
</html>