Modification

This commit is contained in:
Michael RICOIS 2011-12-29 21:06:17 +00:00
parent 05c9aa875c
commit 30578cd087
2 changed files with 39 additions and 20 deletions

View File

@ -5,7 +5,13 @@ class ComptageController extends Zend_Controller_Action
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$explode = array('dateCrea_etab', 'dateCrea_ent', 'dateImmat', 'nbEtab', 'teff_entrep', 'teff_etab',
/*
* @todo : Créer une classe pour gérer les champs, leurs paramètres, les options
* et les sortir de la session
*
*/
$explode = array(
'dateCrea_etab', 'dateCrea_ent', 'dateImmat', 'nbEtab', 'teff_entrep', 'teff_etab',
'teff_entrep', 'teff_etab', 'eff_etab', 'eff_entrep', 'adr_dep', 'adr_cp', 'nbMPubli',
'nbPart', 'nbActio', 'capital', 'bilAnnee', 'bilCloture', 'bilEE', 'bilFL', 'bilFK',
'bilFR', 'bilGF', 'bilGP', 'bilGU', 'bilGW', 'bilHD', 'bilHH', 'bilHL', 'bilHM', 'bilHN', 'bilYP', 'adr_com'
@ -29,8 +35,8 @@ class ComptageController extends Zend_Controller_Action
$total = $ciblage->execute();
$insee = $ciblage->calculeRedevanceInsee();
$session->setCritere('total', $total);
$session->setCritere('insee', $insee);
$session->setNb('total', $total);
$session->setNb('insee', $insee);
//Retour comptage, unité Insee
$result = array(
@ -51,16 +57,9 @@ class ComptageController extends Zend_Controller_Action
$criteres = $session->getCriteres();
$resultat = '';
$nbInsee = '';
}

View File

@ -1,23 +1,31 @@
<?php
class SessionCiblage
{
protected $criteres = array('nbMPubli' , 'dirNom', 'lieuAct', 'adrDom','total', 'insee', 'siege', 'adr_cp', 'adr_dep', 'adr_com', 'tel', 'fax', 'cj', 'capital', 'ape_etab', 'ape_entrep', 'age_entrep',
protected $criteres = array(
'nbMPubli' , 'dirNom', 'lieuAct', 'adrDom', 'siege', 'adr_cp', 'adr_dep', 'adr_com', 'tel', 'fax', 'cj', 'capital', 'ape_etab', 'ape_entrep', 'age_entrep',
'age_etab', 'tcaexp', 'teff_entrep', 'teff_etab', 'rang', 'actifEco', 'presentRcs', 'procolHisto', 'tvaIntraValide',
'NaceEtab', 'NaceEntrep', 'dateCrea_etab', 'dateCrea_ent', 'dateImmat', 'eff_entrep', 'eff_etab', 'rivoli', 'nbEtab',
'sirenGrp', 'nbActio', 'nbPart', 'bilType', 'bilAnnee', 'avisCs', 'bilTca', 'bilEE', 'bilFL', 'bilFK', 'bilFR', 'bilGF', 'bilGP',
'bilGU', 'bilGW', 'bilHD', 'bilHL', 'bilHM', 'bilHN', 'bilYP', 'bilFS', 'bilGG', 'bilGV', 'bilHI'
);
protected $valeur;
protected $total = null;
protected $insee = null;
public function __construct()
{
$session = new Zend_Session_Namespace('ciblage');
$this->valeur = $session->ciblage;
if (isset($this->valeur['NB']['total'])){ $this->total = $this->valeur['NB']['total']; }
if (isset($this->valeur['NB']['insee'])){ $this->insee = $this->valeur['NB']['insee']; }
if (isset($this->valeur['NB'])){ unset($this->valeur['NB']); }
}
protected function setSession()
{
$session = new Zend_Session_Namespace('ciblage');
$this->valeur['NB']['total'] = $this->total;
$this->valeur['NB']['insee'] = $this->insee;
$session->ciblage = $this->valeur;
}
@ -51,4 +59,16 @@ class SessionCiblage
{
return $this->valeur;
}
public function setNb($element, $nb)
{
$this->{$element} = $nb;
$this->setSession();
}
public function getNb($element)
{
return $this->{$element};
}
}