This commit is contained in:
KANE LAZENI 2026-03-31 21:49:18 +00:00
parent e0288e6648
commit decd9abf84
7 changed files with 319 additions and 126 deletions

View File

@ -28,4 +28,5 @@ class ControleurConsultationsinitiees extends Controleur {
$this->genererVue(array('demandes' => $demandes, 'reponsedemande' => $reponsedemande));
}
}

View File

@ -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();

View File

@ -18824,3 +18824,236 @@ function patience_connexion(){
$("#div_patienter").html('<div class="spinner-responsive">' + '<span><i class="fa fa-spinner"></i></span>' + '</div>');
}
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/");
}

View File

@ -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);
}
}

View File

@ -1,48 +1,48 @@
<?php
$this->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
<div class="col-8 text-center">
<h4 id="h4_titre" class="mb-2 text-center">
<i class="fas fa-calendar-check me-2"></i>
<?php if($idDemandeRdv == "0" && $codeEtatRdv == "0"): ?>
<?= _("Nouveau Rendez-vous") ?>
<?php if($idDemandeconsultation == "0"): ?>
<?= _("Nouvelle demande de consultation") ?>
<?php else: ?>
<?= _("Consulter un rendez-vous") ?>
<?= _("Consulter une demande") ?>
<?php endif; ?>
</h4>
</div>
@ -65,7 +65,7 @@ Initierconsultation
<div class="row">
<div class="col-12">
<?php if($idDemandeRdv == "0"): ?>
<?php if($idDemandeconsultation == "0"): ?>
<!-- Message d'information -->
<div class="alert alert-warning mt-3" style="margin-bottom:15px;">
<small>
@ -75,7 +75,7 @@ Initierconsultation
</div>
<?php else: ?>
<div id="div_numero" class="alert alert-primary text-center mb-4 py-2">
<strong style="font-size: 1.1rem;"><?= _("RDV No").": ".$numeroDemandeRdv ?></strong>
<strong style="font-size: 1.1rem;"><?= _("Demande No").": ".$numeroDemandeConsultation ?></strong>
</div>
<?php endif; ?>
@ -93,12 +93,12 @@ Initierconsultation
<div class="col-12 col-md-6">
<label class="form-label fw-bold">
<?= _("Bénéficiaire") ?>
<?php if($codeEtatRdv == "0"): ?><span class="text-danger">*</span><?php endif; ?>
<span class="text-danger">*</span>
</label>
<select class="form-select mobile-select" id="numeroBeneficiaire" name="numeroBeneficiaire"
<?= ($codeEtatRdv != "0") ? 'disabled' : '' ?>
<?= ($demandeActive == "0") ? 'disabled' : '' ?>
onChange="javascript:lienparente();"
<?= ($idDemandeRdv == "0") ? 'required autofocus' : '' ?>>
<?= ($idDemandeconsultation == "0") ? 'required autofocus' : '' ?>>
<?php liste_options($benficiaires, $numeroBeneficiaire); ?>
</select>
</div>
@ -115,46 +115,6 @@ Initierconsultation
</div>
</div>
<!-- Carte Période du RDV -->
<div class="card shadow-sm mb-4">
<div class="card-header bg-light py-3">
<h4 class="mb-0 text-primary">
<i class="fas fa-calendar-day me-2"></i>
<?= _("Période souhaitée") ?>
</h4>
</div>
<div class="card-body">
<div class="row g-3">
<!-- Début -->
<div class="col-12 col-sm-6 col-md-6 col-lg-6">
<label class="form-label fw-bold">
<?= _("Début") ?>
<?php if($codeEtatRdv == "0"): ?><span class="text-danger">*</span><?php endif; ?>
</label>
<input class="form-control form-control-sm datepicker" type="text"
id="debutRdv" name="debutRdv"
value="<?= dateLang($debutRdv, $_SESSION['lang']) ?>"
<?= ($codeEtatRdv != "0") ? 'readonly' : 'required' ?>
onChange="javascript:fin_rdv(this.value)">
</div>
<!-- Fin -->
<div class="col-12 col-sm-6 col-md-6 col-lg-6">
<label class="form-label fw-bold">
<?= _("Fin") ?>
<?php if($codeEtatRdv == "0"): ?><span class="text-danger">*</span><?php endif; ?>
</label>
<input class="form-control form-control-sm datepicker" type="text"
id="finRdv" name="finRdv"
value="<?= dateLang($finRdv, $_SESSION['lang']) ?>"
<?= ($codeEtatRdv != "0") ? 'readonly' : 'required' ?>
onChange="javascript:controle_date_fin_rdv(this.value)">
</div>
</div>
</div>
</div>
<!-- Carte Prestataire et Spécialité -->
<div class="card shadow-sm mb-4">
<div class="card-header bg-light py-3">
@ -169,9 +129,9 @@ Initierconsultation
<div class="col-12 col-md-6">
<label class="form-label fw-bold">
<?= _("Prestataire") ?>
<?php if($codeEtatRdv == "0"): ?><span class="text-danger">*</span><?php endif; ?>
<span class="text-danger">*</span>
</label>
<?php if($codeEtatRdv == "0"): ?>
<?php if($demandeActive == "1"): ?>
<div class="d-none d-md-block">
<input id="searchInputPrestataire" name="searchInputPrestataire"
class="form-control" type="text" required
@ -184,7 +144,7 @@ Initierconsultation
<!-- Affichage mobile (cartes) -->
<div class="d-md-none">
<select class="form-select mobile-select" id="codePrestataire" name="codePrestataire"
<?= ($codeEtatRdv != "0") ? 'disabled' : 'required' ?>>
<?= ($demandeActive == "0") ? 'disabled' : 'required' ?>>
<?php liste_options($prestataires, $codePrestataire); ?>
</select>
</div>
@ -197,10 +157,10 @@ Initierconsultation
<div class="col-12 col-md-6">
<label class="form-label fw-bold">
<?= _("Spécialité") ?>
<?php if($codeEtatRdv == "0"): ?><span class="text-danger">*</span><?php endif; ?>
<span class="text-danger">*</span>
</label>
<select class="form-select mobile-select" id="codeSpecialite" name="codeSpecialite"
<?= ($codeEtatRdv != "0") ? 'disabled' : 'required' ?>>
<?= ($demandeActive != "0") ? 'disabled' : 'required' ?>>
<?php liste_options($specialites, $codeSpecialite); ?>
</select>
</div>
@ -208,12 +168,12 @@ Initierconsultation
</div>
</div>
<!-- Carte Motif du RDV -->
<!-- Carte Motif de la consultation -->
<div class="card shadow-sm mb-4">
<div class="card-header bg-light py-3">
<h4 class="mb-0 text-primary">
<i class="fas fa-stethoscope me-2"></i>
<?= _("Motif du rendez-vous") ?>
<?= _("Motif de la consultation") ?>
</h4>
</div>
<div class="card-body">
@ -221,21 +181,21 @@ Initierconsultation
<div class="col-12">
<label class="form-label fw-bold">
<?= _("Motif RDV") ?>
<?php if($codeEtatRdv == "0"): ?><span class="text-danger">*</span><?php endif; ?>
<span class="text-danger">*</span>
</label>
<textarea id="motifRdv" name="motifRdv" class="form-control" rows="6" style="height: 150px !important;"<?= ($codeEtatRdv != "0") ? 'disabled' : 'required' ?>><?= $motifRdv ?></textarea>
<textarea id="motifConsultation" name="motifConsultation" class="form-control" rows="6" style="height: 150px !important;"<?= ($demandeExpiree != "0") ? 'disabled' : 'required' ?>><?= $motifConsultation ?></textarea>
</div>
</div>
</div>
</div>
<!-- Section Réponse (si RDV existant) -->
<?php if($idDemandeRdv > "0"): ?>
<?php if($idDemandeconsultation > "0"): ?>
<div class="card shadow-sm mb-4">
<div class="card-header bg-light py-3">
<h4 class="mb-0 text-primary">
<i class="fas fa-reply me-2"></i>
<?= _("Réponse à la demande") ?>
<?= _("Traitement de la demande") ?>
</h4>
</div>
<div class="card-body">
@ -243,41 +203,29 @@ Initierconsultation
<!-- État Réponse -->
<div class="col-12 col-md-6 col-lg-3">
<label class="form-label fw-bold"><?= _("Etat Réponse") ?></label>
<?php if($codeEtatRdv == "1"):?>
<div class="alert alert-success py-2 text-center mb-0 etatRdv"><?= $etatRdv; ?></div>
<?php elseif($codeEtatRdv == "0"): ?>
<div class="alert alert-warning py-2 text-center mb-0 etatRdv"><?= $etatRdv; ?></div>
<?php if($demandeEffectuee == "1"):?>
<div class="alert alert-success py-2 text-center mb-0 etatRdv"> <?= _("Effectuée") ?></div>
<?php elseif($demandeExpiree == "1"): ?>
<div class="alert alert-warning py-2 text-center mb-0 etatRdv"> <?= _("Expirée") ?></div>
<?php else: ?>
<div class="alert alert-danger py-2 text-center mb-0 etatRdv"><?= $etatRdv; ?></div>
<div class="alert alert-warning py-2 text-center mb-0 etatRdv"><?= _("En attente") ?></div>
<?php endif; ?>
</div>
<!-- Date Réponse -->
<!-- Heure consultation -->
<div class="col-12 col-md-6 col-lg-3">
<label class="form-label fw-bold"><?= _("Date Réponse") ?></label>
<label class="form-label fw-bold"><?= _("Heure consultation") ?></label>
<input class="form-control" type="text"
value="<?= dateLang($dateReponseRdv, $_SESSION['lang']) ?>" readonly>
value="<?= dateLang($heureConsultation, $_SESSION['lang']) ?>" readonly>
</div>
<!-- Motif Réponse -->
<div class="col-12">
<label class="form-label fw-bold"><?= _("Motif Réponse") ?></label>
<textarea class="form-control" rows="3" disabled><?= $motifReponseRdv ?></textarea>
<!-- Heure Expiration -->
<div class="col-12 col-md-6 col-lg-3">
<label class="form-label fw-bold"><?= _("Heure Expiration") ?></label>
<input class="form-control" type="text"
value="<?= dateLang($heureExpiration, $_SESSION['lang']) ?>" readonly>
</div>
<!-- Date et Heure RDV Accordée -->
<?php if($codeEtatRdv == "1"):?>
<div class="col-12 col-md-6">
<label class="form-label fw-bold"><?= _("Date RDV") ?></label>
<input class="form-control" type="text"
value="<?= dateLang($dateRdvAccordee, $_SESSION['lang']) ?>" readonly>
</div>
<div class="col-12 col-md-6">
<label class="form-label fw-bold"><?= _("Heure RDV") ?></label>
<input class="form-control" type="text"
value="<?= $heureRdvAccordee ?>" readonly>
</div>
<?php endif; ?>
</div>
</div>
</div>
@ -288,21 +236,22 @@ Initierconsultation
<div class="card-body">
<div class="row g-3">
<div class="col-12">
<?php if($idDemandeRdv == "0" && $codeEtatRdv == "0"): ?>
<?php if($idDemandeconsultation == "0"): ?>
<button class="btn btn-primary w-100 py-2 btn_autre"
onClick="javascript:enregistrer_rdv();">
<i class="fas fa-save me-2"></i><?= _("Enregistrer le RDV") ?>
onClick="javascript:enregistrer_demande_consultation();">
<i class="fas fa-save me-2"></i><?= _("Enregistrer la demande") ?>
</button>
<?php elseif($codeEtatRdv == "0"): ?>
<?php elseif($demandeActive == "1"): ?>
<button class="btn btn-warning w-100 py-2 btn_autre"
onClick="javascript:modifier_rdv();">
<i class="fas fa-edit me-2"></i><?= _("Modifier le RDV") ?>
onClick="javascript:modifier_demande_consultation();">
<i class="fas fa-edit me-2"></i><?= _("Modifier la demande") ?>
</button>
<?php else: ?>
<div class="text-center text-muted py-2">
<small>
<i class="fas fa-info-circle me-2"></i>
<?= _("Cette demande de rendez-vous a été traitée.") ?>
<?= _("Cette demande de consultation a été traitée.") ?>
<?= ($demandeEffectuee=="1") ? _("Cette demande de consultation a été traitée.") : _("Cette demande de consultation a expirée.") ?>
</small>
</div>
<?php endif; ?>

View File

@ -42,7 +42,6 @@
$dateRdvAccordee = "";
$heureRdvAccordee = "";
}
?>
<div class="card shadow-lg border-0 mb-4" style="border-radius: 15px;">

View File

@ -522,7 +522,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.css" integrity="sha512-3pIirOrwegjM6erE5gPSwkUzO+3cTjpnV9lexlNZqvupR64iZBnOOTiiLPb9M36zpMScbmUNIcHUqKD47M719g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js" integrity="sha512-VEd+nq25CkR676O+pLBnDW09R7VQX9Mdiij052gVCp5yVH3jGtH70Ho/UUv4mJDsEdTvqRCFZg0NKGiojGnUCw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="Js/fonctions.js?ver=2026.01.16.00"></script>
<script src="Js/fonctions.js?ver=2026.03.31.00"></script>
<script src="Bootstrap/js/bootstrap.min.js"></script>
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>