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

52 lines
1.4 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Client.php';
require_once 'Modele/Police.php';
require_once 'Modele/Menuvueutilisateur.php';
require_once 'Modele/Tarifsactes.php';
require_once 'Modele/Pmodepaiement.php';
class ControleurFicheclient extends Controleur {
private $menuvue;
private $client;
private $police;
private $tarif;
private $modepaiement;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue("Ficheclient");
$this->client = new Client();
$this->police = new Police();
$this->tarif = new Tarifsactes();
$this->modepaiement = (new Pmodepaiement())->getListe();
$_SESSION['modeDevis'] = "0";
}
public function index() {
$id = $_SESSION['idClientAjax'];
$this->client->getContexteClientId($id);
$client = $this->client->getClientId($id);
$polices = $this->police->getPolicesId($id);
$chemin = $this->menuvue->getChemin('Ficheclient');
$this->genererVue(array('client' => $client, 'polices' => $polices, 'chemin' => $chemin,
'modepaiement' => $this->modepaiement));
}
public function supprimer() {
$id = $_SESSION['idClientAjax'];
if($this->client->supprimer($id))
{
$this->rediriger("Listeclients");
}
else
{
$this->rediriger("Ficheclient");
}
}
}