46 lines
2.1 KiB
PHP
Executable File
46 lines
2.1 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Tabcommerciaux.php';
|
|
|
|
class ControleurAjaxtbajoutercommerciaux extends Controleur {
|
|
private $commer;
|
|
|
|
public function __construct() {
|
|
$this->commer = new Tabcommerciaux();
|
|
}
|
|
|
|
public function index() {
|
|
$bureau = $this->commer->getBureaucommerciaux();
|
|
$typeapp = $this->commer->getTypecommerciaux();
|
|
|
|
$this->genererVueAjax(array(
|
|
'bureau' => $bureau,
|
|
'typeapp' => $typeapp
|
|
));
|
|
}
|
|
|
|
public function ajouter(){
|
|
$codeApporteur = strtoupper($this->requete->getParametreFormulaire("codeApporteur"));
|
|
|
|
if (!$this->commer->existeligne($codeApporteur)){
|
|
$codeTypeApporteur = strtoupper($this->requete->getParametreFormulaire("codeTypeApporteur"));
|
|
$libelle = strtoupper($this->requete->getParametreFormulaire("libelle"));
|
|
$nomResponsable = strtoupper($this->requete->getParametreFormulaire("nomResponsable"));
|
|
$telephone = $this->requete->getParametreFormulaire("telephone");
|
|
$email = $this->requete->getParametreFormulaire("email");
|
|
$codeBureau = $this->requete->getParametreFormulaire("codeBureau");
|
|
$deduireComm = $this->requete->getParametreFormulaire("deduireComm");
|
|
$adressePost = strtoupper($this->requete->getParametreFormulaire("adressePost"));
|
|
$adresseGeo = strtoupper($this->requete->getParametreFormulaire("adresseGeo"));
|
|
$typeSysteme = $this->requete->getParametreFormulaire("typeSysteme");
|
|
|
|
$this->commer->ajoutercommerciaux($codeApporteur,$codeTypeApporteur,$libelle,$telephone,$email,$adresseGeo,
|
|
$adressePost,$nomResponsable,$codeBureau,$deduireComm,$typeSysteme);
|
|
}else{
|
|
echo 'Erreur: Le code saisi existe déjà! Veuillez entrer un autre./Error : The code entered already exists! Please enter another.';
|
|
die();
|
|
}
|
|
}
|
|
}
|
|
|
|
|