projet-php/Patients.php

125 lines
4.4 KiB
PHP
Executable File

<?php session_start();
require('autoloader.php');
if(!Authentification::checkUser(0)){
header("Location: http://".$_SERVER['HTTP_HOST']."/index.php");
die();
};
// formattage $_GET['type']
$answerType = (isset($_GET['type'])) ? $_GET['type'] : null;
?>
<!DOCTYPE html>
<html>
<head>
<title>Gestion des patients</title>
<meta charset='utf-8'/>
<meta name='description' value='Site de test'/>
<meta name='author' value='{xdrm} & SeekDaSky'/>
<link rel='stylesheet' href='css/animations.css'/>
<link rel='stylesheet' href='css/global.css'/>
<link rel='stylesheet' href='css/purple.theme.css'/>
<link rel='stylesheet' href='css/responsive.css'/>
<script type='text/javascript' src='js/adjust.js'></script>
<script type='text/javascript' src='js/input-checker.js'></script>
</head>
<body>
<!-- BARRE DE NOTIFICATIONS -->
<div id='NOTIFBAR'>
<div></div>
<div>
<h3>Oups!</h3>
<p>Certains champs sont incorrects. Veuillez réessayer.</p>
<input type='button' value='Fermer'>
</div>
</div>
<!-- WRAPPER DE LA PAGE -->
<div id='WRAPPER'>
<!-- MENU DE LA PAGE -->
<nav id='MENU'>
<a href='Dashboard.php' id='ICON'></a>
<div>
<a href='Dashboard.php' id='dashboard'>Tableau de bord</a>
<a href='Consultations.php' id='consultations'>Consultations</a>
<a href='Medecins.php' id='medecin'>Gestion des médecins</a>
<a href='Patients.php' id='patient' class='active'>Gestion des patients</a>
</div>
</nav>
<!-- CONTAINER DE LA PAGE -->
<section id='CONTAINER'>
<!-- FIL D'ARIANE -->
<div id='BREADCRUMB'><a href='Dashboard.php'>Accueil</a> <a href='Patients.php'>Gestion des Patients</a></a> </div>
<?php if( $answerType != null ){
echo '<span>';
switch($answerType){
case 'creation': echo 'Patient créé.'; break;
case 'error': echo 'Une erreur est survenue.'; break;
default: echo 'rien à déclarer ? Non!'; break;
}
echo '</span>';
}
/*************************************/
/* AJOUTER UN PATIENT */
/*************************************/ ?>
<article data-title="Ajouter un patient">
<form method='POST' action='managers/'>
<!--
+ Civilite ('M' ou 'F')
+ prenom
+ nom
+ adresse
+ adresse2
+ code_postal
+ ville
+ date_naissance
+ lieu_naissance
+ num_secu
+ medecin_traitant
-->
<br><h4>Ajout d'un nouveau patient</h4>
<input type='text' id='crPrenom' name='prenom' placeholder='Prénom' value='' required><br>
<input type='text' id='crNom' name='nom' placeholder='NOM' value='' required><br>
<input type='radio' name='civilite' value='M' id='civ1' checked><label for='civ1'>Homme</label><br>
<input type='radio' name='civilite' value='F' id='civ2'><label for='civ2'>Femme</label><br>
<input type='text' id='crAdr' name='adresse' placeholder='Adresse' value='' required><br>
<input type='text' id='crAdr2' name='adresse2' placeholder='Complément adresse' value=''><br>
<input type='text' id='crCP' name='code_postal' placeholder='09000' value='' required><span class='info'>Code postal</span><br>
<input type='text' id='crVille' name='ville' placeholder='Ville' value='' required><br>
<input type='text' id='crDN' name='date_naissance' placeholder='jj/mm/aaaa' value='' required><span class='info'>Date de naissance</span><br>
<input type='text' id='crLN' name='lieu_naissance' placeholder='Ville de naissance' value='' required><br>
<input type='text' id='crSecu' name='num_secu' placeholder='1 99 19 99 999 999 99' value='' required><span class='info'>Numéro de sécurité sociale</span><br>
<span>Choix du médecin traitant (optionnel)</span><br>
<select id='crMedecin' name='id_medecin'><?php
foreach(MedecinRepo::getAll() as $MEDECIN)
echo "<option value='".$MEDECIN['Id']."'>".$MEDECIN['Nom']." ".$MEDECIN['Prenom']."</option>";
?></select>
<br>
<input type='hidden' name='command' value='Patient:add'>
<input type='submit' id='sbCreer' value='Créer le patient'>
</form>
</article>
</section>
</div>
<script type='text/javascript' src='js/patients.js'></script>
</body>
</html>