2015-12-08 07:17:46 +00:00
|
|
|
<?php session_start();
|
|
|
|
require('autoloader.php');
|
|
|
|
if(!Authentification::checkUser(0)){
|
|
|
|
header("Location: http://".$_SERVER['HTTP_HOST']."/index.php");
|
|
|
|
die();
|
2015-12-10 11:23:22 +00:00
|
|
|
};
|
2015-12-26 17:21:44 +00:00
|
|
|
/* REPONSE DU MANAGER */
|
|
|
|
$managerStatus = (isset($_GET['status'])) ? $_GET['status'] : null;
|
|
|
|
$managerTitle = (isset($_GET['title'])) ? $_GET['title'] : 'Oups!';
|
|
|
|
$managerMessage = (isset($_GET['message'])) ? $_GET['message'] : 'Erreur interne!';
|
2015-12-10 11:23:22 +00:00
|
|
|
|
2016-01-03 15:01:38 +00:00
|
|
|
/* AFFINAGE CALENDRIER */
|
|
|
|
$patientOpt = (isset($_POST['id_patient'])) ? $_POST['id_patient'] : null;
|
|
|
|
$medecinOpt = (isset($_POST['id_medecin'])) ? $_POST['id_medecin'] : null;
|
|
|
|
$moisOpt = (isset($_POST['mois'])) ? $_POST['mois'] : null;
|
|
|
|
|
2016-01-03 15:10:48 +00:00
|
|
|
$patientOpt = (!is_numeric($patientOpt)) ? null : $patientOpt;
|
|
|
|
$medecinOpt = (!is_numeric($medecinOpt)) ? null : $medecinOpt;
|
|
|
|
|
2015-12-10 11:23:22 +00:00
|
|
|
?>
|
2015-12-08 07:17:46 +00:00
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Consultations</title>
|
|
|
|
|
|
|
|
<meta charset='utf-8'/>
|
|
|
|
<meta name='description' value='Site de test'/>
|
|
|
|
<meta name='author' value='{xdrm} & SeekDaSky'/>
|
|
|
|
|
2015-12-19 17:15:04 +00:00
|
|
|
<link rel='stylesheet' href='css/font.css'/>
|
2015-12-08 07:17:46 +00:00
|
|
|
<link rel='stylesheet' href='css/animations.css'/>
|
|
|
|
<link rel='stylesheet' href='css/global.css'/>
|
2015-12-08 22:24:22 +00:00
|
|
|
<link rel='stylesheet' href='css/responsive.css'/>
|
2015-12-08 07:17:46 +00:00
|
|
|
|
2015-12-14 07:35:20 +00:00
|
|
|
<script type='text/javascript' src='js/lib/API.js'></script>
|
2015-12-14 10:01:35 +00:00
|
|
|
<script type='text/javascript' src='js/lib/adjust.js'></script>
|
2015-12-22 23:04:57 +00:00
|
|
|
<script type='text/javascript' src='js/lib/input-checker.js'></script>
|
2015-12-08 07:17:46 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
2015-12-13 22:19:22 +00:00
|
|
|
<!-- BARRE DE NOTIFICATIONS -->
|
2015-12-26 17:21:44 +00:00
|
|
|
<div id='NOTIFBAR' class='<?php echo ($managerStatus!=null) ? 'active '.$managerStatus : $managerStatus; ?>'>
|
2015-12-13 22:19:22 +00:00
|
|
|
<div></div>
|
|
|
|
<div>
|
2015-12-26 17:21:44 +00:00
|
|
|
<h3><?php echo $managerTitle; ?></h3>
|
|
|
|
<p><?php echo $managerMessage; ?></p>
|
|
|
|
<a href='?'><input type='button' value='Fermer'></a>
|
2015-12-13 22:19:22 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2015-12-08 07:17:46 +00:00
|
|
|
<!-- WRAPPER DE LA PAGE -->
|
|
|
|
<div id='WRAPPER'>
|
|
|
|
|
|
|
|
<!-- MENU DE LA PAGE -->
|
|
|
|
<nav id='MENU'>
|
|
|
|
<a href='Dashboard.php' id='ICON'></a>
|
2015-12-09 20:43:02 +00:00
|
|
|
<div>
|
|
|
|
<a href='Dashboard.php' id='dashboard'>Tableau de bord</a>
|
|
|
|
<a href='Consultations.php' id='consultations' class='active'>Consultations</a>
|
|
|
|
<a href='Medecins.php' id='medecin'>Gestion des médecins</a>
|
|
|
|
<a href='Patients.php' id='patient'>Gestion des patients</a>
|
|
|
|
</div>
|
2015-12-08 07:17:46 +00:00
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- CONTAINER DE LA PAGE -->
|
|
|
|
<section id='CONTAINER'>
|
|
|
|
|
|
|
|
<!-- FIL D'ARIANE -->
|
|
|
|
<div id='BREADCRUMB'><a href='Dashboard.php'>Accueil</a> <a href='Consultations.php'>Consultations</a></a> </div>
|
2015-12-10 11:23:22 +00:00
|
|
|
|
2015-12-26 17:21:44 +00:00
|
|
|
|
|
|
|
<?php/********************************/
|
2015-12-17 09:58:06 +00:00
|
|
|
/* CONSULTER LES RENDEZ-VOUS */
|
2016-01-03 15:01:38 +00:00
|
|
|
/*************************************/
|
|
|
|
?>
|
2015-12-17 09:58:06 +00:00
|
|
|
<article data-title="Calendrier des consultations">
|
2016-01-03 15:01:38 +00:00
|
|
|
<div><form action='' method='POST'>
|
2015-12-26 17:21:44 +00:00
|
|
|
|
|
|
|
<!-- [1] Choix du mois et l'année d'affichage -->
|
2016-01-03 15:01:38 +00:00
|
|
|
<?php
|
|
|
|
if( $moisOpt != null )
|
|
|
|
echo "<input type='text' id='csMonth' name='mois' placeholder='12/2015' value='".$moisOpt."'>Mois à afficher.<br>";
|
|
|
|
else
|
|
|
|
echo "<input type='text' id='csMonth' name='mois' placeholder='12/2015'>Mois à afficher.<br>";
|
|
|
|
?>
|
2015-12-17 09:58:06 +00:00
|
|
|
<select id='csPatient' name='id_patient'>
|
|
|
|
<?php
|
2016-01-03 15:01:38 +00:00
|
|
|
echo "<option value='*'>Tous les patients:</option>";
|
|
|
|
foreach(PatientRepo::getAll() as $PATIENT){
|
|
|
|
if( $PATIENT['Id'] == $patientOpt ) // selection par défaut
|
|
|
|
echo "<option value='".$PATIENT['Id']."' data-medecin='".$PATIENT['MedecinTraitant']."' selected>".$PATIENT['Nom']." ".$PATIENT['Prenom']."</option>";
|
|
|
|
else // sinon
|
|
|
|
echo "<option value='".$PATIENT['Id']."' data-medecin='".$PATIENT['MedecinTraitant']."'>".$PATIENT['Nom']." ".$PATIENT['Prenom']."</option>";
|
|
|
|
}
|
2015-12-17 09:58:06 +00:00
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id='csMedecin' name='id_medecin'>
|
|
|
|
<option value='*'>Tous les médecins:</option>
|
|
|
|
<?php
|
2016-01-03 15:01:38 +00:00
|
|
|
foreach(MedecinRepo::getAll() as $MEDECIN){
|
|
|
|
if( $MEDECIN['Id'] == $medecinOpt ) // selection par défaut
|
|
|
|
echo "<option value='".$MEDECIN['Id']."' selected>".$MEDECIN['Nom']." ".$MEDECIN['Prenom']."</option>";
|
|
|
|
else
|
|
|
|
echo "<option value='".$MEDECIN['Id']."'>".$MEDECIN['Nom']." ".$MEDECIN['Prenom']."</option>";
|
|
|
|
}
|
2015-12-17 09:58:06 +00:00
|
|
|
?>
|
|
|
|
</select>
|
2015-12-26 17:21:44 +00:00
|
|
|
|
2016-01-03 15:01:38 +00:00
|
|
|
<!-- <input type='hidden' name='command' value='RDV:getSVG'> -->
|
2015-12-17 09:58:06 +00:00
|
|
|
|
|
|
|
<input type='submit' value='Affiner'>
|
2015-12-26 17:21:44 +00:00
|
|
|
|
2016-01-03 15:01:38 +00:00
|
|
|
</form></div>
|
2015-12-17 09:58:06 +00:00
|
|
|
|
|
|
|
<!-- HERE COMES THE SVG -->
|
2015-12-26 17:21:44 +00:00
|
|
|
<div id='calendar'><?php
|
|
|
|
$rdv = new RDV();
|
2016-01-03 15:01:38 +00:00
|
|
|
if( $moisOpt != null && preg_match('/^(\d{2})\/(\d{4})$/', $moisOpt, $m) ){
|
|
|
|
$mois = $m[1];
|
|
|
|
$annee = $m[2];
|
|
|
|
// $rdv->getSVG(['mois'=>$moisOpt]);
|
|
|
|
// on affiche les consutations en fonction de l'affinage
|
|
|
|
foreach(RDVRepo::getForMonth($mois, $annee) as $RDV){
|
2016-01-03 15:10:48 +00:00
|
|
|
// affinage par médecin
|
|
|
|
if( $medecinOpt == null || $medecinOpt == $RDV['Medecin_Id'] ){
|
|
|
|
if( $patientOpt == null || $patientOpt == $RDV['Patient_Id'] ){
|
|
|
|
echo "<div class='RDV'>";
|
|
|
|
|
|
|
|
/* MODIFICATION */
|
|
|
|
echo "<form action='managers/' method='POST'>";
|
|
|
|
echo "<input type='text' class='jour' name='jour' value='".date('d/m/Y', strtotime($RDV['DateRDV']))."'>";
|
|
|
|
echo "<input type='text' class='heure' name='heure' value='".date('H:i', strtotime($RDV['DateRDV']))."'>";
|
2016-01-03 15:16:14 +00:00
|
|
|
echo "<input type='text' class='duree' name='Duree' value='".date('H:i', strtotime($RDV['Duree']))."'>";
|
2016-01-03 15:10:48 +00:00
|
|
|
echo "<input type='text' readonly class='Medecin' value='Medecin: ".$RDV['M_Prenom']." ".$RDV['M_Nom']."'>";
|
|
|
|
echo "<input type='text' readonly class='Patient' value='Patient: ".$RDV['P_Prenom']." ".$RDV['P_Nom']."'>";
|
|
|
|
|
|
|
|
echo "<input type='hidden' name='id_consultation' value='".$RDV['Id']."'>";
|
|
|
|
echo "<input type='hidden' name='command' value='RDV:update'>";
|
|
|
|
echo "<input type='submit' value=''>";
|
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
/* SUPPRESSION */
|
|
|
|
echo "<form action='managers/' method='POST'>";
|
|
|
|
echo "<input type='hidden' name='id_consultation' value='".$RDV['Id']."'>";
|
|
|
|
echo "<input type='hidden' name='command' value='RDV:delete'>";
|
|
|
|
echo "<input type='submit' value=''>";
|
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
echo "</div>";
|
|
|
|
}}
|
2016-01-03 15:01:38 +00:00
|
|
|
}
|
|
|
|
}
|
2015-12-26 17:21:44 +00:00
|
|
|
?></div>
|
2015-12-17 09:58:06 +00:00
|
|
|
|
|
|
|
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php/*************************************/
|
2015-12-09 12:35:43 +00:00
|
|
|
/* SAISIR UN RENDEZ-VOUS */
|
|
|
|
/*************************************/ ?>
|
2015-12-08 07:17:46 +00:00
|
|
|
<article data-title="Saisir un rendez-vous">
|
2015-12-10 09:56:35 +00:00
|
|
|
<form method='POST' action='managers/'>
|
2015-12-08 22:24:22 +00:00
|
|
|
<div>
|
2015-12-10 08:04:08 +00:00
|
|
|
<select id='newRDVPatient' name='id_patient'>
|
2015-12-09 12:35:43 +00:00
|
|
|
<option value='*'>Patient:</option>
|
2015-12-08 22:24:22 +00:00
|
|
|
<?php
|
|
|
|
foreach(PatientRepo::getAll() as $PATIENT)
|
|
|
|
echo "<option value='".$PATIENT['Id']."' data-medecin='".$PATIENT['MedecinTraitant']."'>".$PATIENT['Nom']." ".$PATIENT['Prenom']."</option>";
|
|
|
|
?>
|
2015-12-09 12:35:43 +00:00
|
|
|
</select>
|
2015-12-08 22:24:22 +00:00
|
|
|
</div><div>
|
2015-12-10 08:04:08 +00:00
|
|
|
<select id='newRDVMedecin' name='id_medecin'>
|
2015-12-08 22:24:22 +00:00
|
|
|
<option value='*'>Medecins:</option>
|
|
|
|
<?php
|
|
|
|
foreach(MedecinRepo::getAll() as $MEDECIN)
|
|
|
|
echo "<option value='".$MEDECIN['Id']."'>".$MEDECIN['Nom']." ".$MEDECIN['Prenom']."</option>";
|
|
|
|
?>
|
2015-12-09 12:35:43 +00:00
|
|
|
</select><span class='associated'>Médecin traitant du patient.</span>
|
2015-12-10 08:04:08 +00:00
|
|
|
</div><br>
|
2015-12-08 22:24:22 +00:00
|
|
|
|
2015-12-10 11:23:22 +00:00
|
|
|
<input type='text' id='inDate' name='date' placeholder='jj/mm/aaaa' required><span class='info'>Date de la consultation</span><br>
|
|
|
|
<input type='text' id='inHeure' name='heure' placeholder='HH:MM' required><span class='info'>Heure de la consultation</span><br>
|
|
|
|
<input type='text' id='inDuree' name='duree' placeholder='minutes' required><span class='info'>Durée de la consultation</span><br>
|
2015-12-10 09:56:35 +00:00
|
|
|
<br>
|
|
|
|
|
2015-12-10 11:23:22 +00:00
|
|
|
<input type='hidden' name='command' value='RDV:add'>
|
|
|
|
<input type='submit' id='sbCreer' value='Enregistrer la consultation'>
|
2015-12-08 22:24:22 +00:00
|
|
|
</form>
|
|
|
|
|
2015-12-08 07:17:46 +00:00
|
|
|
</article>
|
|
|
|
|
2015-12-26 17:21:44 +00:00
|
|
|
|
|
|
|
|
2015-12-08 07:17:46 +00:00
|
|
|
</section>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type='text/javascript' src='js/consultations.js'></script>
|
|
|
|
</body>
|
2015-12-08 08:31:51 +00:00
|
|
|
</html>
|