radiantassure/Vue/Ajaxdemanderdv/index.php
2025-12-07 09:35:13 +00:00

173 lines
6.7 KiB
PHP
Executable File

<div class="card shadow-sm">
<div class="card-header bg-light py-2 d-flex justify-content-between align-items-center">
<h5 class="mb-0 text-dark">
<i class="fas fa-list me-2"></i>
<span class="hide-on-mobile"><?= _("Liste des rendez-vous")?></span>
<span class="badge bg-primary view-end"><?= format_N(count($demandes)).' '._("rendez-vous") ?> </span>
</h5>
</div>
<div class="d-none d-md-block">
<div class="card-body p-0">
<table class="table table-striped table-hover mb-0" style="font-size:9pt; white-space: nowrap;">
<thead class="table-dark">
<tr>
<th class="text-center"><?= _("N° RDV") ?></th>
<th class="text-center">Date</th>
<th class="text-center"><?= _("Bénéficiaire") ?></th>
<th class="d-none d-lg-table-cell"><?= _("Nom") ?></th>
<th class="d-none d-xl-table-cell"><?= _("Prestataire") ?></th>
<th class="d-none d-xl-table-cell"><?= _("Spécialité") ?></th>
<th class="text-center"><?= _("Etat") ?></th>
<th class="text-center"><?= _("Motif") ?></th>
</tr>
</thead>
<tbody>
<?php if (count($demandes) > 0): ?>
<?php foreach ($demandes as $v):
$idDemande = $this->nettoyer($v['id']);
$numeroDemandeRdv = $this->nettoyer($v['numeroDemandeRdv']);
$dateSysteme = $this->nettoyer($v['dateSysteme']);
$codeEtatRdv = $this->nettoyer($v['codeEtatRdv']);
$prestataire = $this->nettoyer($v['prestataire']);
$specialite = $this->nettoyer($v['specialite']);
$etatRdv = $this->nettoyer($v['etatRdv']);
if (est_anglophone()){
$specialite = $this->nettoyer($v['specialiteEng']);
$etatRdv = $this->nettoyer($v['etatRdvEng']);
}
?>
<tr>
<td class="text-center">
<button class="btn btn-sm btn-outline-primary w-100"
onClick="javascript:selectionner_rdv('<?= $idDemande ?>');"
title="<?=_("Voir les détails du rendez-vous")?>">
<?= $numeroDemandeRdv ?>
</button>
</td>
<td class="text-center"><?= dateheureLang($dateSysteme, $_SESSION['lang']) ?></td>
<td class="text-center"><?= $this->nettoyer($v['numeroBeneficiaire']) ?></td>
<td class="d-none d-lg-table-cell"><?= $this->nettoyer($v['beneficiaire']) ?></td>
<td class="d-none d-xl-table-cell text-truncate" style="max-width: 150px;"
data-bs-toggle="tooltip" title="<?= $prestataire ?>">
<?= $prestataire ?>
</td>
<td class="d-none d-xl-table-cell text-truncate" style="max-width: 120px;"
data-bs-toggle="tooltip" title="<?= $specialite ?>">
<?= $specialite ?>
</td>
<td class="text-center">
<?php if($codeEtatRdv == "1"):?>
<span class="badge bg-success"><?= $etatRdv; ?></span>
<?php elseif($codeEtatRdv == "0"): ?>
<span class="badge bg-warning text-dark"><?= $etatRdv; ?></span>
<?php else: ?>
<span class="badge bg-danger"><?= $etatRdv; ?></span>
<?php endif; ?>
</td>
<td class="text-truncate" style="max-width: 200px;"
data-bs-toggle="tooltip" title="<?= $this->nettoyer($v['motifReponseRdv']) ?>">
<?= $this->nettoyer($v['motifReponseRdv']) ?>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="8" class="text-center p-4 text-muted">
<div class="alert alert-info mt-3" style="margin-bottom:15px;">
<small>
<i class="fas fa-info-circle me-2"></i>
<?= _("Aucun rendez-vous trouvé pour les critères sélectionnés") ?>
</small>
</div>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<!-- Affichage mobile (cartes) -->
<div class="d-md-none">
<?php foreach ($demandes as $v):
$idDemande = $this->nettoyer($v['id']);
$numeroDemandeRdv = $this->nettoyer($v['numeroDemandeRdv']);
$dateSysteme = $this->nettoyer($v['dateSysteme']);
$codeEtatRdv = $this->nettoyer($v['codeEtatRdv']);
$prestataire = $this->nettoyer($v['prestataire']);
$specialite = $this->nettoyer($v['specialite']);
$etatRdv = $this->nettoyer($v['etatRdv']);
if (est_anglophone()){
$specialite = $this->nettoyer($v['specialiteEng']);
$etatRdv = $this->nettoyer($v['etatRdvEng']);
}
?>
<div class="card-body py-2">
<div class="row mb-2">
<div class="col-12 mb-2">
<div class="d-flex justify-content-between align-items-center">
<span class="text-muted small me-3"><?= _("N° RDV") ?></span>
<button class="btn btn-sm btn-info w-100"
onClick="javascript:selectionner_rdv('<?= $idDemande ?>');" style="font-size:1.8rem !important">
<?= $numeroDemandeRdv ?>
</button>
</div>
</div>
<div class="col-6">
<div class="d-flex justify-content-between align-items-center">
<span class="fw-bold me-2"><?= dateheureLang($dateSysteme, $_SESSION['lang']) ?></span>
</div>
</div>
<div class="col-12">
<div class="d-flex justify-content-between align-items-center">
<span class="fw-bold"><?= $this->nettoyer($v['beneficiaire'])." (".$this->nettoyer($v['numeroBeneficiaire']).")" ?></span>
</div>
</div>
<div class="col-12 mb-2">
<div class="d-flex justify-content-between align-items-center">
<span class="text-muted small me-3"><?= _("Prestataire") ?></span>
<span class="fw-bold text-truncate" style="max-width: 150px;">
<?= $prestataire ?>
</span>
</div>
</div>
<div class="col-12 mb-2">
<div class="d-flex justify-content-between align-items-center">
<span class="text-muted small me-3"><?= _("Spécialité") ?></span>
<span class="fw-bold text-truncate" style="max-width: 120px;">
<?= $specialite ?>
</span>
</div>
</div>
<div class="col-12 mb-2">
<div class="d-flex justify-content-between align-items-center">
<?php if($codeEtatRdv == "1"):?>
<span class="badge bg-success w-100"><?= $etatRdv; ?></span>
<?php elseif($codeEtatRdv == "0"): ?>
<span class="badge bg-warning text-dark w-100"><?= $etatRdv; ?></span>
<?php else: ?>
<span class="badge bg-danger w-100"><?= $etatRdv; ?></span>
<?php endif; ?>
</div>
</div>
<div class="col-12">
<textarea readonly class="message-text w-100"><?= $this->nettoyer($v['motifReponseRdv']) ?></textarea>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>