This commit is contained in:
KONE SOREL 2026-03-28 14:26:14 +00:00
parent 6f6ed26fba
commit 676e64c6b1
8 changed files with 362 additions and 0 deletions

View File

@ -0,0 +1,31 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Police.php';
class ControleurAjaxrequetedetailsinistres extends Controleur
{
private $sppolice;
public function __construct() {
$this->sppolice = new Police();
}
public function index()
{
$dateFacture1 = $this->requete->getParametreDate("dateFacture1");
$dateFacture2 = $this->requete->getParametreDate("dateFacture2");
$_SESSION['dateDebutRequete'] = $this->requete->getParametreFormulaire("dateFacture1");
$_SESSION['dateFinRequete'] = $this->requete->getParametreFormulaire("dateFacture2");
$rpsinistres = $this->sppolice->requeteresumesinistres($dateFacture2);
$rpsinistres_total = $this->sppolice->requeteresumesinistres_total($dateFacture2);
$this->genererVueAjax(array(
'rpsinistres' => $rpsinistres,
'rpsinistres_total' => $rpsinistres_total
));
}
}

View File

@ -0,0 +1,23 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Police.php';
class ControleurAjaxrequeteentetedetailsinistres extends Controleur {
private $sppolice;
public function __construct()
{
$this->sppolice = new Police();
}
public function index()
{
$idPolice = $_SESSION['idPolice_C'];
$dj = date("Y-m-d");
$sppoliceentete = $this->sppolice->getRapportSpPoliceEntete($idPolice, $dj);
$this->genererVueAjax(array('sppoliceentete' => $sppoliceentete));
}
}

View File

@ -0,0 +1,23 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Police.php';
class ControleurAjaxrequeteentetefrequencesprestataires extends Controleur {
private $sppolice;
public function __construct()
{
$this->sppolice = new Police();
}
public function index()
{
$idPolice = $_SESSION['idPolice_C'];
$dj = date("Y-m-d");
$sppoliceentete = $this->sppolice->getRapportSpPoliceEntete($idPolice, $dj);
$this->genererVueAjax(array('sppoliceentete' => $sppoliceentete));
}
}

View File

@ -0,0 +1,31 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Police.php';
class ControleurAjaxrequetefrequencesprestataires extends Controleur
{
private $sppolice;
public function __construct() {
$this->sppolice = new Police();
}
public function index()
{
$dateFacture1 = $this->requete->getParametreDate("dateFacture1");
$dateFacture2 = $this->requete->getParametreDate("dateFacture2");
$_SESSION['dateDebutRequete'] = $this->requete->getParametreFormulaire("dateFacture1");
$_SESSION['dateFinRequete'] = $this->requete->getParametreFormulaire("dateFacture2");
$rpsinistres = $this->sppolice->requeteresumesinistres($dateFacture2);
$rpsinistres_total = $this->sppolice->requeteresumesinistres_total($dateFacture2);
$this->genererVueAjax(array(
'rpsinistres' => $rpsinistres,
'rpsinistres_total' => $rpsinistres_total
));
}
}

View File

@ -0,0 +1,76 @@
<?php $nbligne = 0; ?>
<div id="div_detail_requete" class="card border-0 shadow-sm animate__animated animate__fadeIn">
<div class="card-header bg-dark text-white p-3">
<div class="row align-items-center text-center">
<div class="col-md-4 border-end border-secondary">
<small class="text-uppercase opacity-75 d-block"><?= _("Volume Total") ?></small>
<span class="h5 fw-bold"><?= format_N($rpsinistres_total['nbLigne']) ?> <?= _("Lignes") ?></span>
</div>
<div class="col-md-4 border-end border-secondary">
<small class="text-uppercase opacity-75 d-block"><?= _("Cumul Sinistres") ?></small>
<span class="h5 fw-bold text-warning"><?= format_N($rpsinistres_total['sinistres_total']) ?></span>
</div>
<div class="col-md-4">
<i class="fas fa-info-circle me-1 text-info"></i>
<small><?= _("Affichage limité aux 200 premières lignes") ?></small>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed tabliste compact w-100" style="font-size:0.85rem; white-space:nowrap;">
<thead class="table-light border-bottom text-uppercase small fw-bold">
<tr>
<th class="text-center"><?= _("N° Adhérent") ?></th>
<th><?= _("Adhérent Principal") ?></th>
<th class="text-center"><?= _("Date de début") ?></th>
<th class="text-center"><?= _("Période passée") ?></th>
<th class="text-center"><?= _("Sinistres") ?></th>
<th class="text-center"><?= _("Ratio (%)") ?></th>
<th class="text-center">Cat</th>
</tr>
</thead>
<tbody>
<?php foreach ($rpsinistres as $rpsinistre):
$nbligne++;
$ratio = (float)$rpsinistre['ratio'];
// Couleur dynamique pour le ratio
$ratioClass = ($ratio > 100) ? 'text-danger fw-bold' : (($ratio > 70) ? 'text-warning' : 'text-success');
?>
<tr>
<td class="text-center fw-bold text-primary"><?= $this->nettoyer($rpsinistre['numeroAdherent']) ?></td>
<td><?= $this->nettoyer($rpsinistre['Adherent']) ?></td>
<td class="text-center text-muted"><?= dateLang($this->nettoyer($rpsinistre['dateEffetAdherent']), $_SESSION['lang']) ?></td>
<td class="text-center"><?= $this->nettoyer($rpsinistre['duree_acquise']) ?> <small><?= _("j") ?></small></td>
<td class="text-center fw-bold"><?= format_N($rpsinistre['sinistres']) ?></td>
<td class="text-center <?= $ratioClass ?>">
<?= number_format($ratio, 2, ',', ' ') ?> %
</td>
<td class="text-center">
<span class="badge bg-secondary-subtle text-secondary border border-secondary-subtle">
<?= $this->nettoyer($rpsinistre['codeProduit']) ?>
</span>
</td>
</tr>
<?php
if ($nbligne == 200) {
$nbligne = "> " . $nbligne . " => " . _("Utilisez l'export Excel");
break;
}
?>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="card-footer bg-white text-end py-2">
<small class="text-muted italic"><?= _("Généré le") ?> <?= date('d/m/Y H:i') ?></small>
</div>
<input class="sr-only" type="text" id="nbligne_info" name="nbligne_info" value="<?= $nbligne ?>">
</div>

