| 12
 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
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 
 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xnls="http://www.w3.org/1999/xhtml">
 
<head>
 
 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" media="screen" type="text/css" title="non style" href="menu.css" /> 
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.autocomplete.min.js"></script>
</head>
 
<?php include('menu.php'); ?>
 
 
<?php include ('entete.php');?>
 
 
<div id="body">
 
 
 <div id="content">
 
 
 
 
<h2>Traitement</h2>
<p>
<br />
<br/ >
  <form method="post" action="repos.php">
   <p>
       <label for="nom">Nom :</label>
 
	  <input type="text" name="nom" id="nom" />
 
        <input type="submit" value="Valider" /> 
    <?php $nom = $_POST['nom'];?>
 
   </p>
</form>
 
<?php
try
{
	// connexion à la base fonctions
	$bdd = new PDO('mysql:host=localhost;dbname=fonction;charset=utf8', 'root', 'root');
}
catch(Exception $e)
{
 
        die('Erreur : '.$e->getMessage());
}
 
 
$reponse = $bdd->query ('SELECT nom, medicament.id_du_medicament, jour, denomination FROM patient
LEFT JOIN medicament ON patient.id_du_patient = medicament.id_du_patient
LEFT JOIN listing_medicaments ON medicament.id_du_medicament = listing_medicaments.id_du_medicament
WHERE nom = "'.$nom.'"');
//('SELECT * FROM patient, listing_medicaments where nom = "'.$nom.'"'); 
//('SELECT nom, medicament.id_du_medicament, jour, denomination from listing_medicaments, patient where nom = "'.$nom.'"');
 
?>
<table border = "2px">
	<tr>
	<th>
	</th>
	<th>
	08:00
 
	</th>
	<th>
	12:00
	</th>
	<th>
	20:00
	</th>
	<th>
	21:00
	</th>
	</tr>
 
 
 
<?php
 
while ($donnees = $reponse->fetch()){	
$heure =$bdd->query('SELECT  heure FROM patient
LEFT JOIN medicament ON patient.id_du_patient = medicament.id_du_patient  
LEFT JOIN listing_medicaments ON medicament.id_du_medicament = listing_medicaments.id_du_medicament
WHERE nom = "'.$nom.'"   AND medicament.heure = "8"');  
 
 
 
while ($donnees = $reponse->fetch())
{
 
 
 
	$medicament=$bdd->query('SELECT nom, medicament.id_du_medicament, jour, denomination FROM patient
LEFT JOIN medicament ON patient.id_du_patient = medicament.id_du_patient
LEFT JOIN listing_medicaments ON medicament.id_du_medicament = listing_medicaments.id_du_medicament
WHERE nom = '.$nom.' AND listing_medicaments.denomination = $denomination');
 
?>
 
	<tr>
	<td>
 
	<?php echo $donnees['denomination']; ?>
	</td>
	<td>
 
	</td>
	<td>
	<?php
} 
 
	if ($donnees['heure']=="8")
	 {echo "X";} else  {echo " ";}?>
 
 
	</td>
	<td>
 
	</td>
	<td>
	</td>
	</tr>
 
 
	<?php
 
    }
 
$reponse->closeCursor(); 
 
?>
</table>
</div>
 
 
<?php include ('footer.php');?>
 
</html> |