Import initial du projet prestation
This commit is contained in:
53
Controleur/ControleurAjaxtbajouterpointvente.php
Normal file
53
Controleur/ControleurAjaxtbajouterpointvente.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Tabpointvente.php';
|
||||
require_once 'Modele/Tablocalite.php';
|
||||
|
||||
class ControleurAjaxtbajouterpointvente extends Controleur {
|
||||
private $pv;
|
||||
private $loc;
|
||||
|
||||
public function __construct() {
|
||||
$this->pv = new Tabpointvente();
|
||||
$this->loc = new Tablocalite();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$typepv = $this->pv->gettypepointvente();
|
||||
$pays = $this->loc->getpayslocalite();
|
||||
$ville = array();
|
||||
$localite = array();
|
||||
|
||||
$this->genererVueAjax(array(
|
||||
'typepointvente' => $typepv,
|
||||
'pays' => $pays,
|
||||
'ville' => $ville,
|
||||
'localite' => $localite,
|
||||
));
|
||||
}
|
||||
|
||||
public function ajouter(){
|
||||
$codePointVente = strtoupper($this->requete->getParametreFormulaire("codePointVente"));
|
||||
|
||||
if (!$this->pv->existeligne($codePointVente)){
|
||||
$libelle = strtoupper($this->requete->getParametreFormulaire("libelle"));
|
||||
$codeTypePointVente = strtoupper($this->requete->getParametreFormulaire("codeTypePointVente"));
|
||||
$adresseGeo = $this->requete->getParametreFormulaire("adresseGeo");
|
||||
$adressePost = $this->requete->getParametreFormulaire("adressePost");
|
||||
$telephone = $this->requete->getParametreFormulaire("telephone");
|
||||
$fax = $this->requete->getParametreFormulaire("fax");
|
||||
$email = $this->requete->getParametreFormulaire("email");
|
||||
$codePays = strtoupper($this->requete->getParametreFormulaire("codePays"));
|
||||
$codeVille = strtoupper($this->requete->getParametreFormulaire("codeVille"));
|
||||
$codeLocalite = strtoupper($this->requete->getParametreFormulaire("codeLocalite"));
|
||||
|
||||
$this->pv->ajouterpointvente($codePointVente,$libelle,$codeTypePointVente,$adresseGeo,
|
||||
$adressePost,$telephone,$fax,$email,$codePays,$codeVille,$codeLocalite);
|
||||
}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