This commit is contained in:
KONE SOREL 2025-12-30 13:20:54 +00:00
parent 6c7d648690
commit 3c45cf83c6
9 changed files with 489 additions and 5 deletions

View File

@ -0,0 +1,21 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Adherent.php';
class ControleurAjaxlisteadherent extends Controleur {
private $adherent;
public function __construct()
{
$this->adherent = new Adherent();
}
public function index()
{
$idPolice = $_SESSION['idPolice_C'];
$adherents = $this->adherent->getlisteassuresexo($idPolice);
$this->genererVueAjax(array('adherents' => $adherents));
}
}

View File

@ -0,0 +1,41 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Menuvueutilisateur.php';
require_once 'Modele/Etatcp.php';
require_once 'Modele/Police.php';
class ControleurContrat extends Controleur
{
private $etat;
private $police;
public function __construct()
{
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue("Contrat");
$this->etat = new Etatcp();
$this->police = new Police();
}
public function index()
{
$idPolice = $_SESSION['idPolice_C'] ;
$prestationPossible = $this->police->prestationPossible($idPolice);
$estAgence = $this->police->estAgence($idPolice);
/*
if($prestationPossible!="1")
{
$this->rediriger("Fichepolice");
exit();
}
*/
$etats = $this->etat->getEtatcp() ;
$this->genererVue(array('etats' => $etats, 'prestationPossible' => $prestationPossible, 'estAgence' => $estAgence));
}
}

View File

@ -0,0 +1,29 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Adherent.php';
require_once 'Modele/Police.php';
require_once 'Modele/Menuvueutilisateur.php';
class ControleurListeadherent extends Controleur {
private $adherent;
private $police;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue("Listeadherent");
$this->adherent = new Adherent();
$this->police = new Police();
}
public function index() {
$idPolice = $_SESSION['idPolice_C'];
$codeSociete = $this->requete->getSession()->getAttribut('codeSociete');
$this->adherent->getNbassure($idPolice);
$police = $this->police->getPoliceIdSimple($idPolice);
$this->genererVue(array('police' => $police));
}
}

View File

