215 lines
13 KiB
PHP
Executable File
215 lines
13 KiB
PHP
Executable File
<?php
|
|
$codeReseau = $this->nettoyer($reseau['codeReseau']);
|
|
$idReseau = $this->nettoyer($reseau['id']);
|
|
$nomReseau = $this->nettoyer($reseau['libelle']);
|
|
|
|
// Extraction unique des types pour les selects (Optionnel)
|
|
$typesDispo = est_anglophone()
|
|
? array_unique(array_column($prestatairesdispo, 'typeprestataireEng'))
|
|
: array_unique(array_column($prestatairesdispo, 'typeprestataire'));
|
|
sort($typesDispo);
|
|
|
|
$typesAffect = est_anglophone()
|
|
? array_unique(array_column($prestatairesreseau, 'typeprestataireEng'))
|
|
: array_unique(array_column($prestatairesreseau, 'typeprestataire'));
|
|
sort($typesAffect);
|
|
?>
|
|
|
|
<div class="page-content animate__animated animate__fadeIn">
|
|
<div class="header-section mb-1">
|
|
<div class="d-flex align-items-center justify-content-between bg-white p-3 shadow-sm border-start border-primary border-4" style="border-radius: var(--radius-md);">
|
|
<div class="d-flex align-items-center">
|
|
<div class="icon-shape bg-primary-ghost text-primary rounded-circle me-3" style="width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;">
|
|
<i class="fas fa-hospital-symbol fs-4"></i>
|
|
</div>
|
|
<div>
|
|
<h4 id="titre-page" class="mb-0 fw-bold text-uppercase"><?= _("Affectation Prestataires Réseau Soins") ?></h4>
|
|
<p class="text-muted small mb-0"><?= _("Réseau :") ?> <span class="fw-bold text-muted"><?= $nomReseau ?></span> (<?= $codeReseau ?>)</p>
|
|
</div>
|
|
</div>
|
|
<div class="d-flex gap-2">
|
|
<!--
|
|
<button class="btn btn-light rounded-pill px-3 fw-bold shadow-xs border btn-sm" onclick="retour_liste_reseaus();">
|
|
<i class="fas fa-arrow-left me-1"></i> <?= _("Retour") ?>
|
|
</button>
|
|
-->
|
|
<button class="btn btn-primary rounded-pill px-4 fw-bold shadow-sm btn-sm" onclick="afficher_prestataires_reseau();">
|
|
<i class="fas fa-sync-alt me-1"></i> <?= _("Actualiser") ?>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<input type="hidden" id="codeReseau" name="codeReseau" value="<?= $codeReseau ?>">
|
|
<input type="hidden" id="idReseau" name="idReseau" value="<?= $idReseau ?>">
|
|
|
|
<div id="div_prestataires_reseau" class="row g-3">
|
|
|
|
<div class="col-lg-5">
|
|
<div class="card border-0 shadow-sm h-100">
|
|
<div class="card-header bg-white py-3 border-bottom">
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<h6 class="mb-0 fw-bold text-primary text-uppercase">
|
|
<i class="fas fa-list-ul me-2"></i><?= _("Disponibles") ?>
|
|
</h6>
|
|
<span class="badge bg-light text-primary border rounded-pill" id="count_dispo">
|
|
<?= count($prestatairesdispo) ?>
|
|
</span>
|
|
</div>
|
|
|
|
<div class="bg-primary-ghost-light p-2 rounded mb-2 border border-primary-subtle">
|
|
<div class="row g-1">
|
|
<div class="col-12 mb-1">
|
|
<input type="text" id="search_nom_dispo" class="form-control form-control-sm border-2 shadow-none" placeholder="<?= _("Nom du prestataire...") ?>" onkeyup="rechercheServeur('dispo')">
|
|
</div>
|
|
<div class="col-6">
|
|
<input type="text" id="search_ville_dispo" class="form-control form-control-sm border-2 shadow-none" placeholder="<?= _("Ville...") ?>" onkeyup="rechercheServeur('dispo')">
|
|
</div>
|
|
<div class="col-6">
|
|
<select id="search_type_dispo"
|
|
class="form-control selectpicker border-2 shadow-none"
|
|
data-live-search="true"
|
|
data-style="btn-white btn-sm"
|
|
onchange="rechercheServeur('dispo')">
|
|
<option value=""><?= _("Tous les types") ?></option>
|
|
<?php foreach($typesDispo as $t): ?>
|
|
<option value="<?= $t ?>"><?= $t ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<button class="btn btn-primary-ghost btn-sm w-100 rounded-pill fw-bold" onclick="ajouter_tous_prestataires_reseau();">
|
|
<?= _("Tout ajouter") ?> <i class="fas fa-angle-double-right ms-1"></i>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="card-body p-0">
|
|
<div class="table-responsive" style="max-height: 500px; overflow-y: auto;">
|
|
<table class="table table-hover align-middle mb-0" id="tab_dispo" style="font-size: 8.5pt;">
|
|
<thead class="bg-light sticky-top">
|
|
<tr>
|
|
<th class="ps-3 py-2"><?= _("Nom & Détails") ?></th>
|
|
<th class="text-center py-2" width="50px"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($prestatairesdispo as $v): $codePres = $v['codePrestataire']; ?>
|
|
<tr>
|
|
<td class="ps-3">
|
|
<div class="fw-bold text-dark search-target"><?= $this->nettoyer($v['libelle']) ?></div>
|
|
<div class="text-muted smaller">
|
|
<span class="search-target"><?= $this->nettoyer($v['localite']) ?></span> |
|
|
<span class="text-primary search-target"><?= $this->nettoyer($v['typeprestataire']) ?></span>
|
|
</div>
|
|
</td>
|
|
<td class="text-center pe-3">
|
|
<button class="btn btn-sm btn-primary-ghost rounded-circle action-icon" onclick="ajouter_un_prestataire_reseau('<?=$codePres?>');">
|
|
<i class="fas fa-chevron-right"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-7">
|
|
<div class="card border-0 shadow-sm h-100 border-start border-success border-4">
|
|
<div class="card-header bg-white py-3 border-bottom">
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<h6 class="mb-0 fw-bold text-success text-uppercase">
|
|
<i class="fas fa-check-double me-2"></i><?= _("Affectés au réseau") ?>
|
|
</h6>
|
|
<span class="badge bg-success-light text-success rounded-pill px-3" id="count_affect">
|
|
<?= count($prestatairesreseau) ?>
|
|
</span>
|
|
</div>
|
|
|
|
<div class="bg-success-ghost p-2 rounded mb-2 border border-success-subtle">
|
|
<div class="row g-1">
|
|
<div class="col-12 mb-1">
|
|
<input type="text" id="search_nom_affect" class="form-control form-control-sm border-2 shadow-none" placeholder="<?= _("Rechercher dans la liste...") ?>" onkeyup="rechercheServeur('affect');">
|
|
</div>
|
|
<div class="col-6">
|
|
<input type="text" id="search_ville_affect" class="form-control form-control-sm border-2 shadow-none" placeholder="<?= _("Filtrer par ville...") ?>" onkeyup="rechercheServeur('affect');">
|
|
</div>
|
|
<div class="col-6">
|
|
<select id="search_type_affect"
|
|
class="form-control selectpicker border-2 shadow-none"
|
|
data-live-search="true"
|
|
data-style="btn-white btn-sm"
|
|
onchange="rechercheServeur('affect');">
|
|
<option value=""><?= _("Tous les types") ?></option>
|
|
<?php foreach($typesAffect as $t): ?>
|
|
<option value="<?= $t ?>"><?= $t ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<button class="btn btn-danger-light btn-sm w-100 rounded-pill fw-bold" onclick="retirer_tous_prestataires_du_site();">
|
|
<i class="fas fa-angle-double-left me-1"></i> <?= _("Retirer tous les prestataires") ?>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="card-body p-0">
|
|
<div class="table-responsive" style="max-height: 500px; overflow-y: auto;">
|
|
<table class="table table-hover align-middle mb-0" id="tab_affect" style="font-size: 8.5pt;">
|
|
<thead class="bg-success-light text-success sticky-top">
|
|
<tr>
|
|
<th class="ps-3 py-2" width="50px"></th>
|
|
<th class="py-2"><?= _("Nom du Prestataire") ?></th>
|
|
<th class="py-2 pe-3"><?= _("Ville & Type") ?></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($prestatairesreseau as $v): $codePres = $v['codePrestataire']; ?>
|
|
<tr>
|
|
<td class="ps-3 text-center">
|
|
<button class="btn btn-sm btn-danger-light rounded-circle action-icon" onclick="retirer_un_prestataire_reseau('<?=$codePres?>');">
|
|
<i class="fas fa-chevron-left"></i>
|
|
</button>
|
|
</td>
|
|
<td class="fw-bold text-dark text-uppercase search-target"><?= $this->nettoyer($v['libelle']) ?></td>
|
|
<td class="pe-3 search-target">
|
|
<span class="text-muted"><i class="fas fa-map-marker-alt me-1"></i><?= $this->nettoyer($v['localite']) ?></span>
|
|
<span class="badge bg-light text-muted fw-normal ms-2 search-target"><?= $this->nettoyer($v['typeprestataire']) ?></span>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<style>
|
|
.bg-primary-ghost { background-color: rgba(33, 46, 83, 0.08) !important; }
|
|
.bg-primary-ghost-light { background-color: rgba(33, 46, 83, 0.03) !important; }
|
|
.btn-primary-ghost { color: var(--bs-primary); background-color: rgba(33, 46, 83, 0.1); border: none; }
|
|
.btn-primary-ghost:hover { background-color: rgba(33, 46, 83, 0.2); }
|
|
|
|
.bg-success-light { background-color: rgba(25, 135, 84, 0.08) !important; }
|
|
.bg-success-ghost { background-color: rgba(25, 135, 84, 0.03) !important; }
|
|
.btn-danger-light { color: var(--bs-danger); background-color: rgba(220, 53, 69, 0.1); border: none; }
|
|
.btn-danger-light:hover { background-color: rgba(220, 53, 69, 0.2); }
|
|
|
|
.action-icon { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; }
|
|
.action-icon:hover { transform: scale(1.15); }
|
|
|
|
.smaller { font-size: 0.85em; }
|
|
|
|
/* Scrollbar */
|
|
.table-responsive::-webkit-scrollbar { width: 6px; }
|
|
.table-responsive::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 10px; }
|
|
</style>
|