Modification du formulaire + comptage et affichage
This commit is contained in:
parent
88b18df8a5
commit
2790771a97
@ -11,15 +11,21 @@ class ComptageController extends Zend_Controller_Action
|
||||
$value = $request->getParam('valeur');
|
||||
|
||||
//Session
|
||||
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$session->setCritere($key, $value);
|
||||
|
||||
//Comptage
|
||||
require_once 'Scores/Ciblage.php';
|
||||
|
||||
$ciblage = new Ciblage($session->getSession());
|
||||
$total = $ciblage->execute();
|
||||
$insee = $ciblage->calculeRedevanceInsee();
|
||||
|
||||
//Retour comptage, unité Insee
|
||||
$result = array(
|
||||
'count' => 3434343434,
|
||||
'insee' => 500
|
||||
'count' => number_format($total, 0, '', ' '),
|
||||
'insee' => number_format($insee, 0, '', ' ')
|
||||
);
|
||||
echo json_encode($result);
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
require_once ('Scores/Ciblage.php');
|
||||
class CriteresController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction(){}
|
||||
@ -7,11 +6,6 @@ class CriteresController extends Zend_Controller_Action
|
||||
public function entrepriseAction()
|
||||
{
|
||||
//$this->_helper->layout()->disableLayout();
|
||||
if($this->getRequest()->isPost()) {
|
||||
$ciblage = new Ciblage($this->getRequest()->getParams());
|
||||
$result = $ciblage->execute();
|
||||
echo "<pre>";print_r($result);exit;
|
||||
}
|
||||
}
|
||||
|
||||
public function economiqueAction()
|
||||
|
@ -1,10 +1,10 @@
|
||||
<div>
|
||||
<p>
|
||||
<label>Etablissements :</label>
|
||||
<select class="criteres" name="Entreprise[Etablissements]">
|
||||
<option value="null">Tous</option>
|
||||
<option value="1">Actifs</option>
|
||||
<option value="0">Inactifs</option>
|
||||
<select class="criteres" name="siege">
|
||||
<option value="">Tous</option>
|
||||
<option value="1">Siege</option>
|
||||
<option value="0">Etablissement</option>
|
||||
</select>
|
||||
</p>
|
||||
<p><label>Type d'établissements</label>
|
||||
@ -14,32 +14,51 @@
|
||||
<option value="">Uniquement les secondaires</option>
|
||||
</select>
|
||||
<p>
|
||||
<label>Avec Téléphone</label><input class="criteres" type="checkbox" name="Entreprise[tel]"/>
|
||||
<p>
|
||||
<label>Siren Groupe :</label>
|
||||
<select class="criteres" name="sirenGrp">
|
||||
<option value="">Tous</option>
|
||||
<option value="1">Oui</option>
|
||||
<option value="0">Non</option>
|
||||
</select>
|
||||
</p>
|
||||
<label>Avec Téléphone</label><input value="1" class="criteres" type="checkbox" name="tel"/>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>Date de création : </label>
|
||||
<select name="ChiffreCles[Creation]">
|
||||
<option value=""></option>
|
||||
<option value="1">Moins d'un an</option>
|
||||
<option value="2">de 1 à 2 ans</option>
|
||||
<option value="3">de 3 à 5 ans</option>
|
||||
<option value="4">de 6 à 9 ans</option>
|
||||
<option value="5">10 ans et plus</option>
|
||||
</select>
|
||||
<label>Date de création Entreprise: </label>
|
||||
<input type="text" name="dateCrea_ent1" /> <input type="text" name="dateCrea_ent2" /> <a class="interval" id="dateCrea_ent" href="">Valider</a>
|
||||
</p>
|
||||
<p>
|
||||
<label>Date de création Etablissement: </label>
|
||||
<input type="text" name="dateCrea_etab1" /> <input type="text" name="dateCrea_etab2" /> <a class="interval" id="dateCrea_etab" href="">Valider</a>
|
||||
</p>
|
||||
<p>
|
||||
<label>Date de date Immatriculation: </label>
|
||||
<input type="text" name="dateImmat1" /> <input type="text" name="dateImmat2" /> <a class="interval" id="dateImmat" href="">Valider</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>Nombre d'établissements</label>
|
||||
<select name="ChiffreCles[NbOp]">
|
||||
<option value="">inférieur</option>
|
||||
<option value="">égal</option>
|
||||
<option value="">supérieur</option>
|
||||
<option value="">intervalle</option>
|
||||
</select>
|
||||
<input type="" name="ChiffreCles[NbEtablissements]" value=""/>
|
||||
<input type="text" name="nbEtab1" /> <input type="text" name="nbEtab2" /> <a class="interval" id="nbEtab" href="">Valider</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>Intervalle Effectif (Tranches ou Réel) - Entreprise</label>
|
||||
<input type="text" name="teff_entrep1" /> <input type="text" name="teff_entrep2" /> <a class="interval" id="teff_entrep" href="">Valider</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>Tanche effectif Etablissement</label>
|
||||
<input type="text" name="teff_etab1" /> <input type="text" name="teff_etab2" /> <a class="interval" id="teff_etab" href="">Valider</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>Tanche effectif Entreprise</label>
|
||||
<input type="text" name="teff_entrep1" /> <input type="text" name="teff_etab2" /> <a class="interval" id="teff_entrep" href="">Valider</a>
|
||||
</p>
|
||||
|
||||
|
||||
Intervalle Effectif (Tranches ou Réel) - Entreprise, Etablissement
|
||||
</div>
|
||||
|
||||
|
@ -13,7 +13,9 @@
|
||||
<?php echo $this->render('header.phtml') ?>
|
||||
</div>
|
||||
<div id="content" class="clearfix">
|
||||
<form method="post">
|
||||
<?php echo $this->layout()->content; ?>
|
||||
</form>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<?php echo $this->render('footer.phtml'); ?>
|
||||
|
@ -61,7 +61,7 @@ Class Ciblage
|
||||
$this->sphinx->SetLimits(0, 10000, ConfigurationCiblage::$max_results);
|
||||
$resSphinx = $this->sphinx->Query($this->alpha, ConfigurationCiblage::$index);
|
||||
}
|
||||
return ($resSphinx);
|
||||
return ($resSphinx['total_found']);
|
||||
}
|
||||
|
||||
|
||||
@ -231,7 +231,7 @@ Class Ciblage
|
||||
}
|
||||
|
||||
protected function nbEtab($valeur) {
|
||||
$this->setFilter('nbEtab', $valeur);
|
||||
$this->setFilterRange('nbEtab', $valeur);
|
||||
}
|
||||
|
||||
protected function sirenGrp($valeur) {
|
||||
@ -311,7 +311,7 @@ Class Ciblage
|
||||
}
|
||||
|
||||
protected function avisCs($valeur) {
|
||||
$this->setFilter('avisCs', $valeur);
|
||||
$this->setFilte('avisCs', $valeur);
|
||||
}
|
||||
|
||||
protected function bilFS($valeur) {
|
||||
|
@ -17,7 +17,7 @@ class SessionCiblage
|
||||
|
||||
protected function setSession()
|
||||
{
|
||||
$session = new Zend_Session_Namespace();
|
||||
$session = new Zend_Session_Namespace('ciblage');
|
||||
|
||||
if($session->isLocked()) {
|
||||
$session->unlock();
|
||||
@ -26,11 +26,15 @@ class SessionCiblage
|
||||
}
|
||||
}
|
||||
|
||||
public function getSession()
|
||||
{
|
||||
return $this->valeur;
|
||||
}
|
||||
|
||||
public function setCritere($key, $value)
|
||||
{
|
||||
if(in_array($key, $this->criteres)) {
|
||||
$this->valeur[$key] = $value;
|
||||
$session = new Zend_Session_Namespace();
|
||||
$this->valeur[$key] = intval($value);
|
||||
$this->setSession();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user