41 lines
1.5 KiB
PHP
41 lines
1.5 KiB
PHP
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Tarifsactes.php';
|
|
require_once 'Modele/Ouinon.php';
|
|
|
|
class ControleurAjaxmodifiertypetarifacte extends Controleur {
|
|
private $type;
|
|
|
|
public function __construct() {
|
|
$this->type = new Tarifsactes();
|
|
$this->ouinonappliquepardefaut = (new Ouinon())->getListe();
|
|
}
|
|
|
|
public function index(){
|
|
$id = $this->requete->getParametreFormulaire("id");
|
|
$typestarif = $this->type->getTypeTarifId($id);
|
|
|
|
$this->genererVueAjax(array(
|
|
'typestarif' => $typestarif,
|
|
'ouinonappliquepardefaut' => $this->ouinonappliquepardefaut
|
|
));
|
|
}
|
|
|
|
public function enregistrer(){
|
|
$id = $this->requete->getParametreFormulaire("id");
|
|
$codeTypeTarifActe = strtoupper($this->requete->getParametreFormulaire("codeTypeTarifActe"));
|
|
$libelle = strtoupper($this->requete->getParametreFormulaire("libelle"));
|
|
$libelleEng = strtoupper($this->requete->getParametreFormulaire("libelleEng"));
|
|
$description = strtoupper($this->requete->getParametreFormulaire("description"));
|
|
$descriptionEng = strtoupper($this->requete->getParametreFormulaire("descriptionEng"));
|
|
|
|
if(empty($codeTypeTarifActe) && empty($libelle)){
|
|
die();
|
|
}
|
|
|
|
$this->type->modifierTypeTarif($codeTypeTarifActe,$libelle,$libelleEng,$description,$descriptionEng,$id);
|
|
|
|
}
|
|
}
|
|
|
|
|