modification controller

This commit is contained in:
Damien LASSERRE 2012-01-30 09:06:55 +00:00
parent 1c4eda048c
commit 731947589c
3 changed files with 87 additions and 73 deletions

View File

@ -65,6 +65,7 @@ class ArborescenceController extends Zend_Controller_Action
$sessionCiblage = new SessionCiblage(); $sessionCiblage = new SessionCiblage();
$val = $sessionCiblage->getCritere($key); $val = $sessionCiblage->getCritere($key);
$valuesChecked = array(); $valuesChecked = array();
$valuesUndetermined = array(); $valuesUndetermined = array();
if ($val != null){ if ($val != null){
$valuesChecked = explode(',',$val); $valuesChecked = explode(',',$val);
@ -139,6 +140,7 @@ class ArborescenceController extends Zend_Controller_Action
require_once 'Scores/SessionCiblage.php'; require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage(); $session = new SessionCiblage();
$val = $session->getCritere('adr_cp'); $val = $session->getCritere('adr_cp');
$valuesCheckeds = explode(',', $val); $valuesCheckeds = explode(',', $val);
if(count($valuesCheckeds) > 0) { if(count($valuesCheckeds) > 0) {
for($i=0;count($valuesCheckeds) > $i;$i++) { for($i=0;count($valuesCheckeds) > $i;$i++) {
@ -213,6 +215,7 @@ class ArborescenceController extends Zend_Controller_Action
$val = $session->getCritere('adr_cp'); $val = $session->getCritere('adr_cp');
$valuesCheckeds = array(); $valuesCheckeds = array();
$valuesUndetermined = array(); $valuesUndetermined = array();
if($val != null) if($val != null)
{ {
$values = explode(',', $val); $values = explode(',', $val);
@ -255,7 +258,8 @@ class ArborescenceController extends Zend_Controller_Action
$departementTab[] = $structure; $departementTab[] = $structure;
} }
echo json_encode($departementTab); echo json_encode($departementTab);
} else if($id[0] == 'D') { } else if ($id[0] == 'D')
{
require_once 'Scores/SessionCiblage.php'; require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage(); $session = new SessionCiblage();
$val = $session->getCritere('adr_cp'); $val = $session->getCritere('adr_cp');
@ -263,7 +267,6 @@ class ArborescenceController extends Zend_Controller_Action
if($val != null) if($val != null)
{ {
$values = explode(',', $val); $values = explode(',', $val);
//print_r($values);
foreach($values as $valuesChecked) { foreach($values as $valuesChecked) {
if(strlen($valuesChecked) == 5) { if(strlen($valuesChecked) == 5) {
$valuesCheckeds[] = $valuesChecked; $valuesCheckeds[] = $valuesChecked;
@ -277,7 +280,7 @@ class ArborescenceController extends Zend_Controller_Action
$valuesCheckeds[] = $result['Codepos']; $valuesCheckeds[] = $result['Codepos'];
} }
} else if (substr($valuesChecked, 0, 1) == 'R') { } else if (substr($valuesChecked, 0, 1) == 'R') {
$Departements= new Application_Model_Departements(); $Departements = new Application_Model_Departements();
$sql = $Departements->select()->from('departements', array('numdep'))->where('codeRegionInsee = ?', substr($valuesChecked, 1)); $sql = $Departements->select()->from('departements', array('numdep'))->where('codeRegionInsee = ?', substr($valuesChecked, 1));
$results = $Departements->fetchAll($sql)->toArray(); $results = $Departements->fetchAll($sql)->toArray();
foreach($results as $result) { foreach($results as $result) {
@ -319,7 +322,7 @@ class ArborescenceController extends Zend_Controller_Action
*/ */
public function juridqueAction() public function juridqueAction()
{ {
$valeurs = $this>getRequest()->getParam('');
} }

View File

@ -19,14 +19,24 @@ class CriteresController extends Zend_Controller_Action
} }
} }
public function entrepriseAction(){} public function entrepriseAction(){
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
}
public function economiqueAction(){} public function economiqueAction(){
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
}
public function geographiqueAction(){} public function geographiqueAction(){
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
}
public function juridiqueAction(){} public function juridiqueAction(){
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
}
public function financiereAction(){} public function financiereAction(){
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
}
} }

View File

@ -22,11 +22,12 @@ class IndexController extends Zend_Controller_Action
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
$user = $auth->getIdentity(); $user = $auth->getIdentity();
$session = new SessionCiblage();
//Chargement de la structure des champs et des préférences utilisateurs //Chargement de la structure des champs et des préférences utilisateurs
require_once 'Scores/Field.php'; require_once 'Scores/Field.php';
$fields = new Fields($user->username); $fields = new Fields($user->username);
$this->view->fields = $fields; $this->view->fields = $fields;
$this->view->criteres = $session->getCriteres();
} }
public function resetAction() public function resetAction()