This commit is contained in:
KANE LAZENI 2026-03-31 16:41:22 +00:00
parent 8574c9cad1
commit 5041aa96de
4 changed files with 622 additions and 0 deletions

View File

@ -0,0 +1,31 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Rendezvous.php';
require_once 'Modele/Menuvueutilisateur.php';
class ControleurConsultationsinitiees extends Controleur {
private $menuvue;
private $rendezvous;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue('Consultationsinitiees');
$this->rendezvous = new Rendezvous();
$_SESSION['idDemandeRdv'] = '0';
}
public function index() {
$idAdherent = $_SESSION['idAdherent_C'];
$d1 = $_SESSION['debutMois_C'];
$d2 = date('Y-m-d');
$codeEtatRdv = $_SESSION['codeEtatRdv'] ?? "";
$demandes = $this->rendezvous->getPrisesRdv($idAdherent, $d1, $d2, $codeEtatRdv);
$reponsedemande = $this->rendezvous->getEtatRdv();
$this->genererVue(array('demandes' => $demandes, 'reponsedemande' => $reponsedemande));
}
}

View File

@ -0,0 +1,37 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Rendezvous.php';
require_once 'Modele/Prestataire.php';
require_once 'Modele/Ged.php';
require_once 'Modele/Menuvueutilisateur.php';
class ControleurInitierconsultation extends Controleur {
private $menuvue;
private $rendezvous;
private $prestataire;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue('Initierconsultation');
$this->rendezvous = new Rendezvous();
$this->prestataire = new Prestataire();
}
public function index()
{
$idDemandeRdv = $_SESSION['idDemandeRdv'] ?? '0';
$benficiaires = $this->rendezvous->getBeneficaire();
$demande = $this->rendezvous->getDemandeRdv($idDemandeRdv);
$specialites = $this->rendezvous->getSpecialiteRdv();
$prestataires = $this->prestataire->getprestatairerdvmobile();
$this->genererVue(array('benficiaires' => $benficiaires, 'demande' => $demande,
'specialites' => $specialites, 'prestataires' => $prestataires));
}
}

View File

@ -0,0 +1,163 @@
<?php
$this->titre = "Intersanté - Historique prises Rendez-vous";
$codeEtatRdv = $_SESSION['codeEtatRdv'] ?? "";
?>
Consultationsinitiees
<div class="card shadow-lg border-0 mb-4" style="border-radius: 15px;">
<div class="card-header bg-primary text-white py-3" style="border-radius: 15px 15px 0 0;">
<div class="row align-items-center">
<div class="col-8 text-center">
<h4 id="h4_titre" class="mb-2 text-center">
<i class="fas fa-clock me-2"></i>
<?= _("Demandes de rendez-vous") ?>
</h4>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<input class="sr-only" id="nomForm" name="nomForm" value="histordv">
<!-- Filtres de recherche -->
<div class="card shadow-sm mb-8">
<div class="card-header bg-light mt-0 mb-1">
<h4 class="mb-0 text-primary">
<?= _("Entrer les critères de recherche") ?>
</h4>
</div>
<div class="card shadow-sm mb-4">
<div class="card-body">
<div class="row g-3 align-items-end">
<!-- Période du -->
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
<label class="form-label fw-bold">
<?= _("Période du") ?> <span class="text-danger">*</span>
</label>
<input class="form-control form-control-sm datepicker" type="text"
id="d1" name="d1"
value="<?= dateLang($_SESSION['debutExercice_C'], $_SESSION['lang']) ?>" required>
</div>
<!-- Période au -->
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
<label class="form-label fw-bold">
<?= _("au") ?> <span class="text-danger">*</span>
</label>
<input class="form-control form-control-sm datepicker" type="text"
id="d2" name="d2"
value="<?= dateCouranteLang($_SESSION['lang'], $_SESSION['lang']) ?>" required>
</div>
<!-- État -->
<div class="col-12 col-sm-6 col-md-4 col-lg-2">
<label class="form-label fw-bold"><?= _("Etat") ?></label>
<select class="form-select form-select-sm" id="codeEtatRdv" name="codeEtatRdv">
<?php liste_options_consultation($reponsedemande, $codeEtatRdv); ?>
</select>
</div>
<!-- Bouton Actualiser -->
<div class="col-12 col-sm-6 col-md-4 col-lg-4">
<button type="button" class="btn btn-primary w-100 btn_autre"
onclick="javascript:listerrdv();">
<i class="fas fa-sync-alt me-2"></i><?= _("Actualiser") ?>
</button>
</div>
</div>
</div>
</div>
<!-- Résultats -->
<div id="div_dossiers" class="table-responsive">
</div>
</div>
</div>
</div>
<style>
.legend-title {
color: #2c3e50;
font-weight: 600;
padding-bottom: 10px;
border-bottom: 2px solid #3498db;
}
.card {
border: none;
border-radius: 10px;
}
.form-label {
font-size: 0.9rem;
}
.table th {
font-size: 0.85rem;
font-weight: 600;
white-space: nowrap;
}
.table td {
font-size: 0.85rem;
vertical-align: middle;
}
/* Styles pour mobile */
@media (max-width: 768px) {
.card-body {
padding: 1rem;
}
.btn {
padding: 0.35rem 0.5rem;
font-size: 0.8rem;
}
.table-responsive {
font-size: 0.8rem;
}
.badge {
font-size: 0.75rem;
}
}
/* Version ultra-mobile */
@media (max-width: 576px) {
.table th, .table td {
padding: 0.4rem;
}
.btn-sm {
padding: 0.25rem 0.4rem;
}
}
/* Tooltip personnalisé */
.tooltip-inner {
max-width: 300px;
text-align: left;
}
</style>
<script>
// Initialiser les tooltips Bootstrap
document.addEventListener('DOMContentLoaded', function() {
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
// Adapter l'affichage sur mobile
function adaptForMobile() {
if (window.innerWidth < 768) {
// Actions supplémentaires pour petits écrans
}
}
adaptForMobile();
window.addEventListener('resize', adaptForMobile);
});
</script>

