Collegepolice

This commit is contained in:
KONE SOREL 2025-12-29 21:55:54 +00:00
parent 066a2bd265
commit a194cccabf
7 changed files with 248 additions and 2 deletions

View File

@ -1212,4 +1212,56 @@ li i { margin-right:10px; color:#007bff; }
@media print {
.btn, .modal, .sr-only { display: none !important; }
.card { border: 1px solid #ddd !important; box-shadow: none !important; }
}
/* Style Table Collèges - Vision Office 365 */
.custom-college-table thead th {
background-color: var(--office-common) !important;
color: var(--office-dark) !important;
font-size: 0.65rem;
font-weight: 800;
text-transform: uppercase;
border-bottom: 2px solid var(--office-primary);
vertical-align: middle;
padding: 10px 5px;
}
.custom-college-table tbody td {
font-size: 0.75rem; /* Compact pour tenir toutes les colonnes */
white-space: nowrap;
padding: 8px 5px;
}
/* Séparateurs verticaux pour groupes de données (Nb, HT, TTC) */
.border-start {
border-left: 1px solid var(--office-border) !important;
}
/* Style des boutons de montant (Action principale) */
.custom-college-table .btn-primary {
background-color: var(--office-secondary);
border: none;
font-size: 0.75rem;
}
.custom-college-table .btn-primary:hover {
background-color: var(--office-primary);
transform: scale(1.05);
}
/* Footer de table sombre type Excel Premium */
.custom-college-table tfoot {
border-top: 3px solid var(--office-primary);
background-color: var(--office-dark) !important;
}
.custom-college-table tfoot td {
padding: 12px 5px;
}
/* Badge de catégorie épuré */
.badge.rounded-pill {
font-weight: 600;
padding: 5px 10px;
}

View File

@ -0,0 +1,25 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Collegepolice.php';
require_once 'Modele/Police.php';
require_once 'Modele/Menuvueutilisateur.php';
class ControleurCollegepolice extends Controleur {
private $college;
private $police;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue("Collegepolice");
$this->college = new Collegepolice();
$this->police = new Police();
}
public function index() {
$idPolice = $_SESSION['idPolice_C'];
$police = $this->police->getPoliceIdSimple($idPolice);
$colleges = $this->college->getCollegesPolice($idPolice);
$totalcollege = $this->college->getTotaldcollege($idPolice);
$this->genererVue(array('police' => $police, 'colleges' => $colleges, 'totalcollege' => $totalcollege));
}
}

View File

@ -658,3 +658,11 @@ function imprimer_quittance_client(idQuittance) {
* =================================================== */
modal.show();
}
function college_police()
{
if ($("#idPolice_C" ).val()>"")
{
window.location.assign($("#racineWeb" ).val()+"Collegepolice/");
}
}

31
Modele/Collegepolice.php Normal file
View File

@ -0,0 +1,31 @@
<?php
require_once 'Framework/Modele.php';
class Collegepolice extends Modele {
public function getCollegepoliceId($idCollege) {
$sql = 'SELECT A.id AS idCollege, A.*, B.libelle as produit
from college A
join produit B on (B.codeSociete=A.codeSociete) AND (B.codeProduit=A.codeProduit)
where A.id=?';
$college = $this->executerRequete($sql, array($idCollege));
return $college->fetch(PDO::FETCH_ASSOC);
}
public function getCollegesPolice($idPolice)
{
$sql = 'call sp_get_colleges_police(?);';
$college = $this->executerRequete($sql, array($idPolice));
return $college->fetchAll(PDO::FETCH_ASSOC);
}
public function getTotaldcollege($idPolice) {
$sql = 'call sp_totalcollege(?)';
$totalcollege = $this->executerRequete($sql, array($idPolice));
return $totalcollege->fetch(PDO::FETCH_ASSOC);
}
}

View File

@ -116,4 +116,17 @@ class Police extends Modele {
return $textecp->fetch(PDO::FETCH_ASSOC);
}
public function getPoliceIdSimple($id)
{
$idPolice = $_SESSION['idPolice_C'] ;
$sql2 = 'select count(0) as nbCollege from college where (idPolice=?);';
$resultat2 = $this->executerRequete($sql2, array($idPolice));
$effectif2 = $resultat2->fetch(PDO::FETCH_ASSOC);
$_SESSION['nbCollege_C'] = $effectif2['nbCollege'];
$sql = 'SELECT A.*, 1 as prestationPossible FROM police A WHERE (A.codeSociete=?) AND (A.id=?)';
$police = $this->executerRequete($sql, array($_SESSION['codeSociete'], $id));
return $police->fetch(PDO::FETCH_ASSOC);
}
}