View File

@ -0,0 +1,51 @@
<?php
$_SESSION['dateDebutRequete'] = isset($_SESSION['dateDebutRequete'])
? dateLang($_SESSION['dateDebutRequete'], $_SESSION['lang'])
: dateLang($this->nettoyer($sppoliceentete['dateEffet']), $_SESSION['lang']);
$_SESSION['dateFinRequete'] = isset($_SESSION['dateFinRequete'])
? dateLang($_SESSION['dateFinRequete'], $_SESSION['lang'])
: dateCouranteLang($_SESSION['lang']);
?>
<div id="div_ente_requete" class="card border-0 shadow-sm bg-light mb-2" style="border-radius: 12px;">
<div class="card-body p-3">
<div class="row g-3 align-items-end">
<div class="col-12 col-md-5">
<label class="form-label small fw-bold text-muted text-uppercase mb-1">
<i class="fas fa-calendar-alt me-1 text-primary"></i> <?= _("Période de recherche") ?>
</label>
<div class="input-group input-group-sm">
<input class="form-control text-center fw-bold" type="text" id="dateFacture1" name="dateFacture1"
value="<?= $_SESSION['dateDebutRequete']; ?>" readonly>
<span class="input-group-text bg-white fw-bold border-start-0 border-end-0"><?= _("au") ?></span>
<input class="form-control datepicker text-center fw-bold" type="text" id="dateFacture2" name="dateFacture2"
value="<?= $_SESSION['dateFinRequete'] ?>" required>
</div>
</div>
<div class="col-6 col-md-2">
<label class="form-label small fw-bold text-muted text-uppercase mb-1"><?= _("Lignes") ?></label>
<div class="input-group input-group-sm">
<span class="input-group-text bg-dark text-white"><i class="fas fa-list-ol"></i></span>
<input class="form-control text-center bg-white fw-bold" type="text" id="nbligne" name="nbligne" value="0" readonly>
</div>
</div>
<div class="col-6 col-md-5">
<div class="d-flex gap-2">
<button type="button" class="btn btn-primary btn-sm flex-grow-1 fw-bold shadow-sm" onclick="javascript:requetes_resume_sinistres();">
<i class="fas fa-search me-2"></i><?= _("Afficher") ?>
</button>
<button type="button" class="btn btn-success btn-sm flex-grow-1 fw-bold shadow-sm" onclick="javascript:requetes_resume_sinistres_export();">
<i class="fas fa-file-excel me-2"></i><?= _("Exporter") ?>
</button>
</div>
</div>
</div>
</div>
</div>
<div id="div_export_a">
</div>

View File