391
Vue/Initierconsultation/index.php Executable file
View File

@ -0,0 +1,391 @@
<?php
$this->titre = "Intersanté - Prise de rendez-vous";
$idDemandeRdv = $_SESSION['idDemandeRdv'] ?? "0";
if($idDemandeRdv > "0"){
$numeroDemandeRdv = $this->nettoyer($demande['numeroDemandeRdv']);
$codeEtatRdv = $this->nettoyer($demande['codeEtatRdv']);
$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']);
$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']);
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 = "";
}
?>
Initierconsultation
<div class="card shadow-lg border-0 mb-4" style="border-radius: 15px;">
<div class="card-header bg-primary text-white py-3" style="border-radius: 15px 15px 0 0;">
<div class="row align-items-center">
<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 else: ?>
<?= _("Consulter un rendez-vous") ?>
<?php endif; ?>
</h4>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<?php if($idDemandeRdv == "0"): ?>
<!-- Message d'information -->
<div class="alert alert-warning mt-3" style="margin-bottom:15px;">
<small>
<i class="fas fa-exclamation-circle me-2"></i>
<?= _("Les astérisques (*) sont obligatoires.")?>
</small>
</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>
</div>
<?php endif; ?>
<!-- Carte principale du formulaire -->
<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-user-injured me-2"></i>
<?= _("Informations du bénéficiaire") ?>
</h4>
</div>
<div class="card-body">
<div class="row g-3">
<!-- Bénéficiaire -->
<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; ?>
</label>
<select class="form-select mobile-select" id="numeroBeneficiaire" name="numeroBeneficiaire"
<?= ($codeEtatRdv != "0") ? 'disabled' : '' ?>
onChange="javascript:lienparente();"
<?= ($idDemandeRdv == "0") ? 'required autofocus' : '' ?>>
<?php liste_options($benficiaires, $numeroBeneficiaire); ?>
</select>
</div>
<!-- Lien Parenté -->
<div class="col-12 col-md-6">
<label class="form-label fw-bold"><?= _("Lien Parenté") ?></label>
<div id="div_lien">
<input class="form-control" type="text" id="lienDemandeur" name="lienDemandeur"
value="<?= $lien ?>" readonly>
</div>
</div>
</div>
</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">
<h4 class="mb-0 text-primary">
<i class="fas fa-hospital-user me-2"></i>
<?= _("Prestataire et spécialité") ?>
</h4>
</div>
<div class="card-body">
<div class="row g-3">
<!-- Prestataire -->
<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; ?>
</label>
<?php if($codeEtatRdv == "0"): ?>
<div class="d-none d-md-block">
<input id="searchInputPrestataire" name="searchInputPrestataire"
class="form-control" type="text" required
onkeyup="javascript:affichelisteprestataires(this.value);"
value="<?= $prestataire; ?>"
placeholder="<?= _('Rechercher un prestataire') ?>">
<input class="sr-only" type="text" id="codePrestataire" name="codePrestataire" value="<?= $codePrestataire; ?>">
<div id="div_selection_prestataire" class="mt-2"></div>
</div>
<!-- Affichage mobile (cartes) -->
<div class="d-md-none">
<select class="form-select mobile-select" id="codePrestataire" name="codePrestataire"
<?= ($codeEtatRdv != "0") ? 'disabled' : 'required' ?>>
<?php liste_options($prestataires, $codePrestataire); ?>
</select>
</div>
<?php else: ?>
<input class="form-control" type="text" readonly value="<?= $prestataire; ?>">
<?php endif; ?>
</div>
<!-- Spécialité -->
<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; ?>
</label>
<select class="form-select mobile-select" id="codeSpecialite" name="codeSpecialite"
<?= ($codeEtatRdv != "0") ? 'disabled' : 'required' ?>>
<?php liste_options($specialites, $codeSpecialite); ?>
</select>
</div>
</div>
</div>
</div>
<!-- Carte Motif 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-stethoscope me-2"></i>
<?= _("Motif du rendez-vous") ?>
</h4>
</div>
<div class="card-body">
<div class="row g-3">
<div class="col-12">
<label class="form-label fw-bold">
<?= _("Motif RDV") ?>
<?php if($codeEtatRdv == "0"): ?><span class="text-danger">*</span><?php endif; ?>
</label>
<textarea id="motifRdv" name="motifRdv" class="form-control" rows="6" style="height: 150px !important;"<?= ($codeEtatRdv != "0") ? 'disabled' : 'required' ?>><?= $motifRdv ?></textarea>
</div>
</div>
</div>
</div>
<!-- Section Réponse (si RDV existant) -->
<?php if($idDemandeRdv > "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") ?>
</h4>
</div>
<div class="card-body">
<div class="row g-3">
<!-- É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 else: ?>
<div class="alert alert-danger py-2 text-center mb-0 etatRdv"><?= $etatRdv; ?></div>
<?php endif; ?>
</div>
<!-- Date Réponse -->
<div class="col-12 col-md-6 col-lg-3">
<label class="form-label fw-bold"><?= _("Date Réponse") ?></label>
<input class="form-control" type="text"
value="<?= dateLang($dateReponseRdv, $_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>
</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>
<?php endif; ?>
<!-- Boutons d'action -->
<div class="card shadow-sm">
<div class="card-body">
<div class="row g-3">
<div class="col-12">
<?php if($idDemandeRdv == "0" && $codeEtatRdv == "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") ?>
</button>
<?php elseif($codeEtatRdv == "0"): ?>
<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") ?>
</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.") ?>
</small>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<style>
.legend-title {
color: #2c3e50;
font-weight: 600;
padding-bottom: 10px;
border-bottom: 2px solid #3498db;
}
.card {
border: none;
border-radius: 10px;
}
.form-label {
font-size: 0.9rem;
}
/* Styles pour mobile */
@media (max-width: 768px) {
.card-body {
padding: 1rem;
}
.btn {
padding: 0.5rem;
}
}
/* Version ultra-mobile */
@media (max-width: 576px) {
.card-body {
padding: 0.75rem;
}
.form-control, .form-select {
font-size: 0.9rem;
}
}
/* Style pour la liste déroulante des prestataires */
#div_selection_prestataire {
position: absolute;
z-index: 1000;
background: white;
border: 1px solid #ddd;
border-radius: 4px;
max-height: 200px;
overflow-y: auto;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
#div_selection_prestataire div {
padding: 8px 12px;
cursor: pointer;
border-bottom: 1px solid #eee;
}
#div_selection_prestataire div:hover {
background-color: #f8f9fa;
}
</style>
<script>
// Adapter l'interface pour mobile
document.addEventListener('DOMContentLoaded', function() {
function adaptForMobile() {
if (window.innerWidth < 768) {
// Ajustements spécifiques pour mobile
}
}
adaptForMobile();
window.addEventListener('resize', adaptForMobile);
});
</script>