@ -54,7 +54,7 @@ $(function() {
// 1. Initialisation des composants au chargement de la page
appliquerDataTable('.tabliste');
/*
// 2. Lancement du cycle de rafraîchissement automatique
const vueActuelle = $("#vue").val();
@ -67,6 +67,7 @@ $(function() {
}
}, 60000); // 60 secondes
}
*/
});
/**
@ -773,4 +774,33 @@ function prorater_prime_adherent()
complete: function() {
}
});
}
function imprimer_contrat()
{
window.location.assign($("#racineWeb" ).val()+"Contrat/");
}
function adherents_police()
{
if ($("#idPolice_C" ).val()>"")
{
window.location.assign($("#racineWeb" ).val()+"Listeadherent/");
}
}
function afficher_adherents_police()
{
$("#div_liste_adherent").html('<div style="padding-top:80px;"><img src="Bootstrap/images/loading.gif"/>&nbsp;&nbsp;<span style="font-size:15pt;">' + 'Veuillez patienter... / Please wait...' + '</span></div>');
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisteadherent/",
type : 'post',
// data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_liste_adherent").html(data);
}
});
}

17
Modele/Etatcp.php Normal file
View File

@ -0,0 +1,17 @@
<?php
require_once 'Framework/Modele.php';
class Etatcp extends Modele {
public function getEtatcp()
{
$codeSociete = $_SESSION['codeSociete'];
$sql = 'SELECT * FROM etatcp where (codeSociete = ?) order by ordre;';
$liste = $this->executerRequete($sql, array($codeSociete));
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
}

View File

@ -0,0 +1,164 @@
<?php
$codeTypeAvenant = $_SESSION['codeTypeAvenant_C'];
$superUser = $_SESSION['superUser'];
$numeroPolice = $this->nettoyer($_SESSION['numeroPolice_C']);
?>
<div class="container-fluid py-4 animate__animated animate__fadeIn">
<div class="card shadow-sm border-0 mb-4 bg-dark text-white">
<div class="card-body d-flex align-items-center justify-content-between p-3">
<div class="d-flex align-items-center">
<div class="bg-primary p-2 rounded-3 me-3">
<i class="fas fa-users fa-lg"></i>
</div>
<div>
<h5 class="mb-0 fw-bold"><?= _("Gestion des Adhérents") ?></h5>
<small class="text-info"><?= _("Police N°") ?> : <?= $numeroPolice ?></small>
</div>
</div>
<div class="d-flex gap-2">
<button type="button" class="btn btn-outline-info btn-sm" onclick="javascript:afficher_adherents_police();">
<i class="fas fa-sync-alt me-1"></i> <?= _("Actualiser") ?>
</button>
</div>
</div>
</div>
<div class="row mb-3 g-3">
<div class="col-md-7">
<div class="input-group shadow-sm">
<span class="input-group-text bg-white border-end-0 text-muted">
<i class="fas fa-search"></i>
</span>
<input type="text" id="filterInput" class="form-control border-start-0 ps-0"
placeholder="<?= _('Rechercher par nom, prénom ou n° adhérent...') ?>"
onkeyup="filtrerTableauAdherents()">
</div>
</div>
<div class="col-md-3">
<select class="form-select shadow-sm" id="statusFilter" onchange="filtrerTableauAdherents()">
<option value="all">🔍 <?= _("Tous les statuts") ?></option>
<option value="actif">🟢 <?= _("Actifs (Modifiables)") ?></option>
<option value="archive">🟠 <?= _("Archivés") ?></option>
</select>
</div>
<div class="col-md-2">
<div class="dropdown w-100">
<button class="btn btn-primary w-100 dropdown-toggle shadow-sm" type="button" data-bs-toggle="dropdown">
<i class="fas fa-download me-2"></i><?= _("Exporter") ?>
</button>
<ul class="dropdown-menu dropdown-menu-end shadow">
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#pop_liste_assures"><i class="fas fa-file-pdf me-2 text-danger"></i><?= _("Format PDF") ?></a></li>
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#pop_exporter_liste_assures"><i class="fas fa-file-excel me-2 text-success"></i><?= _("Format Excel") ?></a></li>
</ul>
</div>
</div>
</div>
<div id="div_liste_adherent" class="table-responsive shadow-sm rounded-3 border bg-white">
<table class="table table-hover align-middle mb-0" id="tableAdherents" style="font-size: 0.9rem;">
<thead class="table-light">
<tr>
<th class="ps-3 py-3 text-center" width="10%"><?= _("N° Adhérent") ?></th>
<th><?= _("Identité de l'assuré") ?></th>
<th class="text-center"><?= _("Collège") ?></th>
<th class="text-center"><?= _("Période Couverture") ?></th>
<th class="text-center" width="15%"><?= _("Actions") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($adherents as $adherent):
$idAdh = $adherent['id'];
$noAdh = $this->nettoyer($adherent['numeroAdherent']);
$estsupprimable = ($this->nettoyer($adherent['primeArchive']) == "0");
$statusClass = $estsupprimable ? 'status-actif' : 'status-archive';
?>
<tr class="<?= $statusClass ?> cursor-pointer"
onclick="selectionner_adherent(<?= $idAdh ?>,'<?= $noAdh ?>');"
ondblclick="afficher_adherent_id();">
<td class="text-center">
<span class="badge bg-light text-dark border fw-bold px-2 py-2">
<?= $noAdh ?>
</span>
</td>
<td>
<div class="fw-bold text-dark text-uppercase"><?= $this->nettoyer($adherent['nom']) ?></div>
<div class="small text-muted"><?= $this->nettoyer($adherent['prenoms']) ?></div>
</td>
<td class="text-center">
<span class="badge bg-primary-subtle text-primary mb-1"><?= $this->nettoyer($adherent['codeProduit']) ?></span>
<div class="x-small text-muted text-truncate" title="<?= $this->nettoyer($adherent['libelleCollege']) ?>" style="max-width: 140px;">
<?= $this->nettoyer($adherent['libelleCollege']) ?>
</div>
</td>
<td class="text-center">
<div class="d-flex justify-content-center align-items-center small">
<span class="text-success fw-bold"><?= dateLang($this->nettoyer($adherent['dateEntree'])) ?></span>
<i class="fas fa-arrow-right mx-2 text-muted" style="font-size: 0.7rem;"></i>
<span class="text-danger fw-bold"><?= $adherent['dateSortie'] ? dateLang($this->nettoyer($adherent['dateSortie'])) : '--' ?></span>
</div>
</td>
<td class="text-end pe-3">
<div class="btn-group btn-group-sm shadow-sm border rounded">
<button class="btn btn-white border-0" title="<?= _("Voir la fiche") ?>" onclick="selectionner_adherent(<?= $idAdh ?>,'<?= $noAdh ?>'); afficher_adherent_id();">
<i class="fas fa-user-edit text-primary"></i>
</button>
<?php if(!$estsupprimable): ?>
<?php if ($superUser == "1"): ?>
<button class="btn btn-white border-0" title="<?= _("Désarchiver") ?>" onClick="de_archiver_adherent('<?= $idAdh ?>'); event.stopPropagation();">
<i class="fas fa-box-open text-warning"></i>
</button>
<?php endif; ?>
<?php else: ?>
<button class="btn btn-white border-0 border-start" title="<?= _("Archiver") ?>" onClick="archiver_adherent('<?= $idAdh ?>'); event.stopPropagation();">
<i class="fas fa-archive text-info"></i>
</button>
<button class="btn btn-white border-0 border-start text-danger" title="<?= _("Supprimer") ?>" onClick="supprimer_adherent_id('<?= $idAdh ?>'); event.stopPropagation();">
<i class="fas fa-trash"></i>
</button>
<?php endif; ?>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<style>
.cursor-pointer { cursor: pointer; transition: all 0.2s; }
.cursor-pointer:hover { background-color: #f8f9fa !important; }
.status-actif { border-left: 4px solid #0dcaf0 !important; }
.status-archive { border-left: 4px solid #ffc107 !important; background-color: #fffdf5; }
.x-small { font-size: 0.72rem; }
.btn-white { background: #fff; }
.btn-white:hover { background: #f0f0f0; }
</style>
<script>
function filtrerTableauAdherents() {
const input = document.getElementById("filterInput").value.toUpperCase();
const status = document.getElementById("statusFilter").value;
const tr = document.querySelectorAll("#tableAdherents tbody tr");
tr.forEach(row => {
const text = row.textContent.toUpperCase();
const estArchive = row.classList.contains('status-archive');
const matchText = text.includes(input);
const matchStatus = (status === 'all') ||
(status === 'actif' && !estArchive) ||
(status === 'archive' && estArchive);
row.style.display = (matchText && matchStatus) ? "" : "none";
});
}
</script>

81
Vue/Contrat/index.php Normal file
View File

@ -0,0 +1,81 @@
<?php
$this->titre = "Tâches - Editions contrats";
$codeTypeContrat = $_SESSION['codeTypeContrat'];
$prestationPossible = isset($prestationPossible) ? $prestationPossible : '0';
$estAgence = isset($estAgence) ? $estAgence : '0';
?>
<legend><?= _("EDITION CONTRAT") . " : " . $this->nettoyer($_SESSION['numeroPolice_C'])?> </legend>
<table class="table table-responsive table-condensed" style='font-size:10pt; text-align:center'>
<thead>
<tr>
<th style='text-align:center'> <?= _("FRANCAIS") ?> </th>
<th style='text-align:center'>=></th>
<th style='text-align:center'> <?= _("ANGLAIS") ?> </th>
</tr>
</thead>
<tbody>
<?php foreach ($etats as $etat):
$lienEtat = $etat['lienEtat'];
$lienEtatEng = $etat['lienEtatEng'];
?>
<tr valign="top">
<td> <input style='font-size:10pt;' class = "form-control btn btn-primary" type="button" value="<?= $this->nettoyer($etat['nomEtat']) ?>" onClick="javascript:imprimer_cp('<?= $lienEtat ?>');"> </td>
<td>=></td>
<td> <input style='font-size:10pt;' class = "form-control btn btn-primary" type="button" value="<?= $this->nettoyer($etat['nomEtatEng']) ?>" onClick="javascript:imprimer_cp('<?= $lienEtatEng ?>');"> </td>
</tr>
<tr>
<td height="20" colspan="3"></td>
</tr>
<?php endforeach; ?>
<tr>
<td> <a style='font-size:10pt;' class="form-control btn btn-primary" href="<?= $_SESSION['dossierSociete'].'/Docs/CONDITIONS_GENERALES.pdf' ?>" target="_blank" >CONDITIONS GENERALES </a> </td>
<td>=></td>
<td> <a style='font-size:10pt;' class="form-control btn btn-primary" href="<?= $_SESSION['dossierSociete'].'/Docs/CONDITIONS_GENERALES_ENG.pdf' ?>" target="_blank" >GENERALS CONDITIONS</a> </td>
</tr>
<?php if($codeTypeContrat=="F"): ?>
<tr valign="top">
<td> <input style='font-size:10pt;' class = "form-control btn btn-primary" type="button" value="<?= $this->nettoyer($etat['nomEtat']) ?>" onClick="javascript:imprimer_cp('<?= $lienEtat ?>');"> </td>
<td>=></td>
<td> <input style='font-size:10pt;' class = "form-control btn btn-primary" type="button" value="<?= $this->nettoyer($etat['nomEtatEng']) ?>" onClick="javascript:imprimer_cp('<?= $lienEtatEng ?>');"> </td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php if($codeTypeContrat=="F"): ?>
<legend><?= _("CONTRAT INDIVIDUEL") ?> </legend>
<table class="table table-responsive table-condensed" style='font-size:10pt; text-align:center'>
<thead>
<tr>
<th style='text-align:center'> <?= _("ENGLISH") ?> </th>
<th style='text-align:center'>=></th>
<th style='text-align:center'> <?= _("KINYARWANDA") ?> </th>
</tr>
</thead>
<tbody>
<tr valign="top">
<td> <input style='font-size:10pt;' class = "form-control btn btn-primary" type="button" value="FC1 ENGLISH" onClick="javascript:imprimer_cp_fc('Cpfc1eng');"> </td>
<td>=></td>
<td> <input style='font-size:10pt;' class = "form-control btn btn-primary" type="button" value="FC1 KINYARWANDA" onClick="javascript:imprimer_cp_fc('Cpfc1kiny');"> </td>
</tr>
<tr valign="top">
<td> <input style='font-size:10pt;' class = "form-control btn btn-primary" type="button" value="FC2 ENGLISH" onClick="javascript:imprimer_cp_fc('Cpfc2eng');"> </td>
<td>=></td>
<td> <input style='font-size:10pt;' class = "form-control btn btn-primary" type="button" value="FC2 KINYARWANDA" onClick="javascript:imprimer_cp_fc('Cpfc2kiny');"> </td>
</tr>
</tbody>
</table>
<?php endif; ?>
<div id="div_export_a">
</div>

102
Vue/Listeadherent/index.php Normal file
View File

@ -0,0 +1,102 @@
<?php
$codeTypeAvenant = $_SESSION['codeTypeAvenant_C'];
$estsupprimable_0 = ($codeTypeAvenant=="AFN" || $codeTypeAvenant=="REN");
$superUser = $_SESSION['superUser'];
$prestationPossible = $this->nettoyer($police['prestationPossible']);
?>
<div class="container-fluid py-4 animate__animated animate__fadeIn">
<div class="card shadow-sm border-0 mb-4 bg-office-primary-lighter text-white">
<div class="card-body d-flex align-items-center justify-content-between p-3">
<div class="d-flex align-items-center">
<div class="bg-white p-2 rounded-circle me-3">
<i class="fas fa-users text-primary"></i>
</div>
<div>
<h5 class="mb-0 fw-bold"><?= _("Gestion des Adhérents") ?></h5>
<small class="opacity-75"><?= _("Police N°") ?> : <?= $this->nettoyer($_SESSION['numeroPolice_C']) ?></small>
</div>
</div>
<button type="button" class="btn btn-light btn-sm fw-bold shadow-sm" onclick="javascript:afficher_adherents_police();">
<i class="fas fa-sync-alt me-2 text-primary"></i> <?= _("Actualiser la liste") ?>
</button>
</div>
</div>
<input type="hidden" id="prestationPossible" name="prestationPossible" value="<?= $prestationPossible ?>">
<button class="d-none" id="btn_liste_assures" data-bs-toggle="modal" data-bs-target="#pop_liste_assures"></button>
<button class="d-none" id="btn_exporter_liste_assures" data-bs-toggle="modal" data-bs-target="#pop_exporter_liste_assures"></button>
<button class="d-none" id="btn_liste_assures_sans_format" data-bs-toggle="modal" data-bs-target="#pop_liste_liste_assures_sans_format"></button>
<div id="div_liste_adherent" class="min-vh-50 rounded bg-white shadow-sm p-3">
<div class="text-center py-5 text-muted">
<i class="fas fa-spinner fa-spin fa-2x mb-3"></i>
<p><?= _("Chargement de la liste des adhérents...") ?></p>
</div>
</div>
<div id="div_export_a"></div>
</div>
<?php
// Configuration des modaux pour éviter la répétition
$modals = [
'pop_liste_assures' => [
'title' => _("Liste des assurés actifs (PDF)"),
'id_date' => 'dateAnalyse',
'id_div' => 'div_export_assures',
'func' => 'imprimer_liste_assures_date()',
'icon' => 'fa-file-pdf'
],
'pop_exporter_liste_assures' => [
'title' => _("Exporter la liste (Excel)"),
'id_date' => 'dateAnalyse_export',
'id_div' => 'div_exporter_liste_assures',
'func' => 'exporter_liste_assures_date()',
'icon' => 'fa-file-excel'
],
'pop_liste_liste_assures_sans_format' => [
'title' => _("Liste brute (Sans format)"),
'id_date' => 'dateAnalyse_sans_format',
'id_div' => 'div_export_assures_sans_format',
'func' => 'exporter_liste_assures_sans_format_date()',
'icon' => 'fa-file-alt'
]
];
foreach ($modals as $id => $cfg):
?>
<div class="modal fade" id="<?= $id ?>" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content border-0 shadow-lg">
<div class="modal-header bg-light border-bottom-0">
<h5 class="modal-title fw-bold text-dark">
<i class="fas <?= $cfg['icon'] ?> me-2 text-primary"></i> <?= $cfg['title'] ?>
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body p-4">
<div class="mb-4">
<label for="<?= $cfg['id_date'] ?>" class="form-label small fw-bold text-muted text-uppercase"><?= _("Date d'analyse") ?></label>
<div class="input-group input-group-lg">
<span class="input-group-text bg-white border-end-0"><i class="fas fa-calendar-day text-muted"></i></span>
<input type="text" class="form-control datepicker border-start-0 text-center fw-bold"
id="<?= $cfg['id_date'] ?>" name="<?= $cfg['id_date'] ?>"
value="<?= $this->datejourfr ?>" required>
</div>
</div>
<button class="btn btn-primary w-100 py-3 fw-bold shadow-sm" type="button" onClick="javascript:<?= $cfg['func'] ?>">
<i class="fas fa-play me-2"></i> <?= _("Générer l'exportation") ?>
</button>
<div id="<?= $cfg['id_div'] ?>" class="mt-3"></div>
</div>
<div class="modal-footer bg-light border-top-0 justify-content-center">
<button type="button" class="btn btn-link btn-sm text-decoration-none text-muted" data-bs-dismiss="modal"><?= _("Annuler et fermer") ?></button>
</div>
</div>
</div>
</div>
<?php endforeach; ?>

View File

@ -568,14 +568,13 @@ $activeChildId = $menuData['child'];
</script>
<script type="text/javascript">
/*$('#timer').timer({
$('#timer').timer({
duration: '60s',
callback: function() {
raffraichier_messagerie();
raffraichier_gabarit();
},
repeat: true
});
*/
</script>
<!-- JavaScript Libraries -->
@ -600,7 +599,7 @@ $activeChildId = $menuData['child'];
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Application Scripts -->
<script src="/Js/fonctions.js?ver=2025.12.30.01"></script>
<script src="/Js/fonctions.js?ver=2025.12.30.02"></script>
<?php if (est_anglophone()): ?>
<script src="/Js/datepicker-eng.js"></script>