view->headLink()->appendStylesheet('/themes/default/styles/recherche.css', 'all'); } public function indexAction() { $this->_forward('entreprise'); } public function entrepriseAction() { $this->view->headTitle()->append('Recherche Entreprise'); //@todo : champs definis avec les valeurs en sessions ou en get, post require_once 'Web/Forms/RechercheEntreprise.php'; $form = new Form_RechercheEntreprise(); $this->view->form = $form; } public function dirigeantAction() { $this->view->headTitle()->append('Recherche Dirigeant'); require_once 'Web/Forms/RechercheDirigeant.php'; $form = new Form_RechercheDirigeant(); $this->view->assign('form', $form); } public function annonceAction() { $this->view->headTitle()->append('Recherche Annonce'); } public function internationaleAction(){} public function lastAction() { $this->view->headTitle()->append('Liste des dernières recherches'); } public function enqueteAction() { $this->view->headTitle()->append('Enquête'); require_once 'Scores/Utilisateur.php'; $user = new Utilisateur(); if (!$user->checkPerm('INVESTIG')){ $this->renderScript('error/error-perms.phtml'); } $request = $this->getRequest(); if ($request->isPost()){ //Erreur pas d'adresse email //Ok - email envoyé //Ok - email non envoyé } //Affichage formulaire require_once 'Web/Forms/RechercheEnquete.php'; require_once 'Scores/Utilisateur.php'; $form = new Form_RechercheEnquete(); $user = new Utilisateur(); $data = array( 'email' => $user->getEmail(), ); $form->populate($data); $this->view->assign('form', $form); } public function listeAction() { $request = $this->getRequest(); $params = $request->getParams(); //Giant $pays = $request->getParam('pays', ''); if( !empty($pays) ) $this->_forward('search', 'giant'); $type = $request->getParam('type'); //Criteres recherche entreprise if ($type=='ent'){ $criteres = array(); $criteres['identifiant'] = $request->getParam('siret'); $criteres['raisonSociale'] = $request->getParam('raisonSociale'); $criteres['adresse'] = ''; $criteres['codePostal']= ''; $criteres['ville'] = ''; $criteres['telFax'] = $request->getParam('telFax'); $criteres['naf'] = ''; $criteres['siege'] = false; $criteres['actif'] = false; //Criteres recherche dirigeants } else if ($type=='dir') { } require_once 'Scores/WsScores.php'; $ws = new WsScores(); //@todo : Set position $reponse = $ws->rechercheEntreprise($type, $criteres, 0); if ($reponse !== false) { $etabs = $reponse->results->reponses->item; $criteresTexte = ''; //@todo : selection des critères à afficher foreach ($reponse->results->criteres as $value){ if (!empty($value)) $criteresTexte.= $value.' '; } $criteresTexte = trim($criteresTexte); $criteresLien = $this->view->url($params); $info = $reponse->results->info; $nbReponses = $reponse->results->nbReponses; $nbReponsesTotal = $reponse->results->nbReponsesTotal; if ($nbReponses < $nbReponsesTotal) { $position = 0; $totPage = ceil($nbReponsesTotal/$nbReponses); $curPage = ceil($position/$nbReponses)+1; } else { $totPage = $curPage = 1; } $liste = array(); foreach($etabs as $i => $etab) { $item = array(); $item['position'] = (($curPage-1)*$nbReponses)+$i+1; $item['id'] = $etab->id; $item['siren'] = $etab->Siren; $item['siret'] = $etab->Siren.$etab->Nic; $item['InfoSiret'] = $etab->Siren.' '.$etab->Nic; $item['InfoNom'] = $etab->Nom; $nomDetail = ''; if ($etab->Nom2<>'' || $etab->Enseigne<>'' || $etab->Sigle<>'') { $nomDetail.= ''; if ($etab->Nom2!='') $nomDetail.= $etab->Nom2.'
'; if ($etab->Enseigne<>'') $nomDetail.= 'Enseigne : '.$etab->Enseigne.'    '; if ($etab->Sigle<>'') $nomDetail.= 'Sigle : '.$etab->Sigle; $nomDetail.= '

'; } $item['InfoNomDetail'] = $nomDetail; $item['InfoSiret'] = substr($etab->Siren,0,3).' '. substr($etab->Siren,3,3).' '. substr($etab->Siren,6,3).' '. $etab->Nic; $infoEtab = ''; if ($etab->Siege==1){ $infoEtab.= 'Établissement siège '; } else { $infoEtab.= 'Établissement secondaire '; } if ($etab->Actif==1){ $infoEtab.= 'actif'; } else { $infoEtab.= 'inactif'; } if (intval($etab->Nic)==0 || intval($item->Nic)>=99990) { $infoEtab.=' provisoire'; } if ($etab->Siege!=1 || ($etab->Siege==1 && $etab->Actif!=1)) { $url = $this->view->url(array( 'controller'=>'identite', 'action'=>'fiche', 'id' => $etab->id, 'siren' => $etab->Siren, )); $infoEtab.= ' (Accès siège)'; } $item['InfoEtab'] = $infoEtab; $adresse = $etab->Adresse.'
'; if (isset($etab->Adresse2) && $etab->Adresse2 != '') { $adresse.= $etab->Adresse2.'
'; } $adresse.= "".$etab->CP." ".$etab->Ville.""; $item['InfoAdresse'] = $adresse; $forme = ''; if (trim($etab->FJ)!='') { $forme = 'Forme : '.$etab->FJLib.' ('.$etab->FJ.')
'; } $item['InfoForme'] = $forme; $activite = ''; if (trim($item->NafEnt)!='') { $activite = 'Activité : '.$item->NafEntLib.' ('.$item->NafEnt.')
'; } $item['InfoActivite'] = $activite; $liste[] = $item; } } require_once 'Scores/Utilisateur.php'; $user = new Utilisateur(); $this->view->assign('blockInvestig', $user->checkPerm('INVESTIG')); if ($type=='dir') { $this->view->assign('blockDirToEntreprise', true); $this->view->assign('searchDirToEntrepriseTxt', trim($critere['nom'].' '.$criteres['prenom'])); $this->view->assign('searchDirToEntrepriseLien', $this->view->url(array( 'action' => 'list', 'type' => 'ent', 'raisonSociale' => trim($critere['nom'].' '.$criteres['prenom']) ))); } else { $this->view->assign('blockDirToEntreprise', false); } $this->view->assign('liste', $liste); $this->view->assign('totPage', $totPage); $this->view->assign('curPage', $curPage); $this->view->assign('nbReponses', $nbReponses); $this->view->assign('nbReponsesTotal', $nbReponsesTotal); $this->view->assign('criteresTexte', $criteresTexte); $this->view->assign('criteresLien', $criteresLien); $this->view->assign('info', $info); } public function ipariAction() { } }