예제 #1
0
function profil($id)
{
    //On vérifie que le paramètre est bien un ID
    if ($id != null && $id == intval($id) && Consultation::exists($id)) {
        //Gestion du POST
        if (isset($_POST['posted'])) {
        }
        //Inclusion de la page
        $rdv = Consultation::select($id);
        $tabMedecin = Medecin::selectAll();
        $tabPatient = Patient::selectAll();
        $pConsult = Patient::select($rdv['id_patient']);
        $mConsult = Medecin::selectByID($rdv['id_medecin']);
        include VIEW . 'modifierConsultation.php';
    } else {
        unset($_POST);
        //Supprimer le post pour éviter les conflits avec l'autre page
        afficher();
        echo "<p id='mErreur'>Aucune consultation correspondante<p>";
    }
}
예제 #2
0
function profil($id = null)
{
    //On teste si on a bien au moins un paramètre et que c'est un nombre, puis que le patient existe
    if ($id != null && $id == intval($id) && Patient::exists($id)) {
        //Traitement associé au post
        if (isset($_POST['posted'])) {
            $Pcivilite = $_POST['civilite'];
            $Pnom = $_POST['nom'];
            $Pprenom = $_POST['prenom'];
            $Pdn = $_POST['date_naissance'];
            $Pln = $_POST['lieu_naissance'];
            $Pns = $_POST['num_secu'];
            $Padresse = $_POST['adresse'];
            $Pcp = $_POST['cp'];
            $Pville = $_POST['ville'];
            $Pid_med = $_POST['medecin'];
            $retour = Patient::update($id, $Pcivilite, $Pnom, $Pprenom, $Pdn, $Pln, $Pns, $Padresse, $Pcp, $Pville, $Pid_med);
        }
        $patient = Patient::select($id);
        //On récupère le médecin référent
        $medRef = Medecin::selectByID($patient['id_med']);
        //On récupère la liste des médecins pour le selecteur
        $tabMedecin = Medecin::selectAll();
        include VIEW . "modifierPatient.php";
        if (isset($retour) && $retour) {
            echo "<p id='messageOK'>Modifications effetuées</p>";
        } elseif (isset($retour)) {
            echo "<p id='mErreur'>Erreur : Veuillez contacter votre administrateur.</p>";
        }
    } else {
        unset($_POST);
        //Supprimer le post pour éviter les conflits avec l'autre page
        lister();
        echo "<p id='mErreur'>Aucun patient correspondant<p>";
    }
}
예제 #3
0
 /**
  * Get the patients registered by a user
  *
  * @return db resultset
  */
 public static function getPatientsRegistered($from, $to, $userID = 0)
 {
     $patients = Patient::select(['id'])->whereBetween('created_at', [$from, $to]);
     if ($userID > 0) {
         $patients = $patients->where('created_by', '=', $userID);
     }
     return $patients->get();
 }