Nouvel Adhérent
This commit is contained in:
23
Controleur/ControleurAjaxproraterprime.php
Normal file
23
Controleur/ControleurAjaxproraterprime.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Adherent_temp.php';
|
||||
|
||||
class ControleurAjaxproraterprime extends Controleur {
|
||||
private $adherent_temp;
|
||||
|
||||
public function __construct() {
|
||||
$this->adherent_temp = new Adherent_temp();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$user = $_SESSION['login'];
|
||||
$idCollege = $this->requete->getParametreFormulaire("idCollege");
|
||||
$prorata = $this->requete->getParametreFormulaire("prorata");
|
||||
$dateEntree = $this->requete->getParametreDate("dateEntree");
|
||||
|
||||
$adherent_temp = $this->adherent_temp->getAdherent_temp($idCollege, $dateEntree, $user, $prorata) ;
|
||||
|
||||
$this->genererVueAjax(array('adherent_temp' => $adherent_temp));
|
||||
}
|
||||
}
|
||||
138
Controleur/ControleurCreeradherent.php
Normal file
138
Controleur/ControleurCreeradherent.php
Normal file
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Adherent.php';
|
||||
require_once 'Modele/Collegepolice.php';
|
||||
require_once 'Modele/Menuvueutilisateur.php';
|
||||
require_once 'Modele/Beneficiaire.php';
|
||||
require_once 'Modele/Naturepiece.php';
|
||||
require_once 'Modele/Sexe.php';
|
||||
require_once 'Modele/Pays.php';
|
||||
require_once 'Modele/Situationfamille.php';
|
||||
require_once 'Modele/Groupesanguin.php';
|
||||
require_once 'Modele/Avenant.php';
|
||||
require_once 'Modele/Ouinon.php';
|
||||
require_once 'Modele/Ville.php';
|
||||
require_once 'Modele/Localite.php';
|
||||
require_once 'Modele/Client.php';
|
||||
|
||||
require_once 'Societes/'.$_SESSION['codeSociete'].'/Tarifs/Modele/Tarif.php';
|
||||
|
||||
class ControleurCreeradherent extends Controleur {
|
||||
private $adherent;
|
||||
private $beneficiaire;
|
||||
private $naturepiece;
|
||||
private $sexe;
|
||||
private $pays;
|
||||
private $situationfamille;
|
||||
private $groupesanguin;
|
||||
private $tarif;
|
||||
private $college;
|
||||
private $avenant;
|
||||
private $ouinon;
|
||||
private $client;
|
||||
private $ville;
|
||||
private $localite;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->menuvue = new Menuvueutilisateur();
|
||||
$this->menuvue->getMenuVue('Creeradherent');
|
||||
|
||||
$this->adherent = new Adherent();
|
||||
$this->beneficiaire = new Beneficiaire();
|
||||
$this->naturepiece = (new Naturepiece())->getListe();
|
||||
$this->sexe = (new Sexe())->getListe();
|
||||
$this->situationfamille = (new Situationfamille())->getListe();
|
||||
// $this->pays = (new Pays())->getListe($_SESSION['codePaysSociete']);
|
||||
$this->pays = new Pays();
|
||||
$this->groupesanguin = (new Groupesanguin())->getListe();
|
||||
$this->tarif = new Tarif();
|
||||
$this->college = (new Collegepolice())->getListe($_SESSION['idPolice_C']);
|
||||
$this->avenant = (new Avenant())->getListeEnCours($_SESSION['idPolice_C']);
|
||||
$this->ouinonprorata = (new Ouinon())->getListe();
|
||||
|
||||
$this->ville = new Ville();
|
||||
$this->localite = new Localite();
|
||||
$this->client = new Client();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$idClient = $_SESSION['idClient_C'];
|
||||
$client = $this->client->getClientId($idClient);
|
||||
|
||||
$codeSociete = $_SESSION['codeSociete'];
|
||||
$codePays = $client['codePays'];
|
||||
$codeVille = $client['codeVille'];
|
||||
$codeLocalite = $client['codeLocalite'];
|
||||
|
||||
$pays = $this->pays->getListe($codePays);
|
||||
$ville = $this->ville->getListe($codePays);
|
||||
$localite = $this->localite->getListe($codePays, $codeVille);
|
||||
|
||||
$idPolice = $_SESSION['idPolice_C'];
|
||||
|
||||
$ville = $this->ville->getListe($codePays);
|
||||
$localite = $this->localite->getListe($codePays, $codeVille);
|
||||
|
||||
$this->genererVue(array('college' => $this->college, 'naturepiece' => $this->naturepiece, 'sexe' => $this->sexe,
|
||||
'pays' => $pays, 'situationfamille' => $this->situationfamille, 'groupesanguin' => $this->groupesanguin,
|
||||
'avenant' => $this->avenant, 'ouinonprorata' => $this->ouinonprorata, 'ville' => $ville, 'localite' => $localite,
|
||||
'codePays' => $codePays, 'codeVille' => $codeVille, 'codeLocalite' => $codeLocalite));
|
||||
}
|
||||
|
||||
public function ajouteradherent()
|
||||
{
|
||||
$idPolice = $_SESSION['idPolice_C'];
|
||||
|
||||
$racineNoAdherent = $this->requete->getSession()->getAttribut('racineNoAdherent');
|
||||
$codeSociete = $this->requete->getSession()->getAttribut('codeSociete');
|
||||
$idCollege = $this->requete->getParametre("idCollege");
|
||||
$idPolice = $this->requete->getParametre("idPolice");
|
||||
$numeroPolice = $this->requete->getParametre("numeroPolice");
|
||||
$nom = $this->requete->getParametre("nom");
|
||||
$prenoms = $this->requete->getParametreFormulaire("prenoms");
|
||||
$codeNaturePiece = $this->requete->getParametre("codeNaturePiece");
|
||||
$numeroPiece = $this->requete->getParametreFormulaire("numeroPiece");
|
||||
$sexe = $this->requete->getParametreFormulaire("sexe");
|
||||
$dateNaissance = $this->requete->getParametreDate("dateNaissance");
|
||||
$codeGroupeSanguin = $this->requete->getParametreFormulaire("codeGroupeSanguin");
|
||||
$codeSituationFamille = $this->requete->getParametreFormulaire("codeSituationFamille");
|
||||
$nombreEnfants = $this->requete->getParametreFormulaire("nombreEnfants");
|
||||
$adresseGeo = $this->requete->getParametreFormulaire("adresseGeo");
|
||||
$adressePostale = $this->requete->getParametreFormulaire("adressePostale");
|
||||
$codePays = $this->requete->getParametre("codePays");
|
||||
$telephonFixe = $this->requete->getParametreFormulaire("telephonFixe");
|
||||
$telephonePortable = $this->requete->getParametreFormulaire("telephonePortable");
|
||||
$email = $this->requete->getParametreFormulaire("email");
|
||||
$dateEntree = $this->requete->getParametreDate("dateEntree");
|
||||
$idAvenant = $this->requete->getParametre("idAvenant");
|
||||
|
||||
$codeLocalite = $this->requete->getParametre("codeLocalite");
|
||||
|
||||
$user = $this->requete->getSession()->getAttribut('login');
|
||||
$dateCre = date("Y-m-d");
|
||||
|
||||
$nom = strtoupper($nom);
|
||||
$prenoms = ucwords($prenoms);
|
||||
|
||||
$dernierIdAdherent = $this->adherent->ajouteradherent($idPolice, $idCollege, $nom, $prenoms, $codeNaturePiece, $numeroPiece, $sexe,
|
||||
$dateNaissance, $codeGroupeSanguin, $codeSituationFamille, $nombreEnfants, $adresseGeo, $adressePostale,
|
||||
$codePays, $telephonFixe, $telephonePortable, $email, $dateEntree, $user, $idAvenant, $codeLocalite) ;
|
||||
|
||||
$idBeneficiaire = $this->beneficiaire->ajouterAdherent($dernierIdAdherent);
|
||||
|
||||
// On va calculuer la prime
|
||||
$codeLienParente = "A";
|
||||
$idAdherent = $dernierIdAdherent;
|
||||
$_SESSION['idAdherent_C'] = $idAdherent;
|
||||
$_SESSION['idBeneficiaire_C'] = $idBeneficiaire;
|
||||
|
||||
// On actualise le contexte : NbAdh et NbAss
|
||||
$idPolice = $_SESSION['idPolice_C'];
|
||||
$this->adherent->getNbassure($idPolice);
|
||||
|
||||
$this->rediriger("Ficheadherent/".$idAdherent);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user