221 lines
7.0 KiB
PHP
Executable File
221 lines
7.0 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Messagerie.php';
|
|
require_once 'Modele/Typedestinatairesms.php';
|
|
require_once 'Modele/Pays.php';
|
|
require_once 'Modele/Ville.php';
|
|
require_once 'Modele/Localite.php';
|
|
|
|
class ControleurAjaxdestinatairesms extends Controleur {
|
|
private $messagerie;
|
|
private $typedestinatairesms;
|
|
|
|
private $pays;
|
|
private $ville;
|
|
private $localite;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->messagerie = new Messagerie();
|
|
$this->pays = new Pays();
|
|
$this->ville = new Ville();
|
|
$this->localite = new Localite();
|
|
$this->typedestinatairesms = new Typedestinatairesms();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$destinataire_selections = $this->messagerie->getdestinatairesselectionnes();
|
|
|
|
$destinataire_non_selections = $this->messagerie->getdestinatairesnonselectionnes();
|
|
|
|
$this->genererVueAjax(array('destinataire_selections' => $destinataire_selections, 'destinataire_non_selections' => $destinataire_non_selections));
|
|
}
|
|
|
|
public function init()
|
|
{
|
|
$codeTypeDestinataire = $this->requete->getParametreFormulaire("codeTypeDestinataire");
|
|
|
|
$this->messagerie->initenvoisms($codeTypeDestinataire);
|
|
|
|
$destinataire_selections = $this->messagerie->getdestinatairesselectionnes();
|
|
|
|
$destinataire_non_selections = $this->messagerie->getdestinatairesnonselectionnes();
|
|
|
|
$this->genererVueAjax(array('destinataire_selections' => $destinataire_selections, 'destinataire_non_selections' => $destinataire_non_selections));
|
|
}
|
|
|
|
public function libre()
|
|
{
|
|
$this->genererVueAjax();
|
|
}
|
|
|
|
public function adherent()
|
|
{
|
|
$typedestinatairesms = $this->typedestinatairesms->getListeAdhrent();
|
|
|
|
$this->genererVueAjax(array('typedestinatairesms' => $typedestinatairesms));
|
|
}
|
|
|
|
public function adherentclient()
|
|
{
|
|
$this->genererVueAjax();
|
|
}
|
|
|
|
public function ajouterprestaire()
|
|
{
|
|
$idPrestataire = $this->requete->getParametreFormulaire("idPrestataire");
|
|
|
|
$this->messagerie->ajouterprestaire($idPrestataire);
|
|
}
|
|
|
|
public function retirerprestaire()
|
|
{
|
|
$idPrestataire = $this->requete->getParametreFormulaire("idPrestataire");
|
|
|
|
$this->messagerie->retirerprestaire($idPrestataire);
|
|
}
|
|
|
|
public function ajouterdestinatairesmstous()
|
|
{
|
|
$this->messagerie->ajouterdestinatairesmstous();
|
|
}
|
|
|
|
public function retirerdestinatairesmstous()
|
|
{
|
|
$this->messagerie->retirerdestinatairesmstous();
|
|
}
|
|
|
|
public function ajouterundestinatairesms()
|
|
{
|
|
$idDestinataire = $this->requete->getParametreFormulaire("idDestinataire");
|
|
|
|
$this->messagerie->ajouterundestinatairesms($idDestinataire);
|
|
}
|
|
|
|
public function retirerundestinatairesms()
|
|
{
|
|
$idDestinataire = $this->requete->getParametreFormulaire("idDestinataire");
|
|
|
|
$this->messagerie->retirerundestinatairesms($idDestinataire);
|
|
}
|
|
|
|
public function mettresmscommeunattente()
|
|
{
|
|
$textMessage = $this->requete->getParametreFormulaire("textMessage");
|
|
|
|
$this->messagerie->mettresmscommeunattente($textMessage);
|
|
}
|
|
|
|
public function mettresmscommeunattentelibre()
|
|
{
|
|
$noDestination = $this->requete->getParametreFormulaire("noDestination");
|
|
$textMessage = $this->requete->getParametreFormulaire("textMessage");
|
|
|
|
$this->messagerie->mettresmscommeunattentelibre($noDestination, $textMessage);
|
|
}
|
|
|
|
public function consulter()
|
|
{
|
|
$date1 = $this->requete->getParametreDate("date1");
|
|
$date2 = $this->requete->getParametreDate("date2");
|
|
|
|
$messages_envoyes = $this->messagerie->getenvoisms($date1, $date2);
|
|
|
|
$messages_en_cours = $this->messagerie->getenvoismsencours($date1, $date2);
|
|
|
|
$this->genererVueAjax(array('messages_envoyes' => $messages_envoyes, 'messages_en_cours' => $messages_en_cours));
|
|
}
|
|
|
|
public function adherentclienliste()
|
|
{
|
|
$nomClientAdherent = $this->requete->getParametreFormulaire("nomClientAdherent");
|
|
|
|
$clients = $this->messagerie->smsrechercheclient($nomClientAdherent);
|
|
|
|
$this->genererVueAjax(array('clients' => $clients));
|
|
}
|
|
|
|
/*
|
|
public function adherentclientafficher()
|
|
{
|
|
$nomClientAdherent = $this->requete->getParametreFormulaire("nomClientAdherent");
|
|
|
|
$this->messagerie->initenvoismsadherentclient($nomClientAdherent);
|
|
}
|
|
*/
|
|
|
|
public function initenvoismsadherentclient()
|
|
{
|
|
$numeroClientAdherent = $this->requete->getParametreFormulaire("numeroClientAdherent");
|
|
|
|
$this->messagerie->initenvoismsadherentclient($numeroClientAdherent);
|
|
}
|
|
|
|
public function adherentlocalite()
|
|
{
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$codePays = $_SESSION['codePaysSociete'];
|
|
$codeVille = "";
|
|
|
|
$pays = $this->pays->getListe($codePays);
|
|
$ville = $this->ville->getListe($codePays);
|
|
$localite = $this->localite->getListe($codePays, $codeVille);
|
|
|
|
$this->genererVueAjax(array('pays' => $pays, 'ville' => $ville, 'listelocalite' => $localite));
|
|
}
|
|
|
|
public function initenvoismsadherentlocalite()
|
|
{
|
|
$codePays = $this->requete->getParametreFormulaire("codePays");
|
|
$codeVille = $this->requete->getParametreFormulaire("codeVille");
|
|
$codeLocalite = $this->requete->getParametreFormulaire("codeLocalite");
|
|
|
|
$this->messagerie->initenvoismsadherentlocalite($codePays, $codeVille ,$codeLocalite);
|
|
}
|
|
|
|
public function adherentclientlocalite()
|
|
{
|
|
$this->genererVueAjax();
|
|
}
|
|
|
|
public function adherentclientlocaliteliste()
|
|
{
|
|
$nomClientAdherent = $this->requete->getParametreFormulaire("nomClientAdherent");
|
|
$clients = $this->messagerie->smsrechercheclient($nomClientAdherent);
|
|
|
|
$codeSociete = $_SESSION['codeSociete'];
|
|
$codePays = $_SESSION['codePaysSociete'];
|
|
$codeVille = "";
|
|
|
|
$pays = $this->pays->getListe($codePays);
|
|
$ville = $this->ville->getListe($codePays);
|
|
$localite = $this->localite->getListe($codePays, $codeVille);
|
|
|
|
$this->genererVueAjax(array('clients' => $clients, 'pays' => $pays, 'ville' => $ville, 'listelocalite' => $localite));
|
|
}
|
|
|
|
public function initenvoismsadherentclientlocalite()
|
|
{
|
|
$numeroClientAdherent = $this->requete->getParametreFormulaire("numeroClientAdherent");
|
|
|
|
$codePays = $this->requete->getParametreFormulaire("codePays");
|
|
$codeVille = $this->requete->getParametreFormulaire("codeVille");
|
|
$codeLocalite = $this->requete->getParametreFormulaire("codeLocalite");
|
|
|
|
$this->messagerie->initenvoismsadherentclientlocalite($numeroClientAdherent, $codePays, $codeVille ,$codeLocalite);
|
|
}
|
|
|
|
public function consulterwhatsapp()
|
|
{
|
|
$date1 = $this->requete->getParametreDate("date1");
|
|
$date2 = $this->requete->getParametreDate("date2");
|
|
|
|
$messages_envoyes = $this->messagerie->getenvoiwhatsapp($date1, $date2);
|
|
|
|
$messages_en_cours = $this->messagerie->getenvoiwhatsappencours($date1, $date2);
|
|
|
|
$this->genererVueAjax(array('messages_envoyes' => $messages_envoyes, 'messages_en_cours' => $messages_en_cours));
|
|
}
|
|
|
|
} |