47 lines
1.6 KiB
PHP
Executable File
47 lines
1.6 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);
|
|
}
|
|
|
|
public function majprix()
|
|
{
|
|
$idConsommable = $this->requete->getParametre("idConsommable");
|
|
$valeurActe = $this->requete->getParametreFormulaire("valeurActe", "numerique");
|
|
$this->consommable->majprix($idConsommable, $valeurActe);
|
|
}
|
|
|
|
public function creerconsommable()
|
|
{
|
|
$nomConsommable = $this->requete->getParametreFormulaire("libelleconsommable");
|
|
$prixconsommable = $this->requete->getParametreFormulaire("prixconsommable", "numerique");
|
|
|
|
// $consommables = $this->consommable->creerconsommable($nomConsommable, $prixconsommable);
|
|
$this->consommable->creerconsommable($nomConsommable, $prixconsommable);
|
|
}
|
|
} |