@ -0,0 +1,51 @@
<?php
$_SESSION['dateDebutRequete'] = isset($_SESSION['dateDebutRequete'])
? dateLang($_SESSION['dateDebutRequete'], $_SESSION['lang'])
: dateLang($this->nettoyer($sppoliceentete['dateEffet']), $_SESSION['lang']);
$_SESSION['dateFinRequete'] = isset($_SESSION['dateFinRequete'])
? dateLang($_SESSION['dateFinRequete'], $_SESSION['lang'])
: dateCouranteLang($_SESSION['lang']);
?>
<div id="div_ente_requete" class="card border-0 shadow-sm bg-light mb-2" style="border-radius: 12px;">
<div class="card-body p-3">
<div class="row g-3 align-items-end">
<div class="col-12 col-md-5">
<label class="form-label small fw-bold text-muted text-uppercase mb-1">
<i class="fas fa-calendar-alt me-1 text-primary"></i> <?= _("Période de recherche") ?>
</label>
<div class="input-group input-group-sm">
<input class="form-control text-center fw-bold" type="text" id="dateFacture1" name="dateFacture1"
value="<?= $_SESSION['dateDebutRequete']; ?>" readonly>
<span class="input-group-text bg-white fw-bold border-start-0 border-end-0"><?= _("au") ?></span>
<input class="form-control datepicker text-center fw-bold" type="text" id="dateFacture2" name="dateFacture2"
value="<?= $_SESSION['dateFinRequete'] ?>" required>
</div>
</div>
<div class="col-6 col-md-2">
<label class="form-label small fw-bold text-muted text-uppercase mb-1"><?= _("Lignes") ?></label>
<div class="input-group input-group-sm">
<span class="input-group-text bg-dark text-white"><i class="fas fa-list-ol"></i></span>
<input class="form-control text-center bg-white fw-bold" type="text" id="nbligne" name="nbligne" value="0" readonly>
</div>
</div>
<div class="col-6 col-md-5">
<div class="d-flex gap-2">
<button type="button" class="btn btn-primary btn-sm flex-grow-1 fw-bold shadow-sm" onclick="javascript:requetes_resume_sinistres();">
<i class="fas fa-search me-2"></i><?= _("Afficher") ?>
</button>
<button type="button" class="btn btn-success btn-sm flex-grow-1 fw-bold shadow-sm" onclick="javascript:requetes_resume_sinistres_export();">
<i class="fas fa-file-excel me-2"></i><?= _("Exporter") ?>
</button>
</div>
</div>
</div>
</div>
</div>
<div id="div_export_a">
</div>

View File

@ -0,0 +1,76 @@
<?php $nbligne = 0; ?>
<div id="div_detail_requete" class="card border-0 shadow-sm animate__animated animate__fadeIn">
<div class="card-header bg-dark text-white p-3">
<div class="row align-items-center text-center">
<div class="col-md-4 border-end border-secondary">
<small class="text-uppercase opacity-75 d-block"><?= _("Volume Total") ?></small>
<span class="h5 fw-bold"><?= format_N($rpsinistres_total['nbLigne']) ?> <?= _("Lignes") ?></span>
</div>
<div class="col-md-4 border-end border-secondary">
<small class="text-uppercase opacity-75 d-block"><?= _("Cumul Sinistres") ?></small>
<span class="h5 fw-bold text-warning"><?= format_N($rpsinistres_total['sinistres_total']) ?></span>
</div>
<div class="col-md-4">
<i class="fas fa-info-circle me-1 text-info"></i>
<small><?= _("Affichage limité aux 200 premières lignes") ?></small>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed tabliste compact w-100" style="font-size:0.85rem; white-space:nowrap;">
<thead class="table-light border-bottom text-uppercase small fw-bold">
<tr>
<th class="text-center"><?= _("N° Adhérent") ?></th>
<th><?= _("Adhérent Principal") ?></th>
<th class="text-center"><?= _("Date de début") ?></th>
<th class="text-center"><?= _("Période passée") ?></th>
<th class="text-center"><?= _("Sinistres") ?></th>
<th class="text-center"><?= _("Ratio (%)") ?></th>
<th class="text-center">Cat</th>
</tr>
</thead>
<tbody>
<?php foreach ($rpsinistres as $rpsinistre):
$nbligne++;
$ratio = (float)$rpsinistre['ratio'];
// Couleur dynamique pour le ratio
$ratioClass = ($ratio > 100) ? 'text-danger fw-bold' : (($ratio > 70) ? 'text-warning' : 'text-success');
?>
<tr>
<td class="text-center fw-bold text-primary"><?= $this->nettoyer($rpsinistre['numeroAdherent']) ?></td>
<td><?= $this->nettoyer($rpsinistre['Adherent']) ?></td>
<td class="text-center text-muted"><?= dateLang($this->nettoyer($rpsinistre['dateEffetAdherent']), $_SESSION['lang']) ?></td>
<td class="text-center"><?= $this->nettoyer($rpsinistre['duree_acquise']) ?> <small><?= _("j") ?></small></td>
<td class="text-center fw-bold"><?= format_N($rpsinistre['sinistres']) ?></td>
<td class="text-center <?= $ratioClass ?>">
<?= number_format($ratio, 2, ',', ' ') ?> %
</td>
<td class="text-center">
<span class="badge bg-secondary-subtle text-secondary border border-secondary-subtle">
<?= $this->nettoyer($rpsinistre['codeProduit']) ?>
</span>
</td>
</tr>
<?php
if ($nbligne == 200) {
$nbligne = "> " . $nbligne . " => " . _("Utilisez l'export Excel");
break;
}
?>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="card-footer bg-white text-end py-2">
<small class="text-muted italic"><?= _("Généré le") ?> <?= date('d/m/Y H:i') ?></small>
</div>
<input class="sr-only" type="text" id="nbligne_info" name="nbligne_info" value="<?= $nbligne ?>">
</div>