188 lines
11 KiB
PHP
Executable File
188 lines
11 KiB
PHP
Executable File
<?php
|
||
$idBareme = $_SESSION['idBaremePriseEnCharge'];
|
||
$libelleBareme = $this->nettoyer($bareme['libelle']);
|
||
|
||
$_SESSION['libelleBareme'] = $libelleBareme;
|
||
|
||
$isAnglais = est_anglophone();
|
||
|
||
$txt_nbdetail = ($nbdetail < 10) ? "0".$nbdetail : $nbdetail;
|
||
?>
|
||
|
||
<div class="page-content animate__animated animate__fadeIn">
|
||
<div class="header-section mb-1">
|
||
<div class="d-flex align-items-center bg-white p-3 shadow-sm border-start border-primary border-4" style="border-radius: var(--radius-md);">
|
||
<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-sliders-h"></i>
|
||
</div>
|
||
<div class="flex-grow-1">
|
||
<h4 id="titre-page" class="mb-0 fw-bold text-uppercase"><?= _("Configuration Barème Modèle") ?></h4>
|
||
<p class="text-muted small mb-0"><span class="badge bg-light text-primary border"><?= $libelleBareme ?></span></p>
|
||
</div>
|
||
<div class="text-end">
|
||
<span class="badge bg-light text-dark border">
|
||
<i class="fas fa-fingerprint me-1 text-primary"></i>ID: #<?= $idBareme ?>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<input type="hidden" id="nomForm" name="nomForm" value="frmDetailBareme">
|
||
<input type="hidden" id="idBaremePriseEnCharge" name="idBaremePriseEnCharge" value="<?= $idBareme ?>">
|
||
<input type="hidden" id="ligne2" name="ligne2" value="<?= count($garantiesajoutees); ?>">
|
||
<input type="hidden" id="masquerBareme" name="masquerBareme" value="1">
|
||
<input type="hidden" id="maxDateEffetBareme" name="maxDateEffetBareme" value="<?= $maxDateEffetBareme ?>">
|
||
|
||
<div class="row g-3">
|
||
<div class="col-xl-4 col-lg-5">
|
||
<div class="card border-0 shadow-sm h-100">
|
||
<div class="card-header bg-white border-bottom-0 pt-3">
|
||
<ul class="nav nav-tabs card-header-tabs" id="tabBareme" role="tablist">
|
||
<li class="nav-item">
|
||
<button class="nav-link active small fw-bold text-uppercase" id="update-tab" data-bs-toggle="tab" data-bs-target="#update-zone" type="button">
|
||
<i class="fas fa-edit me-1"></i> <?= _("Mise à jour") ?>
|
||
</button>
|
||
</li>
|
||
<li class="nav-item">
|
||
<button class="nav-link small fw-bold text-uppercase" id="history-tab" data-bs-toggle="tab" data-bs-target="#history-zone" type="button" onclick="afficherDetailBareme();">
|
||
<i class="fas fa-history me-1"></i> <?= _("Historique TM") ?><span id="detailbareme" class="badge rounded-pill bg-primary-ghost text-primary ms-2 fs-6"><?= $txt_nbdetail; ?></span>
|
||
</button>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="card-body tab-content p-3">
|
||
<div class="tab-pane fade show active" id="update-zone" role="tabpanel">
|
||
<div class="mb-3">
|
||
<label class="lbl-saas"><?= _("Date de mise en vigueur") ?></label>
|
||
<div class="input-group input-group-sm">
|
||
<span class="input-group-text"><i class="fas fa-calendar-alt"></i></span>
|
||
<input type="text" id="dateEffetBareme" class="form-control datepicker fw-bold">
|
||
</div>
|
||
</div>
|
||
<div class="mb-4">
|
||
<label class="lbl-saas"><?= _("Ticket Modérateur Global (%)") ?></label>
|
||
<div class="input-group input-group-sm">
|
||
<input type="number" id="ticketModerateurBareme" class="form-control fw-bold text-primary" value="<?= $tmBareme ?>">
|
||
<span class="input-group-text bg-warning text-white">%</span>
|
||
</div>
|
||
</div>
|
||
<button type="button" class="btn btn-warning btn-sm w-100 py-2 shadow-sm fw-bold" onclick="inserer_bareme();">
|
||
<i class="fas fa-save me-1"></i> <?= _("Appliquer à tous les actes") ?>
|
||
</button>
|
||
</div>
|
||
|
||
<div class="tab-pane fade" id="history-zone" role="tabpanel">
|
||
<div id="div_bareme" class="history-scroll-zone">
|
||
<div class="text-center py-4 text-muted small">
|
||
<i class="fas fa-history fa-2x mb-2 opacity-25"></i><br>
|
||
<?= _("Cliquez sur l'onglet pour charger l'historique") ?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-xl-8 col-lg-7">
|
||
|
||
<div id="div_patienter"></div>
|
||
|
||
<div class="card border-0 shadow-sm">
|
||
<div class="card-header border-bottom bg-light py-2 d-flex justify-content-between align-items-center">
|
||
<h6 class="mb-0 fw-bold text-uppercase small text-primary">
|
||
<i class="fas fa-list-ul me-2"></i><?= _("Détails par Garantie / Famille d'acte") ?>
|
||
</h6>
|
||
<span class="badge rounded-pill bg-primary-ghost bg-opacity-10 text-primary fs-6">
|
||
<?= count($garantiesajoutees) ?>
|
||
</span>
|
||
</div>
|
||
|
||
<small class="text-muted mt-1 d-block mb-2"><i class="fas fa-info-circle me-1"></i><?= _("Pour paramétrer une garantie, double‑cliquez sur la ligne correspondante ou utilisez le bouton de la colonne Action") ?></small>
|
||
<div class="card-body p-0">
|
||
<div class="table-responsive" style="max-height: 500px;">
|
||
<table class="table table-hover table-sm align-middle mb-0">
|
||
<thead class="table-light sticky-top">
|
||
<tr class="small text-uppercase">
|
||
<th class="ps-3 py-2"><?= _("Code") ?></th>
|
||
<th class="py-2"><?= _("Désignation") ?></th>
|
||
<th class="text-center py-3" width="10%"><?= _("Activées") ?></th>
|
||
<th class="text-center py-3" width="10%"><?= _("Inactivées") ?></th>
|
||
<th class="text-end pe-3 py-2"><?= _("Action") ?></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<?php foreach ($garantiesajoutees as $v):
|
||
$codeG = $this->nettoyer($v['codeGarantie']);
|
||
$nomG = $isAnglais ? $this->nettoyer($v['libelleEng']) : $this->nettoyer($v['libelle']);
|
||
|
||
// Réintégration des compteurs formatés (ex: 01, 02...)
|
||
$actives = (int)$v['nbre_lignes_actives'];
|
||
$inactives = (int)$v['nbre_lignes_inactives'];
|
||
$txt_actives = ($actives < 10) ? "0".$actives : $actives;
|
||
$txt_inactives = ($inactives < 10) ? "0".$inactives : $inactives;
|
||
?>
|
||
<tr class="row-hover" ondblclick="afficher_actes_garantiebareme(<?= $idBareme ?>,'<?= $codeG ?>');">
|
||
<td class="ps-3 fw-mono small"><?= $codeG ?></td>
|
||
<td>
|
||
<div class="fw-bold small"><?= $nomG ?></div>
|
||
</td>
|
||
|
||
<td class="text-center">
|
||
<span class="badge rounded-pill <?= $actives > 0 ? 'bg-success-ghost' : 'bg-light text-muted' ?> px-3 py-1 fs-6">
|
||
<?= $txt_actives ?>
|
||
</span>
|
||
</td>
|
||
<td class="text-center">
|
||
<span class="badge rounded-pill <?= $inactives > 0 ? 'bg-danger-ghost text-danger' : 'bg-light text-muted' ?> px-3 py-1 fs-6">
|
||
<?= $txt_inactives ?>
|
||
</span>
|
||
</td>
|
||
|
||
<td class="text-end pe-3">
|
||
<button class="btn btn-xs btn-outline-primary" onclick="afficher_actes_garantiebareme(<?= $idBareme ?>,'<?= $codeG ?>');">
|
||
<i class="fas fa-cog"></i>
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
<?php endforeach; ?>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="modal fade" id="div_actesgarantiebareme" role="dialog" data-bs-backdrop="static" data-bs-keyboard="false"></div>
|
||
|
||
<style>
|
||
/* Assure que la zone AJAX est bien visible une fois l'onglet actif */
|
||
#history-zone.active #div_bareme {display: block !important;min-height: 200px;}
|
||
.history-scroll-zone {max-height: 400px;overflow-y: auto;border-radius: 8px;background: #fdfdfd;}
|
||
|
||
/* Style des lignes d'historique injectées */
|
||
#div_bareme table {font-size: 0.85rem;width: 100%;}
|
||
|
||
.lbl-saas { font-weight: 700; color: #6c757d; margin-bottom: 4px; display: block; }
|
||
.nav-tabs .nav-link { border: none; color: #6c757d; padding: 10px 15px; }
|
||
.nav-tabs .nav-link.active { color: #0d6efd; border-bottom: 2px solid #0d6efd; background: none; }
|
||
.history-scroll-zone { max-height: 350px; overflow-y: auto; font-size: 12px; }
|
||
.btn-xs { padding: 2px 6px; font-size: 10px; border-radius: 4px; }
|
||
.fw-mono { font-family: monospace; }
|
||
</style>
|
||
|
||
<script>
|
||
document.addEventListener("DOMContentLoaded", function() {
|
||
const historyTab = document.getElementById("history-tab");
|
||
|
||
historyTab.addEventListener("click", function() {
|
||
afficherDetailBareme();
|
||
});
|
||
|
||
if (historyTab.classList.contains("active")) {
|
||
afficherDetailBareme();
|
||
}
|
||
});
|
||
</script>
|