1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
   | public function getexpoAction()
{
	try {
		$request = $this->getRequest();
		$refexpo = $this->_getParam('refexpo', 0);
 
 
		$listeexpo = array();
		$liste = array();
		$listeinscription = array();
 
 
		$mapper = new Application_Model_ExpoVueMapper();
		$mapper = new Application_Model_InscriptionVueMapper();
		$mapperf = new Application_Model_FichierMapper();
 
 
		if ($refexpo>0)  { // recheche pour une expo
			$liste = $mapper->fetchForExpo($refexpo);
			if (isset($liste) && count($liste)>0) {
 
 
				foreach($liste as $inscription)
				{
 
					$fichiers = $mapperf->fetchforInscription($inscription->getId()); // les photos du cataogue;
					$listefichiers=array();
					if (isset($fichiers) && count($fichiers)>0) {
						foreach ($fichiers as $fichier) {
							$listefichiers[]='/photos/'.$fichier->getFilename();
						}
					}
					$listeinscription[]  = array ("idartisan"=>$inscription->getId() ,
							'refpersonne'=>$inscription->getRefpersonne(),
							"nom"=>$inscription->getNom(),
							"prenom"=>utf8_encode(ucfirst(mb_strtolower($inscription->getPrenom()))),
							"denomination"=>ucfirst(strtolower($inscription->getNomcatalogue())),
							"marque"=>$inscription->getMarque(),
							"adresse1"=>$inscription->getAdresse1(),
							"adresse2"=>$inscription->getAdresse2(),
							"adresse3"=>$inscription->getAdresse3(),
							"cp"=>$inscription->getCp(),
							"ville"=>$inscription->getVille(),
							"pays"=>$inscription->getPaysLibelle(),
							"email"=>$inscription->getEmail(),
							"site"=>$inscription->getUrl(),
							"tel"=>$inscription->getTelephone(),
							"fichiers"=>array($listefichiers),
					);
 
				}
			}
 
 
 
 
			if ($refexpo>0) {
				$expo = $mapper->find($refexpo);
 
				if (isset($expo) && $expo->getId()==$refexpo) {	
					$listeexpo = array ("idexpo" => $expo->getId() , "manifestation" => ucfirst(strtolower($expo->getManifestation())), "expo"=>ucfirst(strtolower($expo->getTitre())),"debut"=>$expo->getDatedebut(),"fin"=>$expo->getDatefin(),"lieu"=>ucfirst(strtolower($expo->getLieu())),"nomresp"=>($expo->getPrenom()." ".$expo->getNom()),"telresp"=>$expo->getTelexpo(), "artisans"=>$listeinscription);
				}
			}
		} else {
			$listeexpo = array ("vide");
		}
 
		$this->_helper->layout->disableLayout();
		$this->_helper->viewRenderer->setNoRender(true);
		$response = $this->getResponse();
		$response->setHeader('Content-type', 'application/json', true);
		return $response->setBody(Zend_Json::encode($listeexpo));
		exit;
 
 
 
 
	} catch (Exception $e) {
		Zend_Registry::get("logger")->error(get_class($this)." (". __LINE__.") : ".$e->getMessage());
		$this->_flashMessenger->addError('erreur.erreur');
		$this->_helper->json("");
	}
 
} |