prestation/Controleur/ControleurAjaxlisteconsommables.php
2025-12-05 10:42:46 +00:00

94 lines
3.2 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Consommable_temp.php';
class ControleurAjaxlisteconsommables extends Controleur {
private $consommable;
public function __construct() {
$this->consommable = new Consommable_temp();
}
public function index($nomConsommable="")
{
$nomConsommable = $this->requete->getParametreFormulaire("nomConsommable");
$consommables = $this->consommable->getconsommablespossibles($nomConsommable);
$this->genererVueAjax(array('consommables' => $consommables));
}
public function ajouterconsommable()
{
$idConsommable = $this->requete->getParametre("idConsommable");
$this->consommable->ajouterconsommable($idConsommable);
}
public function majquantite()
{
$idConsommable = $this->requete->getParametre("idConsommable");
$quantite = $this->requete->getParametreFormulaire("quantite", "numerique");
$this->consommable->majquantite($idConsommable, $quantite);
// $this->genererVueAjax();
}
public function majprix()
{
$idConsommable = $this->requete->getParametre("idConsommable");
$valeurActe = $this->requete->getParametreFormulaire("valeurActe", "numerique");
$this->consommable->majprix($idConsommable, $valeurActe);
// $this->genererVueAjax();
}
public function creerconsommable()
{
$nomConsommable = $this->requete->getParametreFormulaire("libelleconsommable");
$prixconsommable = $this->requete->getParametreFormulaire("prixconsommable", "numerique");
$quantiteconsommable = $this->requete->getParametreFormulaire("quantiteconsommable", "numerique");
$this->consommable->creerconsommable($nomConsommable, $prixconsommable, $quantiteconsommable);
// $this->genererVueAjax();
}
public function retirerconsommabletous()
{
$this->consommable->retirerconsommabletous();
// $this->genererVueAjax();
}
public function retirerconsommable()
{
$idConsommable = $this->requete->getParametreFormulaire("idConsommable");
$this->consommable->retirerconsommable($idConsommable);
// $this->genererVueAjax();
}
public function creerconsommablehospit()
{
$nomConsommable = $this->requete->getParametreFormulaire("libelleconsommable");
$prixconsommable = $this->requete->getParametreFormulaire("prixconsommable", "numerique");
$quantiteconsommable = $this->requete->getParametreFormulaire("quantiteconsommable", "numerique");
$this->consommable->creerconsommablehospit($nomConsommable, $prixconsommable, $quantiteconsommable);
// $this->genererVueAjax();
}
public function creerconsommableproformahospit()
{
$nomConsommable = $this->requete->getParametreFormulaire("libelleconsommable");
$prixconsommable = $this->requete->getParametreFormulaire("prixconsommable", "numerique");
$quantiteconsommable = $this->requete->getParametreFormulaire("quantiteconsommable", "numerique");
$idProforma = $this->requete->getParametreFormulaire("idProforma");
$this->consommable->creerconsommableproformahospit($nomConsommable, $prixconsommable, $quantiteconsommable, $idProforma);
// $this->genererVueAjax();
}
}