diff --git a/Controleur/ControleurConsultationsinitiees.php b/Controleur/ControleurConsultationsinitiees.php index 7ad09a3..c2b2e56 100755 --- a/Controleur/ControleurConsultationsinitiees.php +++ b/Controleur/ControleurConsultationsinitiees.php @@ -28,4 +28,5 @@ class ControleurConsultationsinitiees extends Controleur { $this->genererVue(array('demandes' => $demandes, 'reponsedemande' => $reponsedemande)); } + } \ No newline at end of file diff --git a/Controleur/ControleurInitierconsultation.php b/Controleur/ControleurInitierconsultation.php index 50b22c7..84e62c1 100755 --- a/Controleur/ControleurInitierconsultation.php +++ b/Controleur/ControleurInitierconsultation.php @@ -20,11 +20,11 @@ class ControleurInitierconsultation extends Controleur { public function index() { - $idDemandeRdv = $_SESSION['idDemandeRdv'] ?? '0'; + $idDemandeconsultation = $_SESSION['idDemandeconsultation'] ?? '0'; $benficiaires = $this->rendezvous->getBeneficaire(); - $demande = $this->rendezvous->getDemandeRdv($idDemandeRdv); + $demande = $this->rendezvous->getDemandeConsultation($idDemandeconsultation); $specialites = $this->rendezvous->getSpecialiteRdv(); diff --git a/Js/fonctions.js b/Js/fonctions.js index 6f94300..722b783 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -18824,3 +18824,236 @@ function patience_connexion(){ $("#div_patienter").html('
' + '' + '
'); } + +function enregistrer_demande_consultation() +{ + alert("enregistrer_demande_consultation"); + + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + debutRdv = $("#debutRdv").val(); + finRdv = $("#finRdv").val(); + codePrestataire = $("#codePrestataire").val(); + codeSpecialite = $("#codeSpecialite").val(); + + if (numeroBeneficiaire<=" ") + { + v_msg="Sélectionner un bénéficiaire!"; + v_msgEng="Select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroBeneficiaire").focus(); + return; + } + + if (debutRdv<=" ") + { + v_msg="La date de début de rendez-vous est obligatoire!"; + v_msgEng="The appointment start date is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#debutRdv").focus(); + return; + } + + if (finRdv<=" ") + { + v_msg="La motif de fin de rendez-vous est obligatoire!"; + v_msgEng="The end date of the appointment is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#finRdv").focus(); + return; + } + + if (codePrestataire<=" ") + { + v_msg="Sélectionner un prestataire pour le rendez-vous!"; + v_msgEng="Select a provider for the appointment!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + return; + } + + if (codeSpecialite<=" ") + { + v_msg="La spécialité de rendez-vous est obligatoire!"; + v_msgEng="The appointment specialty is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeSpecialite").focus(); + return; + } + + motifRdv = $("#motifRdv").val(); + motifRdv = motifRdv.trim(); + + if (motifRdv<=" ") + { + v_msg="Le motif de rendez-vous est obligatoire!"; + v_msgEng="The reason for the appointment is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifRdv").focus(); + return; + } + + + v_msg="Confirmez-vous l'enregistrement de votre demande?"; + v_msgEng="Do you confirm the registration of your request?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'numeroBeneficiaire='+ numeroBeneficiaire+'&debutRdv='+debutRdv; + donnees += '&finRdv='+finRdv+'&codePrestataire='+codePrestataire; + donnees += '&codeSpecialite='+codeSpecialite+'&motifRdv='+motifRdv; + + vLink = "Ajaxdemanderdv/enregistrer/"; + + $.ajax({ + type: "POST", + url: $("#racineWeb").val()+vLink, + data:donnees, + error: function(errorData) { + }, + success: function(data) { + // alert(data); + // $('#div_test_gabarit').html(data); + + }, + complete: function() { + // ouvrir_rdv(); + historique_rdv(); + } + + }); + + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function modifier_demande_consultation() +{ + alert("modifier_demande_consultation"); + + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + debutRdv = $("#debutRdv").val(); + finRdv = $("#finRdv").val(); + codePrestataire = $("#codePrestataire").val(); + codeSpecialite = $("#codeSpecialite").val(); + + if (numeroBeneficiaire<=" ") + { + v_msg="Sélectionner un bénéficiaire!"; + v_msgEng="Select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroBeneficiaire").focus(); + return; + } + + if (debutRdv<=" ") + { + v_msg="La date de début de rendez-vous est obligatoire!"; + v_msgEng="The appointment start date is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#debutRdv").focus(); + return; + } + + if (finRdv<=" ") + { + v_msg="La motif de fin de rendez-vous est obligatoire!"; + v_msgEng="The end date of the appointment is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#finRdv").focus(); + return; + } + + if (codePrestataire<=" ") + { + v_msg="Sélectionner un prestataire pour le rendez-vous!"; + v_msgEng="Select a provider for the appointment!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + return; + } + + if (codeSpecialite<=" ") + { + v_msg="La spécialité de rendez-vous est obligatoire!"; + v_msgEng="The appointment specialty is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeSpecialite").focus(); + return; + } + + motifRdv = $("#motifRdv").val(); + motifRdv = motifRdv.trim(); + + if (motifRdv<=" ") + { + v_msg="Le motif de rendez-vous est obligatoire!"; + v_msgEng="The reason for the appointment is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifRdv").focus(); + return; + } + + + v_msg="Confirmez-vous la modification de votre demande?"; + v_msgEng="Do you confirm the modification of your request?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'numeroBeneficiaire='+ numeroBeneficiaire+'&debutRdv='+debutRdv; + donnees += '&finRdv='+finRdv+'&codePrestataire='+codePrestataire; + donnees += '&codeSpecialite='+codeSpecialite+'&motifRdv='+motifRdv; + + vLink = "Ajaxdemanderdv/modifier/"; + + $.ajax({ + type: "POST", + url: $("#racineWeb").val()+vLink, + data:donnees, + error: function(errorData) { + }, + success: function(data) { + // alert(data); + // $('#div_test_gabarit').html(data); + + }, + complete: function() { + + historique_rdv(); + } + + }); + + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function historique_demande_consultation() +{ + alert("historique_demande_consultation"); + + window.location.assign($("#racineWeb" ).val()+"Consultationsinitiees/"); +} diff --git a/Modele/Rendezvous.php b/Modele/Rendezvous.php index 4cddf7e..2839938 100755 --- a/Modele/Rendezvous.php +++ b/Modele/Rendezvous.php @@ -84,5 +84,16 @@ class Rendezvous extends Modele { $debutRdv, $finRdv, $motifRdv, $idDemandeRdv)); } + + public function getDemandeConsultation($idDemandeconsultation) + { + $sql = 'Call sp_a_demande_consultation(?)'; + + $liste = $this->executerRequete($sql,array($idDemandeconsultation)); + + return $liste->fetch(PDO::FETCH_ASSOC); + + } + } \ No newline at end of file diff --git a/Vue/Initierconsultation/index.php b/Vue/Initierconsultation/index.php index 9583d74..abaf6a3 100755 --- a/Vue/Initierconsultation/index.php +++ b/Vue/Initierconsultation/index.php @@ -1,48 +1,48 @@ titre = "Intersanté - Prise de rendez-vous"; + $this->titre = _("Intersanté - Demande consultation"); - $idDemandeRdv = $_SESSION['idDemandeRdv'] ?? "0"; + $idDemandeconsultation = $_SESSION['idDemandeconsultation'] ?? "0"; - if($idDemandeRdv > "0"){ - $numeroDemandeRdv = $this->nettoyer($demande['numeroDemandeRdv']); - $codeEtatRdv = $this->nettoyer($demande['codeEtatRdv']); - $lien = $this->nettoyer($demande['lien']); + $demandeActive = "1"; + + if($idDemandeconsultation > "0"){ + $numeroDemandeConsultation = $this->nettoyer($demande['numeroDemandeConsultation']); + $lien = $this->nettoyer($demande['lien']); $numeroBeneficiaire = $this->nettoyer($demande['numeroBeneficiaire']); - $motifRdv = $this->nettoyer($demande['motifRdv']); - $debutRdv = $this->nettoyer($demande['debutRdv']); - $finRdv = $this->nettoyer($demande['finRdv']); + $motifConsultation = $this->nettoyer($demande['motifConsultation']); + $heureConsultation = $this->nettoyer($demande['heureConsultation']); + $HeureExpiration = $this->nettoyer($demande['HeureExpiration']); $codePrestataire = $this->nettoyer($demande['codePrestataire']); $prestataire = $this->nettoyer($demande['prestataire']); $codeSpecialite = $this->nettoyer($demande['codeSpecialite']); - $etatRdv = $this->nettoyer($demande['etatRdv']); - $dateReponseRdv = $this->nettoyer($demande['dateReponseRdv']); - $motifReponseRdv = $this->nettoyer($demande['motifReponseRdv']); - $dateRdvAccordee = $this->nettoyer($demande['dateRdvAccordee']); - $heureRdvAccordee = $this->nettoyer($demande['heureRdvAccordee']); + $demandeExpiree = $this->nettoyer($demande['demandeExpiree']); + $demandeEffectuee = $this->nettoyer($demande['effectuee']); + $dateSysteme = $this->nettoyer($demande['dateSysteme']); if (est_anglophone()){ $lien = $this->nettoyer($demande['lienEng']); - $etatRdv = $this->nettoyer($demande['etatRdvEng']); } }else{ - $numeroDemandeRdv = "0"; - $codeEtatRdv = "0"; - $lien = ""; - $numeroBeneficiaire = ""; - $motifRdv = ""; - $debutRdv = date('Y-m-d'); - $finRdv = date('Y-m-d'); - $codePrestataire = ""; - $prestataire = ""; - $codeSpecialite = ""; - $etatRdv = ""; - $dateReponseRdv = ""; - $motifReponseRdv = ""; - $dateRdvAccordee = ""; - $heureRdvAccordee = ""; + $numeroDemandeConsultation = "0"; + $lien = ""; + $numeroBeneficiaire = ""; + $motifConsultation = ""; + $heureConsultation = date('Y-m-d H:i:s'); + $HeureExpiration = date('Y-m-d H:i:s'); + $codePrestataire = ""; + $prestataire = ""; + $codeSpecialite = ""; + $demandeExpiree = "0"; + $demandeEffectuee = "0"; + $dateSysteme = date('Y-m-d H:i:s'); + } + + $demandeExpiree = $this->nettoyer($demande['demandeExpiree']); + $demandeEffectuee = $this->nettoyer($demande['effectuee']); + if($demandeEffectuee=="1" || $demandeExpiree=="1"){ + $demandeActive = "0"; } - ?> Initierconsultation @@ -53,10 +53,10 @@ Initierconsultation

- - + + - +

@@ -65,7 +65,7 @@ Initierconsultation
- +
@@ -75,7 +75,7 @@ Initierconsultation
- +
@@ -93,12 +93,12 @@ Initierconsultation
@@ -115,46 +115,6 @@ Initierconsultation
- -
-
-

- - -

-
- -
-
- -
- - - onChange="javascript:fin_rdv(this.value)"> -
- - -
- - - onChange="javascript:controle_date_fin_rdv(this.value)"> -
-
-
-
-
@@ -169,9 +129,9 @@ Initierconsultation
- +
@@ -197,10 +157,10 @@ Initierconsultation
@@ -208,12 +168,12 @@ Initierconsultation
- +

- +

@@ -221,21 +181,21 @@ Initierconsultation
- +
- "0"): ?> + "0"): ?>

- +

@@ -243,41 +203,29 @@ Initierconsultation
- -
- -
+ +
+ +
-
+
- +
- + + value="" readonly>
- -
- - + +
+ +
- - -
- - -
-
- - -
-
@@ -288,21 +236,22 @@ Initierconsultation
- + - +
- + +
diff --git a/Vue/Rendezvous/index.php b/Vue/Rendezvous/index.php index ed77718..7f68cc4 100755 --- a/Vue/Rendezvous/index.php +++ b/Vue/Rendezvous/index.php @@ -42,7 +42,6 @@ $dateRdvAccordee = ""; $heureRdvAccordee = ""; } - ?>
diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 9c65f0a..5a61ae4 100755 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -522,7 +522,7 @@ - +