38 lines
1.3 KiB
PHP
Executable File
38 lines
1.3 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Tabmoyenpaiement.php';
|
|
|
|
class ControleurAjaxtbajoutermoyenpaiement extends Controleur {
|
|
private $paiement;
|
|
|
|
public function __construct() {
|
|
$this->paiement = new Tabmoyenpaiement();
|
|
}
|
|
|
|
public function index() {
|
|
$typepaiement = $this->paiement->getTypepaiement();
|
|
|
|
$this->genererVueAjax(array(
|
|
'typepaiement' => $typepaiement
|
|
));
|
|
}
|
|
|
|
public function ajouter(){
|
|
$codeMoyenPaiement = strtoupper($this->requete->getParametreFormulaire("codeMoyenPaiement"));
|
|
|
|
if (!$this->paiement->existeligne($codeMoyenPaiement)){
|
|
$libelle = strtoupper($this->requete->getParametreFormulaire("libelle"));
|
|
$codeTypePaiement = $this->requete->getParametreFormulaire("codeTypePaiement");
|
|
$numeroCompte = strtoupper($this->requete->getParametreFormulaire("numeroCompte"));
|
|
|
|
$this->paiement->ajoutermoyenpaiement($codeMoyenPaiement,$libelle,$codeTypePaiement,$numeroCompte);
|
|
}else{
|
|
echo 'Erreur: Le code saisi existe déjà! Veuillez entrer un autre./Error : The code entered already exists! Please enter another.';
|
|
die();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|