131 lines
4.6 KiB
PHP
Executable File
131 lines
4.6 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Feuillemaladie.php';
|
|
require_once 'Modele/Adherent.php';
|
|
require_once 'Modele/Beneficiaire.php';
|
|
require_once 'Modele/Garantieadherent.php';
|
|
require_once 'Modele/Garantie.php';
|
|
require_once 'Modele/Menuvueutilisateur.php';
|
|
|
|
class ControleurAccueilassure extends Controleur {
|
|
private $menuvue;
|
|
private $feuillemaladie;
|
|
private $beneficiaire;
|
|
private $garantieadherent;
|
|
private $adherent;
|
|
private $garantie;
|
|
|
|
public function __construct() {
|
|
$this->menuvue = new Menuvueutilisateur();
|
|
$this->menuvue->getMenuVue('Accueilassure');
|
|
|
|
$this->feuillemaladie = new Feuillemaladie();
|
|
$this->adherent = new Adherent();
|
|
$this->beneficiaire = new Beneficiaire();
|
|
$this->garantieadherent = new Garantieadherent();
|
|
$this->garantie = new Garantie();
|
|
}
|
|
|
|
public function index() {
|
|
|
|
$idAdherent = $_SESSION['idAdherent_C'];
|
|
$d1 = $_SESSION['dUneSemaineAvant_C'];
|
|
|
|
$d2 = date('Y-m-d');
|
|
|
|
$feuillemaladies = $this->feuillemaladie->getfeuillesmaladiefamille($idAdherent, $d1, $d2);
|
|
$prestation = $this->adherent->getlisteprestations();
|
|
|
|
$numeroBeneficiaire = $this->requete->getParametreFormulaire("numeroBeneficiaire");
|
|
|
|
$idPolice = $_SESSION['idPolice_C'];
|
|
$idAdherent = $_SESSION['idAdherent_C'];
|
|
|
|
$idBeneficiaireAdherent = $this->beneficiaire->getIdBeneficiaireAdherent($idAdherent);
|
|
|
|
// $idBeneficiaire = (isset($_SESSION['idBeneficiaire_C']) && $_SESSION['idBeneficiaire_C'] > "0") ? (int)$_SESSION['idBeneficiaire_C'] : $idBeneficiaireAdherent;
|
|
// KANE 24/03/2025
|
|
$idBeneficiaire = $idBeneficiaireAdherent;
|
|
$_SESSION['idBeneficiaire_C'] = $idBeneficiaireAdherent;
|
|
|
|
$dateJour = date('Y-m-d');
|
|
|
|
$beneficiaire = $this->beneficiaire->getContexteBeneficiaireId($idBeneficiaire);
|
|
|
|
|
|
$adherent = $this->adherent->getContexteAdherentId($idAdherent);
|
|
$beneficiaires = $this->beneficiaire->getBeneficiairesId($idAdherent, $dateJour);
|
|
|
|
|
|
$garantieadherents = $this->garantieadherent->getGarantieBeneficiaire($idBeneficiaire);
|
|
|
|
|
|
if ($idBeneficiaire !== null) {
|
|
$actes = $this->garantieadherent->getBaremePlafondAdherent($idAdherent, $idBeneficiaire);
|
|
} else {
|
|
$actes = null;
|
|
}
|
|
|
|
$this->adherent->controlerplafondadherentannuel($idAdherent);
|
|
$_SESSION['controlerPlafondBeneficiaire'] = "0";
|
|
|
|
|
|
|
|
$limite_adherent = $this->adherent->getLimitesAdherent($idAdherent, $dateJour);
|
|
|
|
$garanties = $this->garantie->getListePourActe();
|
|
|
|
$tabPrestationsMois = $this->adherent->getPrestationsmensuelles($idAdherent);
|
|
$tabPrestationsliens = $this->adherent->getPrestationsLiensParente($idAdherent);
|
|
|
|
$mois = array();
|
|
$consos = array();
|
|
|
|
$lienparente = array();
|
|
$consos_liens = array();
|
|
|
|
|
|
$tabConsoParGaranties = [
|
|
'garanties' => [],
|
|
'depenses' => [],
|
|
'plafonds' => []
|
|
];
|
|
|
|
foreach ($tabPrestationsMois as $v){
|
|
array_push($mois, $v['mois']);
|
|
array_push($consos, $v['consommationAdherent']);
|
|
}
|
|
|
|
foreach ($tabPrestationsliens as $v){
|
|
array_push($lienparente, $v['lienparente']);
|
|
array_push($consos_liens, $v['consommation']);
|
|
}
|
|
|
|
foreach ($garantieadherents as $v) {
|
|
$tabConsoParGaranties['garanties'][] = $v['codeGarantie'];
|
|
$tabConsoParGaranties['depenses'][] = $v['consommationFamille'];
|
|
$tabConsoParGaranties['plafonds'][] = $v['plafondFamille'];
|
|
}
|
|
|
|
|
|
$nbreLienParente = count($lienparente);
|
|
|
|
$labels_mois = json_encode($mois);
|
|
$data_consos = json_encode($consos,JSON_NUMERIC_CHECK);
|
|
|
|
$labels_liens = json_encode($lienparente);
|
|
$data_liens = json_encode($consos_liens,JSON_NUMERIC_CHECK);
|
|
|
|
$dataConsoParGaranties = json_encode($tabConsoParGaranties,JSON_NUMERIC_CHECK);
|
|
|
|
//var_dump($dataConsoParGaranties); die();
|
|
|
|
$this->genererVue(array(
|
|
'adherent' => $adherent,'beneficiaires' => $beneficiaires,'garantieadherents' => $garantieadherents,
|
|
'limite_adherent' => $limite_adherent,'prestation' => $prestation,'garanties' => $garanties,
|
|
'numeroBeneficiaire' => $numeroBeneficiaire, 'actes' => $actes, 'labels_mois' => $labels_mois,
|
|
'data_consos' => $data_consos, 'labels_liens' => $labels_liens, 'data_liens' => $data_liens,
|
|
'nbreLienParente' => $nbreLienParente, 'dataConsoParGaranties' => $dataConsoParGaranties));
|
|
}
|
|
}
|