Import initial du projet Production
This commit is contained in:
33
Controleur/ControleurAjaxtbajouterpays.php
Normal file
33
Controleur/ControleurAjaxtbajouterpays.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Tabpays.php';
|
||||
|
||||
class ControleurAjaxtbajouterpays extends Controleur {
|
||||
private $pays;
|
||||
|
||||
public function __construct() {
|
||||
$this->pays = new Tabpays();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
|
||||
$this->genererVueAjax();
|
||||
}
|
||||
|
||||
public function ajouter(){
|
||||
$codePays = strtoupper($this->requete->getParametreFormulaire("codePays"));
|
||||
|
||||
if (!$this->pays->existeligne($codePays)){
|
||||
$libelle = strtoupper($this->requete->getParametreFormulaire("libelle"));
|
||||
|
||||
$this->pays->ajouterpays($codePays,$libelle);
|
||||
}else{
|
||||
echo 'Erreur: Le code saisi existe déjà! Veuillez entrer un autre./Error : The code entered already exists! Please enter another.';
|
||||
die();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user