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
| <?php
/* Nom du programme : choix_ajout_patient.php
/* description : Page qui permet de choisir si :
/* - on ajoute un rendez vous
/* - on ajoute un autre patient
/* - on retourne à l'accueil.
/*
*/
// Reporte toutes les erreurs PHP
error_reporting(-1);
include ("includes/header.inc.php");
include ("includes/connect.inc.php");
if (isset ($_POST['enregistre']) && $_POST['enregistre'] == "oui")
{
$connexion = mysql_connect ($host,$user,$password)
or die ("Connexion au serveur impossible");
$db=mysql_select_db($database,$connexion)
or die ("selection de la base de données impossible");
$sql = "INSERT INTO patients (id_uf,nom,prenom,naissance,sexe,chambre,enable)VALUES
( ".
"'".$id_uf."',".
"'".$_POST['nom']."',".
"'".$_POST['prenom']."',".
"'".$_POST['naissance']."',".
"'".$_POST['sexe']."',".
"'".$_POST['chambre']."',
'1')";
mysql_query ($sql) or die ('Erreur SQL !'.$sql.'<br />'.mysql_error());
$id=mysql_insert_id($connexion);
}
mysql_close ($connexion);
$nom=$_POST['nom'];
echo "l'id du patient est $id";
echo "<br/>";
echo "le patient $nom a été correctement ajouté";
echo "<br/>";
echo "Desirez-vous lui <a href='ajout_rdv.php?id=$id&id_uf=$id_uf'>ajouter</a> des rendez-vous ?<br/>";
echo "Desirez-vous <a href='ajout_patient2.php?id_uf=$id_uf'>ajouter</a> un nouveau patient ?<br/>";
echo " Sinon retournez à l'accueil ! ";
include("includes/footer.inc.php");
?>
</tr>
</table>
<?php
include ("includes/footer2.inc.php");
?> |
Partager