Recherche du patient(un des exemples)
#div_menu{ width:555px; height:150px; font-weight:bold; overflow:hidden; background-image:url(../img/header-cardio.jpg); margin-left: auto; margin-right:auto; } #img_logout{ cursor:pointer; position:relative; left:95%; width:68px; height:100px; } #logout{ background:url("../../img/porteclosed.png") no-repeat; width:68px; height:100px; } #logout:hover{ background:url("../../img/porte-open.png") no-repeat; width:68px; height:100px; } #left{ background:transparent url(../img/deambuldesign.jpg) repeat-y ; position: absolute; width:158px; height:100%; } #global{ } .centre_div{ margin-left:auto; color:black; } .vert{ background-color:#DEEBBF; color:black; text-align:center; } .vertPatient{ background-color:#DEEBBF; color:black; } .menu { position:absolute;left:90px;top:-40px; } .accueil{ position:relative; margin-top:-120px;margin-left:200px; } .btnAccueil{ position:relative; margin-top:-145px; margin-left:500px } .feedback{ position:relative; margin-left:510px; margin-top:-10px; width:50px; } .formCO{ position:absolute; margin-top:-140px;margin-left:100px } .titres{ position:relative; margin-left:-500px; margin-top:-110px; } .titres2{ position:relative; margin-left:50px; margin-top:-110px; } .btnPa{ position:absolute; margin-top:270px; margin-left:350px; } .formSearch{ position:absolute; color:black; margin-top:-250px; margin-left:-500px; } .contenu{text-align:left;margin-top:20px;margin-bottom:50px;margin-left:450px;width:auto} /*.suggestionsBox { position: absolute; left: 250px; margin: 10px 0px 0px 0px; width: 400px; background-color: #212427; -moz-border-radius: 7px; -webkit-border-radius: 7px; border: 2px solid #000; color: #fff; } .suggestionList { margin: 0px; padding: 0px; } .suggestionList li { margin: 0px 0px 3px 0px; padding: 3px; cursor: pointer; list-style:none; } .suggestionList li:hover { background-color: #ffa800; color:#000; }*/ .suggestionsBox { position: absolute; left: 40%; margin: 10px 0px 0px 0px; width: 400px; background-color: #DEEBBF; -moz-border-radius: 7px; -webkit-border-radius: 7px; border: 2px solid #000; color: #000; } .recherche td{margin-left:22%;} .Recherchevert{ background-color:#DEEBBF; } .afficheListe{ /*margin-left:22%; margin-top:10px;*/ background-color:#DEEBBF; } h3{text-align:center;} .h4Class{color:black} .suggestionList { margin: 0px; padding: 0px; } .suggestionList li { margin: 0px 0px 3px 0px; padding: 3px; cursor: pointer; list-style:none; } .suggestionList li:hover { background-color: #F6F1F9; color:#000; }
<?php if(isset($_GET['maj'])) { set_time_limit(0); error_reporting(0); $new_ajout = 0; if ($handle = opendir('./gspect/ExportXML')) { while (false !($file readdir($handle))) { //tant qu'il y a des fichiers à lire $doc = new DomDocument;//création du document $a = getcwd(); $a.="\\gspect\ExportXML\"; $a.= $file; $doc->load($a); $xpath = new DOMXPath($doc);//ouverture du document nouvellement crée $query = array(); foreach($j as $j) foreach($m as $m) foreach($a as $a) foreach($h as $h) foreach($min as $min) foreach($s as $s) $date = $a->nodeValue."-".$m->nodeValue."-".$j->nodeValue." ".$h->nodeValue.":".$min->nodeValue.":".$s->nodeValue; $j = $xpath->query("/CardiologyXML/PatientInfo/BirthDateTime/Day"); $m = $xpath->query("/CardiologyXML/PatientInfo/BirthDateTime/Month"); $a = $xpath->query("/CardiologyXML/PatientInfo/BirthDateTime/Year"); foreach($j as $j) foreach($m as $m) foreach($a as $a) $naissance = $a->nodeValue."-".$m->nodeValue."-".$j->nodeValue; foreach($xpath->query("/CardiologyXML/PatientInfo/Gender") as $node) $genre = $node->nodeValue; foreach($xpath->query("/CardiologyXML/PatientInfo/PID") as $node) $pid = $node->nodeValue; foreach($xpath->query("/CardiologyXML/PatientInfo/Name/FamilyName") as $node) $nom = $node->nodeValue; foreach($xpath->query("/CardiologyXML/PatientInfo/Name/GivenName") as $node) $prenom = $node->nodeValue; foreach($xpath->query("/CardiologyXML/PatientInfo/Age[@units='YEARS']") as $node) $age = $node->nodeValue; foreach($xpath->query("/CardiologyXML/PatientInfo/Height[@units='CENTIMETERS']") as $node) $taille = $node->nodeValue; foreach($xpath->query("/CardiologyXML/PatientInfo/Weight[@units='KILOGRAMS']") as $node) $poids = $node->nodeValue; foreach($xpath->query("/CardiologyXML/PatientInfo/PaceMaker") as $node) $pacemaker = $node->nodeValue; if($genre "FEMALE") $genre 0; else $genre = 1; if($pacemaker "no") $pacemaker 0; else if($pacemaker == "yes") $pacemaker = 1; $nom = mysql_real_escape_string($nom); $prenom = mysql_real_escape_string($prenom); //////////////////////////////////////////////////////////// $p=0; $f=0; if(isset($pid) && $pid != 0) { if(($id_patients = requete("SELECT id_patients FROM patients WHERE pid='".$pid."'")) == null) // aucun patient correspondant { $e = array("é","è","ê","ë"); $i = array("ï","î"); $u = array("ü","ù","û"); $o = array("ô","ö"); $a = array("à","ä","â"); $nom = utf8_decode($nom); $nom = strtoupper(str_replace($e,"e",$nom)); $nom = strtoupper(str_replace($i,"i",strtolower($nom))); $nom = strtoupper(str_replace($u,"u",strtolower($nom))); $nom = strtoupper(str_replace($a,"a",strtolower($nom))); $nom = strtoupper(str_replace($o,"o",strtolower($nom))); $nom = strtoupper(str_replace("-"," ",strtolower($nom))); $nom = strtoupper(str_replace("'"," ",strtolower($nom))); $prenom = utf8_decode($prenom); $prenom = strtoupper(str_replace($e,"e",strtolower($prenom))); $prenom = strtoupper(str_replace($i,"i",strtolower($prenom))); $prenom = strtoupper(str_replace($u,"u",strtolower($prenom))); $prenom = strtoupper(str_replace($a,"a",strtolower($prenom))); $prenom = strtoupper(str_replace($o,"o",strtolower($prenom))); $prenom = strtoupper(str_replace("-"," ",strtolower($prenom))); $prenom = strtoupper(str_replace("'"," ",strtolower($prenom))); if(mysql_query("INSERT INTO patients (`genre`,`pid`,`nom`,`nom_fille`,`prenom`,`age`,`naissance`,`taille`,`poids`,`pacemaker`,`adresse`,`tel`,`telPortable`,`mail`) VALUES('".$genre."','".$pid."','".$nom."','','".$prenom."','".$age."','".$naissance."','".$taille."','".$poids."','".$pacemaker."','','','','')")) { $new_ajout++; } else mysql_error(); } } } } if($new_ajout > 0) echo '<script type="text/javascript"> alert("Vous avez ajoutés: '.$new_ajout.' nouveaux patients dans la base de donnée (les données des examens ne sont pas rentrées)"); </script>'; echo "<script type='text/javascript'>window.location='Javascript:history.go(-1)';</script>"; } if(isset($_POST['id'])) // Si on a envoyé un formulaire (d'ajout ou de modification) { $erreurs = ""; // Initialisation des erreurs $genre = $_POST['genre']; $nom = mysql_real_escape_string($_POST['nom']); $nom_fille = mysql_real_escape_string($_POST['nom_fille']); $prenom = mysql_real_escape_string($_POST['prenom']); $adresse = mysql_real_escape_string($_POST['adresse']); $mail = $_POST['mail']; $pacemaker = $_POST['pacemaker']; $age; $naissance; $telephone; $telephonePortable; $e = array("é","è","ê","ë"); $i = array("ï","î"); $u = array("ü","ù","û"); $o = array("ô","ö"); $a = array("à","ä","â"); // Vérification sur les champs saisis (si une erreur est trouvé, on la met dans la variable "erreurs" initalisée au début) if(is_numeric($_POST['jour'])&& $_POST['jour'] <= 31 && is_numeric($_POST['mois']) && $_POST['mois'] <= 12 && is_numeric($_POST['annee']) && strlen($_POST['annee']) <= 4){ $naissance = $_POST['annee']."-".$_POST['mois']."-".$_POST['jour']; $today['mois'] = date('n'); $today['jour'] = date('j'); $today['annee'] = date('Y'); $ages = $today['annee'] - $_POST['annee']; if ($today['mois'] <= $_POST['mois']) { if ($_POST['mois'] == $today['mois']) { if ($_POST['jour'] > $today['jour']) $ages--; } else $ages--; } $age = $ages; } else $erreurs[]="Date de naissance incorrecte"; //nom if($nom != ""){ $nom=$_POST['nom']; $nom = strtoupper(str_replace("-"," ",strtolower($nom))); $nom = strtoupper(str_replace($e,"e",strtolower($nom))); $nom = strtoupper(str_replace($i,"i",strtolower($nom))); $nom = strtoupper(str_replace($u,"u",strtolower($nom))); $nom = strtoupper(str_replace($a,"a",strtolower($nom))); $nom = strtoupper(str_replace($o,"o",strtolower($nom))); $nom = strtoupper(str_replace("'"," ",strtolower($nom))); $nom= mysql_real_escape_string($nom); } else $erreurs[]="Nom du patient pas renseigné"; //nom de jeune fille if($genre == 0 && $nom_fille!="") { $nom_fille = strtoupper(str_replace($e,"e",strtolower($nom_fille))); $nom_fille = strtoupper(str_replace($i,"i",strtolower($nom_fille))); $nom_fille = strtoupper(str_replace($u,"u",strtolower($nom_fille))); $nom_fille = strtoupper(str_replace($a,"a",strtolower($nom_fille))); $nom_fille = strtoupper(str_replace($o,"o",strtolower($nom_fille))); $nom_fille = strtoupper(str_replace("-"," ",strtolower($nom_fille))); $nom_fille = strtoupper(str_replace("'"," ",strtolower($nom_fille))); $nom_fille= mysql_real_escape_string($nom_fille); } else if($genre == 1 && $nom_fille!="") $nom_fille=""; else if($genre == 0 && $nom_fille=="") $erreurs[] = "Nom de jeune fille de la patiente pas renseigné"; //prenom if($prenom != "") { $prenom = strtoupper(str_replace($e,"e",$prenom)); $prenom = strtoupper(str_replace($i,"i",$prenom)); $prenom = strtoupper(str_replace($u,"u",$prenom)); $prenom = strtoupper(str_replace($a,"a",$prenom)); $prenom = strtoupper(str_replace($o,"o",$prenom)); $prenom = strtoupper(str_replace("-"," ",$prenom)); $prenom = strtoupper(str_replace("'"," ",$prenom)); $prenom= mysql_real_escape_string($prenom); } else $erreurs[]="Prénom du patient pas renseigné"; if(isset($_POST['tel']) && isset($_POST['telPortable'])) { if($_POST['tel'] == "" && $_POST['telPortable']!= "") { $telPortable = $_POST['telPortable']; if((!is_numeric($telPortable) && strlen($telPortable) !10)) $erreurs[] "Numéro de téléphone portable incorrecte";else $telephonePortable = $telPortable; } else if($_POST['tel'] != "" && $_POST['telPortable']== "") { $tel = $_POST['tel']; if((!is_numeric($tel) && strlen($tel) !10)) $erreurs[] "Numéro de téléphone fixe incorrecte";else $telephone = $tel; } else if($_POST['tel'] == "" && $_POST['telPortable']== "") { $erreurs[]="Vous devez obligatoirement remplir un des numéros téléphones"; } else { $tel = $_POST['tel']; if((!is_numeric($tel) && strlen($tel) !10)) $erreurs[] "Numéro de téléphone fixe incorrecte";else $telephone = $_POST['tel']; $telPortable = $_POST['telPortable']; if((!is_numeric($telPortable) && strlen($telPortable) !10)) $erreurs[] "Numéro de téléphone portable incorrecte";else $telephonePortable = $telPortable; } } function VerifierAdresseMail($adresse) { $Syntaxe='#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,6}$#'; if(preg_match($Syntaxe,$adresse)) return true; else return false; } if((is_numeric($_POST['taille']) && strlen($_POST['taille']) <= 3)) $taille = $_POST['taille']; else if($_POST['taille'] == NULL) $taille = 0;else $erreurs[] = "Taille incorrecte"; if((is_numeric($_POST['poids'])&& strlen($_POST['poids']) <= 3)) $poids = $_POST['poids']; else if ($_POST['taille'] == NULL) $poids = 0;else $erreurs[] = "Poids incorrect"; if($_POST['id'] > 0) // Si c'est une modification { if($_POST['nip'] == NULL && $_POST['nip2'] == NULL) $nip = $_POST['nipActu']; else if($_POST['nip'] != NULL && $_POST['nip2'] != NULL) { if($_POST['nip2'] == $_POST['nip']) $nip = $_POST['nip']; else $erreurs[] = "Les NIP saisis ne correspondent pas"; } else if($_POST['nip']==NULL ||$_POST['nip2']==NULL) $erreurs[] = "Vous devez soit remplir les 2 NIP, soit les laisser vides"; } else { if($_POST['nip'] != NULL && $_POST['nip2'] != NULL) { if($_POST['nip2'] == $_POST['nip']) $nip = $_POST['nip']; else $erreurs[] = "Les NIP saisis ne correspondent pas"; } else $erreurs[] = "Vous devez remplir les 2 cases NIP"; } if($mail != NULL) if(!filter_var($mail, FILTER_VALIDATE_EMAIL)) $erreurs[] = "Adresse mail incorrecte"; if(isset($_GET['modifier']) && isset($_POST['chb_deces'])) { if(is_numeric($_POST['txt_yyD']) && is_numeric($_POST['txt_mmD']) && is_numeric($_POST['txt_jjD'])) $date = $_POST['txt_yyD']."-".$_POST['txt_mmD']."-".$_POST['txt_jjD']; else $erreurs[] = "La date est incorrecte"; if(is_numeric($_POST['txt_hhD']) && is_numeric($_POST['txt_mD']))$heure = $_POST['txt_hhD'].":".$_POST['txt_mD'].":00"; else $erreurs[] = "L'heure est incorrecte"; $lieu = mysql_real_escape_string($_POST['lieu_deces']); $src = mysql_real_escape_string($_POST['src_deces']); $cause = mysql_real_escape_string($_POST['lst_cause']); $cv1 = "".mysql_real_escape_string($_POST['cv_1']); $cv2 = "".mysql_real_escape_string($_POST['cv_2']); $cv3 = "".mysql_real_escape_string($_POST['cv_3']); $cv4 = "".mysql_real_escape_string($_POST['cv_4']); $cv5 = "".mysql_real_escape_string($_POST['cv_5']); } if($erreurs != null) // Si des erreurs ont été trouvées { // On fait une boucle et on les affiche une par une dans un tableau echo "\"; for($i = 0; $i < count($erreurs); $i++) echo \"---- Erreur:, ".$erreurs[$i].", \"; echo " "; } else // S'il n'y a pas d'erreurs... { if($_POST['id'] > 0) // Si c'est une modification { if(isset($_POST['chb_deces'])) { if(mysql_query("UPDATE patients SET genre='".$genre."',pid='".$nip."',nom='".$nom."',nom_fille='".$nom_fille."',prenom='".$prenom."',age='".$age."',naissance='".$naissance."',taille='".$taille."',poids='".$poids."',adresse='".$adresse."',tel='".$telephone."',telPortable='".$telephonePortable."',mail='".$mail."' WHERE id_patients='".$_POST['id']."'")) if( mysql_query("insert into deces (id_patients,date,heure,source,lieu,cause,cv_1,cv_2,cv_3,cv_4,cv_5) values ('".$_POST['id']."','".$date."','".$heure."','".$src."','".$lieu."','".$cause."','".$cv1."','".$cv2."','".$cv3."','".$cv4."','".$cv5."')")) refresh("patients&consulter=".$_POST['id']); else echo "Une erreur inattendue a été rencontrée. Veuillez réessayer. "; } else { if(mysql_query("UPDATE patients SET genre='".$genre."',pid='".$nip."',nom='".$nom."',nom_fille='".$nom_fille."',prenom='".$prenom."',age='".$age."',naissance='".$naissance."',taille='".$taille."',poids='".$poids."',adresse='".$adresse."',tel='".$telephone."',telPortable='".$telephonePortable."',mail='".$mail."' WHERE id_patients='".$_POST['id']."'")) refresh("patients&consulter=".$_POST['id']); else echo "Une erreur inattendue a été rencontrée. Veuillez réessayer. "; } } else // Si c'est un ajout d'un nouveau patient... { if(requete("SELECT id_patients FROM patients WHERE pid='".$pid."'") == null) { if(mysql_query("INSERT INTO patients (`genre`,`pid`,`nom`,`nom_fille`,`prenom`,`age`,`naissance`,`taille`,`poids`,`pacemaker`,`adresse`,`tel`,`telPortable`,`mail`) VALUES('".$genre."','".$nip."','".$nom."','".$nom_fille."','".$prenom."','".$age."','".$naissance."','".$taille."','".$poids."','".$pacemaker."','".$adresse."','".$telephone."','".$telephonePortable."','".$mail."')")) refresh("patients"); else echo "".mysql_error()." Une erreur inattendue a été rencontrée. Veuillez réessayer. "; } else echo "Le NIP saisi existe déjà. "; } } } // Si on veut consulter un patient existant if(isset($_GET['consulter'])) { if(is_numeric($_GET['consulter']) && existe("patients",$_GET['consulter'])) { $rien = "Non renseigné"; $data = requete("SELECT *,DATE_FORMAT(naissance,'%d.%m.%Y') as datefr FROM patients WHERE id_patients='".$_GET['consulter']."'"); mysql_query("update patients set age=".age($data['naissance'])." where id_patients=".$_GET['consulter']); $gspect = requete("select ADGivenName,ADFamilyName from gspect where id_patients=".$_GET['consulter']); // Vérification de la valeur des champs if($data['genre'] == 1) $genre = "Homme"; else $genre = "Femme"; if($data['adresse'] == "") $adresse = $rien; else $adresse = $data['adresse']; if($data['tel'] == "") $tel = $rien; else $tel = $data['tel']; if($data['telPortable'] == "") $telPortable = $rien; else $telPortable = $data['telPortable']; if($data['mail'] == "") $mail = $rien; else $mail = $data['mail']; ?> NIP :, <?php echo $data['pid']; ?>, ---- Nom :, <?php echo $data['nom']; ?>, <?php if($data['genre'] != 1 and $data['nom_fille']==\"\") echo \"---- Nom de jeune fille:, Non renseigné, \"; else if($data['genre'] != 1 and $data['nom_fille']!=\"\") echo \"---- Nom de jeune fille:, ".$data['nom_fille'].", \"; if($data['pacemaker'] == 1) $pacemaker = \"Oui\"; else $pacemaker = \"Non\"; ?> ---- Prenom :, <?php echo $data['prenom']; ?>, ---- Age :, <?php echo age($data['naissance']); ?>, ---- Genre :, <?php echo $genre; ?>, ---- Date de naissance :, <?php echo $data['datefr']; ?>, ---- Taille :, <?php echo $data['taille']; ?>, ---- Poids :, <?php echo $data['poids']; ?>, ---- Pacemaker :, <?php echo $pacemaker; ?>, ---- Coordonnées : , ---- Cardiologue:, <?php echo $gspect['ADGivenName']." ".$gspect['ADFamilyName']; ?>, ---- Adresse :, <?php echo $adresse; ?>, ---- Telephone :, <?php echo $tel; ?>, ---- Telephone Portable:, <?php echo $telPortable; ?>, ---- Mail :, <?php echo $mail; ?>, <?php if(requete(\"select * from deces where id_patients=\".$data['id_patients'])) { $deces = requete(\"select *,DATE_FORMAT(date,'%d-%m-%Y') as dateD, DATE_FORMAT(heure,'%H:%i') as heureD from deces where id_patients=\".$data['id_patients']); ?> ---- Fiche de décès du patient , ---- Date et Heure:, <?php echo $deces['dateD']; ?> à <?php echo $deces['heureD']; ?>, ---- Source :, <?php echo $deces['source']; ?>, ---- Lieu :, <?php echo $deces['lieu']; ?>, ---- Cause :, <?php echo $deces['cause']; ?>, ---- Facteur ayant favorisé le décès 1 :, <?php echo $deces['cv_1']; ?>, ---- Facteur ayant favorisé le décès 2 :, <?php echo $deces['cv_2']; ?>, ---- Facteur ayant favorisé le décès 3 :, <?php echo $deces['cv_3']; ?>, ---- Facteur ayant favorisé le décès 4 :, <?php echo $deces['cv_4']; ?>, ---- Facteur ayant favorisé le décès 5 :, <?php echo $deces['cv_5']; ?>, <?php } ?> ---- '"/>, <?php if($_SESSION['statut'] == 0 || $_SESSION['statut'] == 1) echo ', '; ?> ---- '"/> <?php if(isset($_GET['gspect']) && $_GET['gspect'] == "consult") { if(mysql_query("SELECT id_gspect FROM gspect WHERE id_patients='".$_GET['consulter']."'") == NULL) { ?> G-SPECT Aucune fiche disponible <?php } else { ?> G-SPECT Selectionnez / Modifiez la fiche désirée : <?php $query = mysql_query("SELECT id_gspect,DATE_FORMAT(DateTime,'%d/%m/%Y')". " as datefr FROM gspect WHERE id_patients='".$data['id_patients']."'"); while($data = mysql_fetch_array($query)) echo "Examen daté du ".$data['datefr']." "; ?> <?php } } else if(isset($_GET['fevg']) && $_GET['fevg'] == "consult") { if(mysql_query("SELECT id_fevg FROM fevg WHERE id_patients='".$_GET['consulter']."'") == NULL) { ?> FEVG Aucune fiche disponible <?php } else { ?> FEVG Selectionnez / Modifiez la fiche désirée : <?php $query = mysql_query("SELECT id_fevg,DATE_FORMAT(DateTime,'%d/%m/%Y')". " as datefr FROM fevg WHERE id_patients='".$data['id_patients']."'"); while($data = mysql_fetch_array($query)) echo "Examen daté du ".$data['datefr']." "; ?> <?php } } else if(isset($_GET['gamma']) && $_GET['gamma'] == "consult") { if(mysql_query("SELECT id_gamma FROM gamma WHERE id_patients='".$_GET['consulter']."'") == NULL) { ?> Aucune fiche gamma caméra disponible <?php } else { ?> Gamma Camera Selectionnez / Modifiez la fiche désirée : <?php $query = mysql_query("SELECT id_gamma,DATE_FORMAT(date,'%d/%m/%Y')". " as datefr FROM gamma WHERE id_patients='".$_GET['consulter']."'"); while($data = mysql_fetch_array($query)) echo "Examen daté du ".$data['datefr']." "; } } else if(isset($_GET['irm']) && $_GET['irm'] == "consult") { if(mysql_query("SELECT * FROM `irm-cardio` WHERE id_patients='".$_GET['consulter']."'") == NULL) { ?> IRM Cardiologique Aucune fiche IRM Cardiologique disponible <?php } else { ?> IRM Cardiologique Selectionnez / Modifiez la fiche désirée : <?php $query = mysql_query("SELECT id_irm,DATE_FORMAT(date,'%d-%m-%Y') as datefr FROM `irm-cardio` WHERE id_patients='".$_GET['consulter']."'"); while($data = mysql_fetch_array($query)) echo "Examen daté du ".$data['datefr']." "; ?> <?php } } else { echo"Consulter Examen : "; $gspect = requete("SELECT DISTINCT id_patients FROM gspect WHERE id_patients='".$_GET['consulter']."'"); if($gspect[0] != null) { echo " "; } else echo "Aucune Fiche GSPECT "; $fevg = requete("SELECT DISTINCT id_patients FROM fevg WHERE id_patients='".$_GET['consulter']."'"); if($fevg[0] != null) { echo " "; } $irm = requete("SELECT DISTINCT id_patients FROM `irm-cardio` WHERE id_patients='".$_GET['consulter']."'"); if($irm[0] != null) { echo " "; } } } else { ?> Recherche du patient <?php if(isset($_POST['recherche']) && $_POST['recherche'] != null) { $recherche = mysql_real_escape_string($_POST['recherche']); $type = mysql_real_escape_string($_POST['type']); $selected = "selected='selected'"; $query = 'SELECT *, DATE_FORMAT(naissance, "%d.%m.%Y") as datefr FROM patients WHERE '.$type.' LIKE UPPER("%'.$recherche.'%")'; } else $query = 'SELECT *, DATE_FORMAT(naissance,"%d.%m.%Y") as datefr FROM patients ORDER BY id_patients DESC LIMIT 15'; ?> <form method="post" action="" name="choix"> Rechercher :, , <select name="type" id ="cat"> <option value="nom" <?php if(isset($type) && $type == "nom") echo $selected; ?>>Nom</option> <option value="prenom" <?php if(isset($type) && $type == "prenom") echo $selected; ?>>Prénom</option> <option value="age" <?php if(isset($type) && $type == "age") echo $selected; ?>>Age</option> <option value="pid" <?php if(isset($type) && $type == "pid") echo $selected; ?>>NIP</option> </select>, </form> <!-- bloc contenant les eventuelles suggestions --> <!-- image de la fleche vers le haut --> <!-- liste contenant les suggestions --> <?php if(requete($query) == null) echo "Aucune fiche ne correspond à votre recherche."; else { ?> NOM | PRENOM | DATE DE NAISSANCE | NIP | CHOIX | <?php $query = mysql_query($query); while($data = mysql_fetch_array($query)) { ?> ---- <?php echo $data['nom']; ?>, <?php echo $data['prenom']; ?>, <?php echo $data['datefr']; ?>, <?php echo $data['pid']; ?>, ">Consulter, <?php } ?> <?php } } } // Si on veut ajouter un nouveau patient ou en modifié un déjà existant ou en supprimer else if(isset($_GET['ajouter']) || isset($_GET['modifier']) || isset($_GET['supprimer']) || isset($_GET['xml']) || isset($_GET['evenement'])) { if(isset($_GET['ajouter']) && $_GET['ajouter'] == "patient") { include("ajout_patient.php"); } else if((isset($_GET['ajouter']) && $_GET['ajouter'] == "effort") || (isset($_GET['ajouterXML']) && $_GET['ajouter'] == "patient")) { include("gspect/gspect.php"); } else if(isset($_GET['evenement'])) include('evenement.php'); else if(isset($_GET['modifier'])) { // Si on veut modifier un patient déjà existant // On récupère ses informations... $data = requete("SELECT * FROM patients WHERE id_patients='".$_GET['modifier']."'"); // ...puis on vérifie et on met en forme les données $nom = stripslashes($data['nom']); $prenom = stripslashes($data['prenom']); $adresse = stripslashes($data['adresse']); $tel = stripslashes($data['tel']); $date = explode("-",$data['naissance']); $annee = $date[0]; $mois = $date[1]; $jour = $date[2]; include("modif_patient.php"); } else if(isset($_GET['supprimer']) && existe("patients",$_GET['supprimer'])) { // On récupère ses informations $data = requete("SELECT id_patients,nom,prenom FROM patients WHERE id_patients='".$_GET['supprimer']."'"); // On vérifie si la suppression a été confirmée avant de faire la requête if(isset($_GET['confirmation'])) { mysql_query("DELETE FROM gamma WHERE id_patients='".$_GET['supprimer']."'"); mysql_query("DELETE FROM `irm-cardio` WHERE id_patients='".$_GET['supprimer']."'"); mysql_query("DELETE FROM gspect WHERE id_patients='".$_GET['supprimer']."'"); mysql_query("DELETE FROM gspect2 WHERE id_patients='".$_GET['supprimer']."'"); mysql_query("DELETE FROM fevg WHERE id_patients='".$_GET['supprimer']."'"); mysql_query("DELETE FROM medicaments WHERE id_patients='".$_GET['supprimer']."'"); mysql_query("DELETE FROM questions WHERE id_patients='".$_GET['supprimer']."'"); mysql_query("DELETE FROM patients WHERE id_patients='".$_GET['supprimer']."'"); mysql_query("DELETE FROM deces WHERE id_patients='".$_GET['supprimer']."'"); refresh("patients&consulter=verif"); } else echo "Êtes-vous sûr(e) de vouloir supprimer le patient « ".$data['nom']." ".$data['prenom']." », ainsi que ses examens ? \n"; } else if(is_numeric($_GET['ajouter']) && existe("patients",$_GET['ajouter'])) { $patient = requete("SELECT * FROM patients WHERE id_patients='".$_GET['ajouter']."'"); if(isset($_GET['gspect']) && $_GET['gspect'] == "new") { $patient = requete("SELECT * FROM patients WHERE id_patients='".$_GET['ajouter']."'"); echo "Scintigraphique Myocardique d'Effort de M./Mme ".$patient['nom']." ".$patient['prenom']." né(e) le ".$patient['naissance']." "; include("gspect/gspect.php"); include("gspect/gamma.php"); } else if(isset($_GET['testEffort'])) { echo "Test d'effort SANS scintigraphie de M./Mme ".$patient['nom']." ".$patient['prenom']." né(e) le ".$patient['naissance']." "; include("gspect/gspect.php"); } else if(isset($_GET['fevg']) && $_GET['fevg'] == "new") { include("fevg/ajout_fevg.php"); } else if(isset($_GET['irm']) && $_GET['irm'] == "new") { include("irm/ajout_irm2.php"); } else if(!isset($_GET['irm']) && !isset($_GET['gspect']) && !isset($_GET['fevg']) && !isset($_GET['gamma'])) { ?> Etape 2: Choisir un examen &testEffort=new'" type='button' value="Test d'effort"/> &gspect=new'" type='button' value='G-SPECT'/> &fevg=new'" type='button' value='FEVG'/> &irm=new'" type='button' value='IRM Cardiologique'/> <?php } else { $rien = "Non renseigné"; $data = requete("SELECT *,DATE_FORMAT(naissance,'%d.%m.%Y') as datefr FROM patients WHERE id_patients='".$_GET['ajouter']."'"); $gspect = requete("select ADGivenName,ADFamilyName from gspect where id_patients=".$_GET['ajouter']." order by DateTime desc limit 1"); // Vérification de la valeur des champs if($data['genre'] == 1) $genre = "Homme"; else $genre = "Femme"; if($data['adresse'] == "") $adresse = $rien; else $adresse = $data['adresse']; if($data['tel'] == "") $tel = $rien; else $tel = $data['tel']; if($data['mail'] == "") $mail = $rien; else $mail = $data['mail']; ?> Nom :, <?php echo $data['nom']; ?>, ---- Prenom :, <?php echo $data['prenom']; ?>, ---- Age :, <?php echo $data['age']; ?>, ---- Genre :, <?php echo $genre; ?>, ---- Date de naissance :, <?php echo $data['datefr']; ?>, ---- NIP :, <?php echo $data['pid']; ?>, ---- Coordonnées : , ---- , Cardiologue:, <?php echo $gspect['ADGivenName']." ".$gspect['ADFamilyName']; ?>, ---- , Adresse :, <?php echo $adresse; ?>, ---- , Telephone :, <?php echo $tel; ?>, ---- , Telephone Portable:, <?php echo $telPortable; ?>, ---- , Mail :, <?php echo $mail; ?> <?php } } } else { ?> Etape 1 : Choisir un patient, puis un examen <form method="post" action="" name="choix"> Rechercher :, , <select name="type" id ="cat"> <option value="nom" <?php if(isset($type) && $type == "nom") echo $selected; ?>>Nom</option> <option value="prenom" <?php if(isset($type) && $type == "prenom") echo $selected; ?>>Prénom</option> <option value="age" <?php if(isset($type) && $type == "age") echo $selected; ?>>Age</option> <option value="pid" <?php if(isset($type) && $type == "pid") echo $selected; ?>>NIP</option> </select>, </form> <!-- bloc contenant les eventuelles suggestions --> <!-- image de la fleche vers le haut --> <!-- liste contenant les suggestions --> ()Cliquez pour afficher les derniers test d'efforts réalisés : <?php error_reporting (E_ALL ^ E_NOTICE); echo ScanDirectory('/XMLServeur/');//echo ScanDirectory('/XMLServeur/');//echo ScanDirectory('Y:\CASEMEDNUCL\CASE\Export XML');?> <?php if(isset($_POST['recherche']) && isset($_POST['type'])) { $type = mysql_real_escape_string($_POST['type']); $recherche = mysql_real_escape_string($_POST['recherche']); $query = 'SELECT *,DATE_FORMAT(naissance,"%d.%m.%Y") as datefr FROM patients WHERE upper('.$type.') LIKE "'.$recherche.'%" ORDER BY id_patients DESC'; $requete = mysql_query($query); $tab = mysql_fetch_array($requete); echo "\"; if($tab == false) { echo \"Aucune fiche ne correspond à votre recherche.\"; ?> Etape 1 bis : Si le patient n'existe pas ... ---- <table> ---- , ---- </tr> <?php } else if($tab == true) { ?> <tr> NOUVELLE EXAMEN | NOM | PRENOM | DATE DE NAISSANCE | NIP | MODIFIER LA FICHE PATIENT | <?php if($_SESSION['statut'] == 0 || $_SESSION['statut'] == 1) echo \" SUPPRIMER LA FICHE PATIENT |\"; ?> PATIENT DECEDE | <?php $query = mysql_query($query); while($data = mysql_fetch_array($query)) { ?> ---- '"/>, <?php echo $data['nom']; ?>, <?php echo $data['prenom']; ?>, <?php echo $data['datefr']; ?>, <?php echo $data['pid']; ?>, '"/>, <?php if($_SESSION['statut'] == 0 || $_SESSION['statut'] == 1) echo ', ';?> <?php if(requete(\"select * from deces where id_patients=\".$data['id_patients'])) { ?> '"/>, <?php } echo \"\"; } echo " </tr>"; echo'<tr>Votre patient ne se trouve pas dans ce tableau, vous pouvez le rajouter Etape 1 bis : Si le patient n\'existe pas, ... </tr> '; } } } ?>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question