390 lines
17 KiB
PHP
390 lines
17 KiB
PHP
<?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 = "";
|
|
}
|
|
|
|
?>
|
|
|
|
<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">
|
|
<h2 class="mb-0 text-primary">
|
|
<i class="fas fa-user-injured me-2"></i>
|
|
<?= _("Informations du bénéficiaire") ?>
|
|
</h2>
|
|
</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">
|
|
<h2 class="mb-0 text-primary">
|
|
<i class="fas fa-calendar-day me-2"></i>
|
|
<?= _("Période souhaitée") ?>
|
|
</h2>
|
|
</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">
|
|
<h2 class="mb-0 text-primary">
|
|
<i class="fas fa-hospital-user me-2"></i>
|
|
<?= _("Prestataire et spécialité") ?>
|
|
</h2>
|
|
</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">
|
|
<h2 class="mb-0 text-primary">
|
|
<i class="fas fa-stethoscope me-2"></i>
|
|
<?= _("Motif du rendez-vous") ?>
|
|
</h2>
|
|
</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="4"
|
|
<?= ($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">
|
|
<h2 class="mb-0 text-primary">
|
|
<i class="fas fa-reply me-2"></i>
|
|
<?= _("Réponse à la demande") ?>
|
|
</h2>
|
|
</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>
|