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

59 lines
2.5 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Facturegarant.php';
require_once 'Modele/Encaissementgarant_temp.php';
require_once 'Modele/Detailencaissementgarant_temp.php';
class ControleurAjaxsituationgarant extends Controleur {
private $facture;
private $detailencaissement;
private $encaissement;
public function __construct() {
$this->facture = new Facturegarant();
$this->detailencaissement = new Detailencaissementgarant_temp();
$this->encaissement = new Encaissementgarant_temp();
}
public function index() {
$idEncaissementGarant_temp = $_SESSION['idEncaissementGarant_temp'];
$encaissement = $this->encaissement->getEncaissementTemp($idEncaissementGarant_temp);
$codeGcAssureur = $_SESSION['codeGcAssureur'];
$factures = $this->facture->getFacturesimpayees($codeGcAssureur, $idEncaissementGarant_temp);
$totalfactureImpayee = $this->facture->getTotalFactureImpayee($codeGcAssureur);
$detailencaissements = $this->detailencaissement->getDetailsEncaissementTemp($idEncaissementGarant_temp);
$totaldetailencaissement = $this->detailencaissement->getTotaldetailencaissement($idEncaissementGarant_temp);
$nomGarant = $this->facture->getNomGarant($codeGcAssureur);
$this->genererVueAjax(array('encaissement' => $encaissement, 'factures' => $factures, 'detailencaissements' => $detailencaissements,
'totalfactureImpayee' => $totalfactureImpayee, 'detailencaissements' => $detailencaissements,
'totaldetailencaissement' => $totaldetailencaissement, 'nomGarant' => $nomGarant));
}
public function solderfacture() {
$idFacture = $this->requete->getParametre("idFacture");
$this->facture->solderfacture($idFacture);
$this->executerAction("index");
}
public function ajouteracomptefacture() {
$idFacture = $this->requete->getParametre("idFacture");
$montantAcpte = $this->requete->getParametre("montantAcpte");
//$montantTtcAcpte = $this->requete->getParametre("montantTtcAcpte");
$this->facture->ajouteracomptefacture($idFacture, $montantAcpte);
$this->executerAction("index");
}
public function supprimerfacture() {
$idEncaissementGarant_temp = $_SESSION['idEncaissementGarant_temp'];
$idDetailencaissement = $this->requete->getParametre("idDetailencaissement");
//var_dump($idEncaissementGarant_temp, $idDetailencaissement);
$this->detailencaissement->supprimer($idDetailencaissement, $idEncaissementGarant_temp);
$this->executerAction("index");
}
}