prestation/Controleur/ControleurAjaxlisteprestataires.php
2025-12-01 18:54:33 +00:00

70 lines
2.4 KiB
PHP

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Prestataire.php';
class ControleurAjaxlisteprestataires extends Controleur {
private $prestataire;
public function __construct() {
$this->prestataire = new Prestataire();
}
public function index($nomsearch="")
{
if ($this->requete->existeParametre("valid"))
{
$nomsearch = $this->requete->getParametreFormulaire("nomsearch");
$codePrestataire = $this->requete->getParametreFormulaire("codesearch");
$_SESSION['codePrestataire_C'] = $codePrestataire;
$prestataires_pop = $this->prestataire->getprestatairelike($codePrestataire, $nomsearch);
}
else
{
$prestataires_pop = $this->prestataire->getprestatairesvide();
}
$this->genererVueAjax(array('prestataires_pop' => $prestataires_pop, 'nomsearch' => $nomsearch, 'codePrestataire' => $codePrestataire));
}
public function getlistepypeprestatairelike($nomsearch="")
{
if ($this->requete->existeParametre("valid"))
{
$nomsearch = $this->requete->getParametreFormulaire("nomsearch");
$codePrestataire = $this->requete->getParametreFormulaire("codesearch");
$codeTypePrestataire = $this->requete->getParametreFormulaire("codeTypePrestataire");
// echo "nomsearch=$nomsearch ; codePrestataire=$codePrestataire ; codeTypePrestataire=$codeTypePrestataire";
// exit();
$_SESSION['codePrestataire_C'] = $codePrestataire;
$prestataires_pop = $this->prestataire->getlistepypeprestatairelike($codePrestataire, $nomsearch, $codeTypePrestataire);
}
else
{
$prestataires_pop = $this->prestataire->getprestatairesvide();
}
$this->genererVueAjax(array('prestataires_pop' => $prestataires_pop, 'nomsearch' => $nomsearch, 'codePrestataire' => $codePrestataire));
}
public function getlisteprestatairerbcl($nomsearch="")
{
if ($this->requete->existeParametre("valid"))
{
$nomsearch = $this->requete->getParametreFormulaire("nomsearch");
$codePrestataire = $this->requete->getParametreFormulaire("codesearch");
$_SESSION['codePrestataire_C'] = $codePrestataire;
$prestataires_pop = $this->prestataire->getprestatairelike($codePrestataire, $nomsearch);
}
else
{
$prestataires_pop = $this->prestataire->getprestatairesvide();
}
$this->genererVueAjax(array('prestataires_pop' => $prestataires_pop, 'nomsearch' => $nomsearch));
}
}