117
Vue/Collegepolice/index.php Normal file
View File

@ -0,0 +1,117 @@
<?php
$this->titre = "INTER-SANTE - Collèges de la police";
$superUser = $_SESSION['superUser'];
?>
<div id="div_colleges_police" class="container-fluid py-4 animate__animated animate__fadeIn">
<form method="POST">
<input class="sr-only" type="text" id="idCollege" name="idCollege">
<div class="card shadow-sm border-0">
<div class="card-header bg-office-blue text-white py-3 d-flex justify-content-between align-items-center">
<h5 class="mb-0 fw-bold">
<i class="fas fa-users-cog me-2"></i>
<?= _("Liste des Collèges") ?>
<span class="badge bg-white text-primary ms-2">Police No: <?= $this->nettoyer($police['numeroPolice']) ?></span>
</h5>
<button type="button" class="btn btn-sm btn-light fw-bold" onclick="javascript:ajouter_college();">
<i class="fas fa-plus-circle text-success me-1"></i><?= _("Nouveau Collège") ?>
</button>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0 custom-college-table">
<thead>
<tr>
<th class="text-center"><?= _("Cat") ?></th>
<th><?= _("Désignation du Collège") ?></th>
<th class="text-center border-start"><?= _("Fam") ?></th>
<th class="text-center"><?= _("Dép") ?></th>
<th class="text-center border-start"><?= _("P. Base") ?></th>
<th class="text-end"><?= _("P. Nette Com") ?></th>
<th class="text-end text-muted small"><?= _("Com. C.") ?></th>
<th class="text-end text-muted small"><?= _("Com. A.") ?></th>
<th class="text-end"><?= _("Access.") ?></th>
<th class="text-end fw-bold"><?= _("P. Nette") ?></th>
<th class="text-end"><?= (isset($_SESSION['composanteprime']['Taxes'])) ? _($_SESSION['composanteprime']['Taxes']) : _("Taxes") ?></th>
<th class="text-end"><?= (isset($_SESSION['composanteprime']['Cartes'])) ? _($_SESSION['composanteprime']['Cartes']) : _("Cartes") ?></th>
<th class="text-end border-start text-primary fw-bold"><?= _("TTC Total") ?></th>
<th class="text-center" width="140px"><?= _("Actions") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($colleges as $college):
$idCollege = $college['id'];
$isArchived = ($college['garantieArchive'] == '1');
?>
<tr class="<?= $isArchived ? 'table-light opacity-75' : '' ?>">
<td class="text-center"><span class="badge bg-secondary rounded-pill"><?= $this->nettoyer($college['codeProduit']) ?></span></td>
<td class="fw-bold text-dark"><?= $this->nettoyer($college['libelleCollege']) ?></td>
<td class="text-center border-start"><?= format_N($this->nettoyer($college['nbAdherent'])) ?></td>
<td class="text-center"><?= format_N($this->nettoyer($college['nbAyantdroit'])) ?></td>
<td class="text-end border-start small"><?= format_N($this->nettoyer($college['primeFamille'])) ?></td>
<td class="text-end"><?= format_N($this->nettoyer($college['primeNette'])) ?></td>
<td class="text-end text-muted"><?= format_N($this->nettoyer($college['commission'])) ?></td>
<td class="text-end text-muted"><?= format_N($this->nettoyer($college['commissionAutre'])) ?></td>
<td class="text-end"><?= format_N($this->nettoyer($college['accessoire'])) ?></td>
<td class="text-end fw-bold"><?= format_N($this->nettoyer($college['primeHt'])) ?></td>
<td class="text-end"><?= format_N($this->nettoyer($college['taxe'])) ?></td>
<td class="text-end"><?= format_N($this->nettoyer($college['fraisCarte'])) ?></td>
<td class="text-end border-start">
<button type="button" class="btn btn-sm btn-primary fw-bold w-100 shadow-sm"
onClick="javascript:selectionner_college(<?= $idCollege ?>); <?= $isArchived ? 'consulter' : 'modifier' ?>_college(<?= $idCollege ?>)">
<?= format_N($this->nettoyer($college['primeTtcTotal'])) ?>
</button>
</td>
<td class="text-center">
<div class="btn-group btn-group-sm">
<?php if($isArchived): ?>
<?php if ($superUser=="1"): ?>
<button type="button" class="btn btn-outline-warning" title="<?= _("Désarchiver") ?>" onClick="javascript:de_archiver_garantie_college('<?= $idCollege ?>');">
<i class="fas fa-box-open"></i>
</button>
<?php endif; ?>
<span class="badge bg-light text-muted p-2 border"><i class="fas fa-archive me-1"></i>Arc.</span>
<?php else: ?>
<button type="button" class="btn btn-outline-info" title="<?= _("Archiver") ?>" onClick="javascript:archiver_garantie_college('<?= $idCollege ?>');">
<i class="fas fa-archive"></i>
</button>
<button type="button" class="btn btn-outline-danger" title="<?= _("Supprimer") ?>" onClick="javascript:supprimer_college('<?= $idCollege ?>');">
<i class="fas fa-trash-alt"></i>
</button>
<?php endif; ?>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot class="table-dark">
<tr class="fw-bold">
<td colspan="2" class="text-end text-uppercase small"><?= _("Totaux") ?></td>
<td class="text-center border-start"><?= format_N($this->nettoyer($totalcollege['nbAdherent'])) ?></td>
<td class="text-center"><?= format_N($this->nettoyer($totalcollege['nbAyantdroit'])) ?></td>
<td class="text-end border-start small"><?= format_N($this->nettoyer($totalcollege['primeFamille_total'])) ?></td>
<td class="text-end"><?= format_N($this->nettoyer($totalcollege['primeNette_total'])) ?></td>
<td class="text-end small"><?= format_N($this->nettoyer($totalcollege['commission_total'])) ?></td>
<td class="text-end small"><?= format_N($this->nettoyer($totalcollege['commissionAutre_total'])) ?></td>
<td class="text-end"><?= format_N($this->nettoyer($totalcollege['accessoire_total'])) ?></td>
<td class="text-end"><?= format_N($this->nettoyer($totalcollege['primeHt_total'])) ?></td>
<td class="text-end"><?= format_N($this->nettoyer($totalcollege['taxe_total'])) ?></td>
<td class="text-end"><?= format_N($this->nettoyer($totalcollege['fraisCarte_total'])) ?></td>
<td class="text-end border-start text-warning"><?= format_N($this->nettoyer($totalcollege['primeTtc_total'])) ?></td>
<td></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</form>
</div>

View File

@ -119,7 +119,7 @@ $activeChildId = $menuData['child'];
<link rel="manifest" href="<?= $racineWeb ?>manifest.json">
<!-- 4. VOS STYLES PERSONNALISÉS (en dernier pour qu'ils dominent) -->
<link href="<?= $racineWeb ?>Bootstrap_new/css/style_office.css?ver=2025.12.29.10" rel="stylesheet">
<link href="<?= $racineWeb ?>Bootstrap_new/css/style_office.css?ver=2025.12.29.11" rel="stylesheet">
<link href="<?= $racineWeb ?>Bootstrap_new/css/ux_enhancements.css?ver=2025.12.21.02" rel="stylesheet">
<!-- ============================================
@ -600,7 +600,7 @@ $activeChildId = $menuData['child'];
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Application Scripts -->
<script src="/Js/fonctions.js?ver=2025.12.29.01"></script>
<script src="/Js/fonctions.js?ver=2025.12.29.02"></script>
<?php if (est_anglophone()): ?>
<script src="/Js/datepicker-eng.js"></script>