production/Controleur/ControleurAjaxhistoriqueprestationsfamille.php
2025-12-02 11:29:44 +00:00

86 lines
2.4 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Prestationactes.php';
require_once 'Modele/Garantie.php';
class ControleurAjaxhistoriqueprestationsfamille extends Controleur {
private $prestationactes;
private $garantie;
public function __construct() {
$this->prestationactes = new Prestationactes();
$this->garantie = new Garantie();
}
public function index()
{
$numeroAdherent = $this->requete->getParametreFormulaire("numeroAdherent");
$garanties = $this->garantie->getListePourActe();
$this->genererVueAjax(array('numeroAdherent' => $numeroAdherent, 'garanties' => $garanties));
}
public function prestations()
{
$numeroAdherent = $this->requete->getParametreFormulaire("numeroAdherent");
//$_SESSION['numeroBeneficiaire'] = $numeroBeneficiaire;
$codeGarantie = $this->requete->getParametreFormulaire("codeGarantie");
$d1 = $this->requete->getParametreDate("d1");
$d2 = $this->requete->getParametreDate("d2");
$garanties = $this->garantie->getListePourActe();
$historiqueprestations = $this->prestationactes->gethistoriqueprestationsfamille($numeroAdherent, $codeGarantie, $d1, $d2);
$totalprestations = $this->prestationactes->gettotalprestationsfamille($numeroAdherent, $codeGarantie, $d1, $d2);
$this->genererVueAjax(array('garanties' => $garanties,'historiqueprestations' => $historiqueprestations,
'totalprestations' => $totalprestations));
}
public function majquantite()
{
$idExamen = $this->requete->getParametre("idExamen");
$quantite = $this->requete->getParametreFormulaire("quantite", "numerique");
$tm = intval($_SESSION['tm_C']);
$this->examen->majquantite($idExamen, $quantite, $tm);
$this->executerAction("index");
}
public function supprimer()
{
$idExamen = $this->requete->getParametre("idExamen");
$this->examen->supprimerexamen($idExamen);
$this->examen->updateexamen($_SESSION['numeroFeuilleMaladie_C']);
$this->executerAction("index");
}
public function gettotalprestation($numeroBeneficiaire, $codeGarantie, $d1, $d2)
{
$sql = 'call sp_get_total_historique_prestation(?, ?, ?, ?);';
$resultat = $this->executerRequete($sql, array($numeroBeneficiaire, $codeGarantie, $d1, $d2));
return $resultat->fetch(PDO::FETCH_ASSOC);
}
}