a
This commit is contained in:
parent
a8fb9d26c0
commit
86124a7b86
91
Controleur/ControleurAjaxsyntheseconsopolice.php
Normal file
91
Controleur/ControleurAjaxsyntheseconsopolice.php
Normal file
|
|
@ -0,0 +1,91 @@
|
||||||
|
<?php
|
||||||
|
require_once 'Framework/Controleurrequete.php'; // OK
|
||||||
|
require_once 'Modele/Police.php';
|
||||||
|
|
||||||
|
class ControleurAjaxsyntheseconsopolice extends Controleurrequete
|
||||||
|
{
|
||||||
|
private $police;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->police = new Police();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$conommations = $this->police->getsyntheseconsopolice() ;
|
||||||
|
|
||||||
|
$this->genererVueAjax(array('conommations' => $conommations));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function exportxls()
|
||||||
|
{
|
||||||
|
|
||||||
|
$conommations = $this->police->getsyntheseconsopolice() ;
|
||||||
|
|
||||||
|
// Excel
|
||||||
|
$headerXLS = array
|
||||||
|
(
|
||||||
|
"dateReference",
|
||||||
|
"idAderent",
|
||||||
|
_('No Adhérent'),
|
||||||
|
_('Adhérent'),
|
||||||
|
"primeStat",
|
||||||
|
"primeTtc",
|
||||||
|
|
||||||
|
"plafond_OUT",
|
||||||
|
"consommation_OUT",
|
||||||
|
"solde_OUT",
|
||||||
|
|
||||||
|
"plafond_INP",
|
||||||
|
"consommation_INP",
|
||||||
|
"solde_INP",
|
||||||
|
|
||||||
|
"plafond_OPT",
|
||||||
|
"consommation_OPT",
|
||||||
|
"solde_OPT",
|
||||||
|
|
||||||
|
"plafond_MON",
|
||||||
|
"consommation_MON",
|
||||||
|
"solde_MON",
|
||||||
|
|
||||||
|
"plafond_DEN",
|
||||||
|
"consommation_DEN",
|
||||||
|
"solde_DEN",
|
||||||
|
|
||||||
|
"plafond_FUN",
|
||||||
|
"consommation_FUN",
|
||||||
|
"solde_FUN",
|
||||||
|
"consommation_ALL"
|
||||||
|
);
|
||||||
|
|
||||||
|
$dataXLS = array();
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($conommations as $conommation)
|
||||||
|
{
|
||||||
|
$dataXLS[]=$conommation;
|
||||||
|
}
|
||||||
|
|
||||||
|
$classeur = new PHPExcel();
|
||||||
|
$classeur->getProperties()->setCreator("INTER-SANTE");
|
||||||
|
$classeur->setActiveSheetIndex(0);
|
||||||
|
$feuille=$classeur->getActiveSheet();
|
||||||
|
$feuille->setTitle(_('SYNTHESE CONSOMMATIONS'));
|
||||||
|
$feuille->fromArray($headerXLS, NULL, 'A1', true);
|
||||||
|
$feuille->fromArray($dataXLS, NULL, 'A2', true);
|
||||||
|
|
||||||
|
//Forcer le téléchargement vers le navigateur;
|
||||||
|
$fichier = 'Temp/TMP_SYNTHESE_CONS'."_".uniqid().".xlsx";
|
||||||
|
|
||||||
|
$writer = new PHPExcel_Writer_Excel2007($classeur);
|
||||||
|
$writer->save($fichier);
|
||||||
|
|
||||||
|
$t_html =' <div id ="div_detail_exp" class="alert alert-info"> ';
|
||||||
|
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > '._("TELECHARGER").' </a> ';
|
||||||
|
$t_html .=' </div ';
|
||||||
|
echo $t_html;
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
26
Controleur/ControleurSyntheseconsopolice.php
Normal file
26
Controleur/ControleurSyntheseconsopolice.php
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
require_once 'Framework/Controleur.php';
|
||||||
|
require_once 'Modele/Police.php';
|
||||||
|
require_once 'Modele/Menuvueutilisateur.php';
|
||||||
|
|
||||||
|
class ControleurSyntheseconsopolice extends Controleur {
|
||||||
|
private $sppolice;
|
||||||
|
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->menuvue = new Menuvueutilisateur();
|
||||||
|
$this->menuvue->getMenuVue("Syntheseconsopolice");
|
||||||
|
|
||||||
|
$this->sppolice = new Police();
|
||||||
|
}
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$idPolice = $_SESSION['idPolice_C'];
|
||||||
|
|
||||||
|
$dj = date("Y-m-d");
|
||||||
|
|
||||||
|
$sppoliceentete = $this->sppolice->getRapportSpPoliceEntete($idPolice, $dj);
|
||||||
|
|
||||||
|
$this->genererVue(array('sppoliceentete' => $sppoliceentete));
|
||||||
|
}
|
||||||
|
}
|
||||||
63
Vue/Ajaxsyntheseconsopolice/index.php
Normal file
63
Vue/Ajaxsyntheseconsopolice/index.php
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
<div id="div_detail_sp">
|
||||||
|
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:7pt;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2" colspan="2" style='text-align:center'> <?= _("Adhérent") ?> </th>
|
||||||
|
|
||||||
|
<th colspan="2" style='text-align:center'> <?= _("Primes") ?> </th>
|
||||||
|
|
||||||
|
<th colspan="6" style='text-align:center'> <?= _("Plafonds") ?> </th>
|
||||||
|
|
||||||
|
<th colspan="7" style='text-align:center'> <?= _("Consommations") ?> </th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th style='text-align:center'> Stat </th>
|
||||||
|
<th style='text-align:center'> <?= _("TTC") ?> </th>
|
||||||
|
|
||||||
|
<th style='text-align:center'> OUT </th>
|
||||||
|
<th style='text-align:center'> INP </th>
|
||||||
|
<th style='text-align:center'> OPT </th>
|
||||||
|
<th style='text-align:center'> MON </th>
|
||||||
|
<th style='text-align:center'> DEN </th>
|
||||||
|
<th style='text-align:center'> FUN </th>
|
||||||
|
|
||||||
|
<th style='text-align:center'> OUT </th>
|
||||||
|
<th style='text-align:center'> INP </th>
|
||||||
|
<th style='text-align:center'> OPT </th>
|
||||||
|
<th style='text-align:center'> MON </th>
|
||||||
|
<th style='text-align:center'> DEN </th>
|
||||||
|
<th style='text-align:center'> FUN </th>
|
||||||
|
<th style='text-align:center'> ALL </th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($conommations as $conommation): ?>
|
||||||
|
<tr valign="top">
|
||||||
|
<td><?= $this->nettoyer($conommation['nomAdherent']) ?></td>
|
||||||
|
<td align='center'><?= $this->nettoyer($conommation['numeroAdherent']) ?></td>
|
||||||
|
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['primeStat'])) ?></td>
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['primeTtc'])) ?></td>
|
||||||
|
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['plafond_OUT'])) ?></td>
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['plafond_INP'])) ?></td>
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['plafond_OPT'])) ?></td>
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['plafond_MON'])) ?></td>
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['plafond_DEN'])) ?></td>
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['plafond_FUN'])) ?></td>
|
||||||
|
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_OUT'])) ?></td>
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_INP'])) ?></td>
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_OPT'])) ?></td>
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_MON'])) ?></td>
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_DEN'])) ?></td>
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_FUN'])) ?></td>
|
||||||
|
|
||||||
|
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_ALL'])) ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
49
Vue/Syntheseconsopolice/index.php
Normal file
49
Vue/Syntheseconsopolice/index.php
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?php
|
||||||
|
// $this->titre = "INTER-SANTE - SYNTHESE CONSOMMATIONS DE LA POLICE";
|
||||||
|
?>
|
||||||
|
|
||||||
|
<legend> <?= _("SYNTHESE CONSOMMATIONS DE LA POLICE") . " : " . $this->nettoyer($_SESSION['numeroPolice_C'])?> </legend>
|
||||||
|
|
||||||
|
<table class="table table-responsive table-condensed" style='font-size:10pt; text-align:center'>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th width="20%" style='text-align:center'> <?= _("Date Effet") ?> </th>
|
||||||
|
<th width="20%" style='text-align:center'> <?= _("Date Echéance") ?> </th>
|
||||||
|
<th width="20%" style='text-align:center'> <?= _("Durée Acquise") ?> </th>
|
||||||
|
<th width="20%" style='text-align:center'> <?= _("Ratio Acquise") ?> </th>
|
||||||
|
<th width="20%" style='text-align:center'> <?= _("Durée Contrat") ?> </th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td> <?= dateLang($this->nettoyer($sppoliceentete['dateEffet'])) ?> </td>
|
||||||
|
<td> <?= dateLang($this->nettoyer($sppoliceentete['dateEcheance'])) ?> </td>
|
||||||
|
<td> <?= $this->nettoyer($sppoliceentete['duree_acquise']) ?> </td>
|
||||||
|
<td> <?= $this->nettoyer($sppoliceentete['ratio_acquise']) ?> </td>
|
||||||
|
<td> <?= $this->nettoyer($sppoliceentete['dureePolice']) ?> </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table class="table table-responsive table-condensed" style='font-size:10pt;' >
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td> <button style='font-size:10pt;' type="button" class="form-control btn btn-primary" onclick="javascript:requetes_synthese_consommation_police();"> <?= _("Afficher résultats")."..." ?> </button> </td>
|
||||||
|
|
||||||
|
|
||||||
|
<td width="10%" > </td>
|
||||||
|
|
||||||
|
<td> <button style='font-size:10pt;' type="button" class="form-control btn btn-primary" onclick="javascript:requetes_synthese_consommation_police_export();"> <?= _("Exporter vers Excel...") ?> </button> </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div id="div_detail_exp">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="div_detail_sp">
|
||||||
|
|
||||||
|
</div>
|
||||||
Loading…
Reference in New Issue
Block a user