From 6a34fa7c35187eccc35e8d93a52c988c386040b1 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Mon, 19 Dec 2011 09:44:31 +0000 Subject: [PATCH] =?UTF-8?q?Modification=20du=20CSS=20+=20cr=C3=A9ation=20d?= =?UTF-8?q?'un=20div=20de=20protection=20d'envoi=20de=20multi=20requete=20?= =?UTF-8?q?a=20sphinx.=20+=20modification=20des=20crit=C3=A9res?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/CriteresController.php | 7 +-- application/controllers/IndexController.php | 45 +++++++++++++++++-- .../default/scripts/index/criteres.phtml | 33 +++++--------- .../views/default/scripts/index/index.phtml | 4 +- application/views/default/scripts/main.phtml | 1 + public/themes/default/scripts/scripts.js | 8 ++-- public/themes/default/styles/main.css | 22 ++++++++- 7 files changed, 82 insertions(+), 38 deletions(-) diff --git a/application/controllers/CriteresController.php b/application/controllers/CriteresController.php index 6e8d2a14..27c79c6d 100644 --- a/application/controllers/CriteresController.php +++ b/application/controllers/CriteresController.php @@ -14,7 +14,6 @@ class CriteresController extends Zend_Controller_Action public function entrepriseAction() { - //$this->_helper->layout()->disableLayout(); $champs = array(array('name' => 'siege', 'libelle' => 'Siège', 'type' => 'select', 'parametres' => array('Etablissement' => '0', 'Siege' => '1')), array('name' => 'sirenGrp', 'libelle' => 'Siren de groupe', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')), array('name' => 'tel', 'libelle' => 'Téléphone', 'type' => 'select', 'parametres' => array('Oui' => 1, 'Non' => '0')), @@ -46,7 +45,7 @@ class CriteresController extends Zend_Controller_Action array('name' => 'NaceEtab', 'libelle' => 'Code NACE de l\'établissement', 'type' => 'text'), array('name' => 'ou'), array('name' => 'NaceEtab', 'libelle' => 'Liste Code NACE de l\'établissement', 'type' => 'textarea'), - array('name' => 'NaceEtab', 'libelle' => 'Code NACE de l\'établissement', 'type' => 'text'), + array('name' => 'NaceEntrep', 'libelle' => 'Code NACE de l\'entreprise', 'type' => 'text'), array('name' => 'ou'), array('name' => 'NaceEntrep', 'libelle' => 'Liste Code NACE de l\'entreprise', 'type' => 'textarea'), array('name' => 'age_etab', 'libelle' => 'Code AGE Etablissement', 'type' => 'text'), @@ -110,10 +109,6 @@ class CriteresController extends Zend_Controller_Action array('name' => 'adr_com', 'libelle' => 'Liste Code commune Insee', 'type' => 'textarea'), ); $this->view->champs = $champs; - /*$regionsM = new Application_Model_Regions(); - //$sql = $regionsM->select(); - $this->view->assign('regions', $regionsM->fetchAll()->toArray());*/ - } public function juridiqueAction() diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php index 278b3cdf..1b57cb0c 100644 --- a/application/controllers/IndexController.php +++ b/application/controllers/IndexController.php @@ -1,6 +1,12 @@ ciblage); - $this->view->count = (($nbCriteres == 0)?0:($nbCriteres - 2)); - $this->view->entreprise = $session->ciblage; + + foreach($session->ciblage as $item => $valeur) { + if (in_array($item, $this->entreprise)) + $entreprise[$item] = $valeur; + else if (in_array($item, $this->economique)) + $economique[$item] = $valeur; + else if (in_array($item, $this->geographique)) + $geographique[$item] = $valeur; + else if (in_array($item, $this->financier)) + $financier[$item] = $valeur; + else if (in_array($item, $this->juridique)) + $juridique[$item] = $valeur; + } + $nbCriteres = count($entreprise); + $Count['entreprise'] = $nbCriteres; + $nbCriteres = count($geographique); + $Count['geographique'] = $nbCriteres; + $nbCriteres = count($juridique); + $Count['juridique'] = $nbCriteres; + $nbCriteres = count($financier); + $Count['financier'] = $nbCriteres; + $nbCriteres = count($economique); + $Count['economique'] = $nbCriteres; + + $this->view->Count = $Count; + $this->view->entreprise = $entreprise; + $this->view->geographique = $geographique; + $this->view->economique = $economique; + $this->view->juridique = $juridique; + $this->view->financier = $financier; } } diff --git a/application/views/default/scripts/index/criteres.phtml b/application/views/default/scripts/index/criteres.phtml index 06e5e4cd..1aa53bcf 100644 --- a/application/views/default/scripts/index/criteres.phtml +++ b/application/views/default/scripts/index/criteres.phtml @@ -1,26 +1,17 @@ -

Entreprise - Nombre de critéres : count; ?>

+ 'Entreprise', + 'economique' => 'Situation economique', + 'geographique' => 'Secteur géographique', + 'juridique' => 'Situation juridique', + 'financier' => 'Situation financiére'); +?> + $name): ?> +

Nombre de critéres : Count[$variable]; ?>

- entreprise as $item => $valeur): ?> - + $variable as $item => $valeur): ?> '.$item.' : '.(($valeur=='0' or $valeur == '1')?(($valeur=='0')?'Non':'Oui'):str_replace(',', ' à ', ((is_array($valeur))?implode(' à ', $valeur):$valeur))); ?> -
- +

-

Situation economique

-
-

-
-

Secteur géographique

-
-

-
-

Situation juridique

-
-

-
-

Situation financiére

-
-

-
\ No newline at end of file + \ No newline at end of file diff --git a/application/views/default/scripts/index/index.phtml b/application/views/default/scripts/index/index.phtml index 5ee3868e..83dc946c 100644 --- a/application/views/default/scripts/index/index.phtml +++ b/application/views/default/scripts/index/index.phtml @@ -16,13 +16,13 @@

Résultats

-
+
Nombre sélectionnées : total))?$this->total:'-');?>
(dont insee))?$this->insee:'-');?> unité(s) insee)
-
layout()->content; ?> +