assure/Controleur/ControleurAjaxhistoriqueprestation.php
2025-12-05 09:34:39 +00:00

90 lines
2.6 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Examen.php';
require_once 'Modele/Prestationactes.php';
require_once 'Modele/Garantie.php';
class ControleurAjaxhistoriqueprestation extends Controleur {
private $examen;
private $prestationactes;
private $garantie;
public function __construct() {
$this->examen = new Examen();
$this->prestationactes = new Prestationactes();
$this->garantie = new Garantie();
}
public function index()
{
/*
$numeroAdherent = $this->requete->getParametreFormulaire("numeroAdherent");
$beneficiaire = $this->prestationactes->getInfoBeneficiaire($numeroBeneficiaire);
$garanties = $this->garantie->getListePourActe();
*/
$this->genererVueAjax(/*array('beneficiaire' => $beneficiaire, '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->gethistoriqueprestation($numeroAdherent, $codeGarantie, $d1, $d2);
$totalprestations = $this->prestationactes->gettotalprestation($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);
}
}