odea/application/controllers/IndexController.php
2011-12-20 15:22:09 +00:00

75 lines
2.7 KiB
PHP

<?php
class IndexController extends Zend_Controller_Action
{
protected $entreprise = array('siege', 'sirenGrp', 'tel', 'fax', 'web', 'mail', 'presentRcs', 'adrDom', 'dirNom', 'lieuAct', 'nbMPubli', 'dateCrea_ent', 'dateCrea_etab', 'nbAction', 'nbPart');
protected $economique = array('ape_etab', 'ape_entrep', 'NaceEtab', 'NaceEntrep', 'age_etab', 'age_entrep', 'teff_entrep', 'teff_etab', 'nbEtab', 'eff_entrep', 'eff_etab', 'capital');
protected $geographique = array('adr_cp', 'adr_dep', 'adr_com');
protected $juridique = array('cj', 'actifEco', 'procolHisto', 'tvaIntraValide', 'dateImmat');
protected $financier = array('bilType', 'avisCs', 'bilDuree', 'bilTca', 'bilAnnee', 'bilCloture', 'bilEE', 'bilFL', 'bilFK', 'bilFR', 'bilGF', 'bilGP', 'bilGU', 'bilGW', 'bilHD', 'bilHH', 'bilHL', 'bilHM', 'bilHN', 'bilYP');
public function indexAction()
{
$session = new Zend_Session_Namespace('ciblage');
$this->view->total = number_format($session->ciblage['total'], 0, '', ' ');
$this->view->insee = number_format($session->ciblage['insee'], 0, '', ' ');
}
public function selectionAction(){}
public function historiqueAction(){}
public function resetAction()
{ $session = new Zend_Session_Namespace('ciblage');
unset($session->ciblage);
$this->_redirect('./');
}
public function criteresAction()
{
$entreprise = array();
$economique = array();
$geographique = array();
$financier = array();
$juridique = array();
$select = array();
require_once 'Scores/SessionCiblage.php';
$session = new Zend_Session_Namespace('ciblage');
if(!empty($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 = $this->entreprise;
$this->view->geographique = $this->geographique;
$this->view->economique = $this->economique;
$this->view->juridique = $this->juridique;
$this->view->financier = $this->financier;
}
}