345 lines
14 KiB
PHP
Executable File
345 lines
14 KiB
PHP
Executable File
<?php
|
|
$this->titre = _("Intersanté - Demande consultation");
|
|
|
|
$idDemandeconsultation = $_SESSION['idDemandeconsultation'] ?? "0";
|
|
|
|
$demandeActive = "1";
|
|
|
|
if($idDemandeconsultation > "0"){
|
|
$numeroDemandeConsultation = $this->nettoyer($demande['numeroDemandeConsultation']);
|
|
$lien = $this->nettoyer($demande['lien']);
|
|
$numeroBeneficiaire = $this->nettoyer($demande['numeroBeneficiaire']);
|
|
$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']);
|
|
$demandeExpiree = $this->nettoyer($demande['demandeExpiree']);
|
|
$demandeEffectuee = $this->nettoyer($demande['effectuee']);
|
|
$dateSysteme = $this->nettoyer($demande['dateSysteme']);
|
|
|
|
if (est_anglophone()){
|
|
$lien = $this->nettoyer($demande['lienEng']);
|
|
}
|
|
|
|
}else{
|
|
$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');
|
|
}
|
|
|
|
if($demandeEffectuee=="1" || $demandeExpiree=="1"){
|
|
$demandeActive = "0";
|
|
}
|
|
|
|
var_dump(array(
|
|
"demandeEffectuee" => $demandeEffectuee,
|
|
"demandeExpiree" => $demandeExpiree,
|
|
"demandeActive" => $demandeActive,
|
|
));
|
|
|
|
?>
|
|
|
|
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($idDemandeconsultation == "0"): ?>
|
|
<?= _("Nouvelle demande de consultation") ?>
|
|
<?php else: ?>
|
|
<?= _("Consulter une demande") ?>
|
|
<?php endif; ?>
|
|
</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<?php if($idDemandeconsultation == "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;"><?= _("Demande No").": ".$numeroDemandeConsultation ?></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") ?>
|
|
<span class="text-danger">*</span>
|
|
</label>
|
|
<select class="form-select mobile-select" id="numeroBeneficiaire" name="numeroBeneficiaire"
|
|
<?= ($demandeActive == "0") ? 'disabled' : '' ?>
|
|
onChange="javascript:lienparente();"
|
|
<?= ($idDemandeconsultation == "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 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") ?>
|
|
<span class="text-danger">*</span>
|
|
</label>
|
|
<?php if($demandeActive == "1"): ?>
|
|
<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"
|
|
<?= ($demandeActive == "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é") ?>
|
|
<span class="text-danger">*</span>
|
|
</label>
|
|
<select class="form-select mobile-select" id="codeSpecialite" name="codeSpecialite"
|
|
<?= ($demandeActive == "0") ? 'disabled' : 'required' ?>>
|
|
<?php liste_options($specialites, $codeSpecialite); ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 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 de la consultation") ?>
|
|
</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row g-3">
|
|
<div class="col-12">
|
|
<label class="form-label fw-bold">
|
|
<?= _("Motif consultation") ?>
|
|
<span class="text-danger">*</span>
|
|
</label>
|
|
<textarea id="motifConsultation" name="motifConsultation" class="form-control" rows="6" style="height: 150px !important;"<?= ($demandeActive == "0") ? 'disabled' : 'required' ?>><?= $motifConsultation ?></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Section Réponse (si RDV existant) -->
|
|
<?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>
|
|
<?= _("Traitement de 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($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-warning py-2 text-center mb-0 etatRdv"><?= _("En attente") ?></div>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<!-- Heure consultation -->
|
|
<div class="col-12 col-md-6 col-lg-3">
|
|
<label class="form-label fw-bold"><?= _("Heure consultation") ?></label>
|
|
<input class="form-control" type="text"
|
|
value="<?= dateLang($heureConsultation, $_SESSION['lang']) ?>" readonly>
|
|
</div>
|
|
|
|
<!-- 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>
|
|
|
|
</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($idDemandeconsultation == "0"): ?>
|
|
<button class="btn btn-primary w-100 py-2 btn_autre"
|
|
onClick="javascript:enregistrer_demande_consultation();">
|
|
<i class="fas fa-save me-2"></i><?= _("Enregistrer la demande") ?>
|
|
</button>
|
|
<?php elseif($demandeActive == "1"): ?>
|
|
<button class="btn btn-warning w-100 py-2 btn_autre"
|
|
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 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; ?>
|
|
</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>
|