modification des champs
This commit is contained in:
parent
c34837ca37
commit
386149eed1
@ -13,13 +13,18 @@ class ComptageController extends Zend_Controller_Action
|
||||
case 'dateCrea_etab':
|
||||
case 'dateCrea_ent':
|
||||
case 'dateImmat':
|
||||
$value = intval($request->getParam('valeur'));
|
||||
case 'nbEtab':
|
||||
case 'teff_entrep':
|
||||
case 'teff_etab':
|
||||
case 'teff_entrep':
|
||||
case 'teff_etab':
|
||||
$value = explode(',', $request->getParam('valeur'));
|
||||
break;
|
||||
default:
|
||||
$value = $request->getParam('valeur');
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//Session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
|
@ -6,10 +6,43 @@ 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')),
|
||||
array('name' => 'fax', 'libelle' => 'Télécopie', 'type' => 'select', 'parametres' => array('Oui' => 1, 'Non' => '0')),
|
||||
array('name' => 'presentRcs', 'libelle' => 'Etablissement présent au RNCS', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
||||
array('name' => 'tvaIntraValide', 'libelle' => 'Numéro de TVA Valide', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
||||
array('name' => 'dirNom', 'libelle' => 'Nom du principal dirigeant', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
||||
array('name' => 'dateCrea_ent', 'libelle' => 'Date de création de l\'entreprose', 'type' => 'interval'),
|
||||
array('name' => 'dateCrea_etab', 'libelle' => 'Date de création de l\'etablissement', 'type' => 'interval'),
|
||||
array('name' => 'dateImmat', 'libelle' => 'Date d\'immatriculation de l\'entreprise', 'type' => 'interval'),
|
||||
array('name' => 'nbEtab', 'libelle' => 'Nombre d\'établissements', 'type' => 'interval'),
|
||||
array('name' => 'teff_entrep', 'libelle' => 'Tranche d\'effectif de l\'entreprise', 'type' => 'interval'),
|
||||
array('name' => 'teff_etab', 'libelle' => 'Tranche d\'effectif de l\'etablissement', 'type' => 'interval')
|
||||
|
||||
);
|
||||
$this->view->champs = $champs;
|
||||
}
|
||||
|
||||
public function economiqueAction()
|
||||
{
|
||||
$champs = array(array('name' => 'ape_etab', 'libelle' => 'Code NAF Etablissement', 'type' => 'text'),
|
||||
array('name' => 'ape_entrep', 'libelle' => 'Code NAF Entreprise', 'type' => 'text'),
|
||||
array('name' => 'age_etab', 'libelle' => 'Code AGE Etablissement', 'type' => 'text'),
|
||||
array('name' => 'age_entrep', 'libelle' => 'Code AGE Entreprise', 'type' => 'text'),
|
||||
array('name' => 'tca', 'libelle' => 'Tranche de Chiffre d\'affaire de l\'entreprise (Insee)', 'type' => 'interval'),
|
||||
array('name' => 'tcaexp', 'libelle' => 'Tranche de Chiffre d\'affaire à l\'export', 'type' => 'interval'),
|
||||
array('name' => 'actifEco', 'libelle' => 'Etablissement économiquement actif', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
||||
array('name' => '', 'libelle' => '', 'type' => ''),
|
||||
array('name' => '', 'libelle' => '', 'type' => ''),
|
||||
array('name' => '', 'libelle' => '', 'type' => ''),
|
||||
array('name' => '', 'libelle' => '', 'type' => ''),
|
||||
array('name' => '', 'libelle' => '', 'type' => ''),
|
||||
array('name' => '', 'libelle' => '', 'type' => ''),
|
||||
array('name' => '', 'libelle' => '', 'type' => '')
|
||||
|
||||
);
|
||||
$this->view->champs = $champs;
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
}
|
||||
|
@ -17,5 +17,12 @@ class IndexController extends Zend_Controller_Action
|
||||
$this->_redirect('./');
|
||||
}
|
||||
|
||||
public function criteresAction()
|
||||
{
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new Zend_Session_Namespace('ciblage');
|
||||
$this->view->entreprise = $session->ciblage;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -3,14 +3,23 @@ require_once 'commons/dates.php';
|
||||
|
||||
Class Zend_View_Helper_Interval extends Zend_View_Helper_Abstract
|
||||
{
|
||||
protected function getValueSession($name)
|
||||
{
|
||||
$session = new Zend_Session_Namespace('ciblage');
|
||||
if(!empty($session->ciblage[$name]))
|
||||
return ($session->ciblage[$name]);
|
||||
}
|
||||
|
||||
public function Interval($name, $libelle, $date = false)
|
||||
{
|
||||
$session = $this->getValueSession($name);
|
||||
|
||||
$champ = '<div>';
|
||||
$champ .= '<div style="float:left;text-align:left;">
|
||||
<label>'.$libelle.'</label>
|
||||
</div>';
|
||||
$champ .= '<div style="text-align:right;">
|
||||
<input type="text" name="'.$name.'1" /> à <input type="text" name="'.$name.'2" /> <a class="interval" id="'.$name.'" href=""><img width="10%" src="/themes/default/images/valider.png" /></a>
|
||||
<input type="text" name="'.$name.'1" value="'.$session[0].'" /> à <input value="'.$session[1].'" type="text" name="'.$name.'2" /> <a class="interval" id="'.$name.'" href=""><img width="10%" src="/themes/default/images/valider.png" /></a>
|
||||
</div>';
|
||||
$champ .= '<div>
|
||||
<hr />
|
||||
|
22
application/views/default/helpers/Radio.php
Normal file
22
application/views/default/helpers/Radio.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
Class Zend_View_Helper_Radio extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function Radio($name, $libelle)
|
||||
{
|
||||
$champ = '<div>';
|
||||
$champ .= '<div style="float:left;text-align:left;">
|
||||
<label>'.$libelle.'</label>
|
||||
</div>';
|
||||
$champ .= '<div style="text-align:right;">
|
||||
<input type="radio" name="'.$name.'" value="" />
|
||||
<input type="radio" name="'.$name.'" value="0" />
|
||||
<input type="radio" name="'.$name.'" value="1" />
|
||||
</div>';
|
||||
$champ .= '<div>
|
||||
<hr />
|
||||
</div>';
|
||||
$champ .= '</div>';
|
||||
|
||||
return ($champ);
|
||||
}
|
||||
}
|
30
application/views/default/helpers/Select.php
Normal file
30
application/views/default/helpers/Select.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
Class Zend_View_Helper_Select extends Zend_View_Helper_Abstract
|
||||
{
|
||||
|
||||
public function Select($name, $libelle, $liste)
|
||||
{
|
||||
$session = new Zend_Session_Namespace('ciblage');
|
||||
$compar = $session->ciblage[$name];
|
||||
$select = '<option value="tous">Tous</option>';
|
||||
|
||||
foreach($liste as $item => $value) {
|
||||
$select .= '<option '.(($compar != null and $compar == $value)?'selected="selected"':null).' value="'.$value.'">'.$item.'</option>';
|
||||
}
|
||||
$champ = '<div>';
|
||||
$champ .= '<div style="float:left;text-align:left;">
|
||||
<label>'.$libelle.'</label>
|
||||
</div>';
|
||||
$champ .= '<div style="text-align:right;">
|
||||
<select class="criteres" name="'.$name.'">
|
||||
'.$select.'
|
||||
</select>
|
||||
</div>';
|
||||
$champ .= '<div>
|
||||
<hr />
|
||||
</div>';
|
||||
$champ .= '</div>';
|
||||
|
||||
return ($champ);
|
||||
}
|
||||
}
|
@ -1,98 +1,14 @@
|
||||
<?php $this->addHelperPath('Helper/Interval', 'Helper_Interval');?>
|
||||
<div>
|
||||
<div>
|
||||
<div style="float:left;text-align:left;">
|
||||
<label>Etablissements : </label>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<select class="criteres" name="siege">
|
||||
<option value="">Tous</option>
|
||||
<option value="1">Siege</option>
|
||||
<option value="0">Etablissement</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div style="float:left;text-align:left;">
|
||||
<label>Type d'établissements : </label>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<select name="Entreprise[TypeEtablissements]">
|
||||
<option value="">Tous</option>
|
||||
<option value="">Uniquement les sièges</option>
|
||||
<option value="">Uniquement les secondaires</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div style="float:left;text-align:left;">
|
||||
<label>Siren Groupe :</label>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<select class="criteres" name="sirenGrp">
|
||||
<option value="">Tous</option>
|
||||
<option value="1">Oui</option>
|
||||
<option value="0">Non</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="float:left;text-align:left;">
|
||||
<label>Avec Téléphone</label>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<input value="1" class="criteres" type="checkbox" name="tel"/>
|
||||
</div>
|
||||
<div>
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="float:left;text-align:left;">
|
||||
<label>Avec Fax</label>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<input value="1" class="criteres" type="checkbox" name="fax"/>
|
||||
</div>
|
||||
<div>
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
<?php echo $this->Interval('dateCrea_ent', 'Date de création Entreprise : ', true);?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo $this->Interval('dateCrea_etab', 'Date de création Etablissement : ', true);?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo $this->Interval('dateImmat', 'Date de date Immatriculation :', true);?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo $this->Interval('nbEtab', 'Nombre d\'établissements : ');?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo $this->Interval('teff_entrep', 'Intervalle Effectif Entreprise : ');?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo $this->Interval('teff_etab', 'Tanche effectif Etablissement : ');?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo $this->Interval('teff_entrep', 'Tanche effectif Entreprise : ');?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo $this->Interval('teff_etab', 'Tanche effectif Etablissement : ');?>
|
||||
</p>
|
||||
<?php foreach($this->champs as $champ){
|
||||
switch ($champ['type']) {
|
||||
case 'select':
|
||||
echo $this->Select($champ['name'], $champ['libelle'], $champ['parametres']);
|
||||
break;
|
||||
case 'interval':
|
||||
echo $this->Interval($champ['name'], $champ['libelle']);
|
||||
break;
|
||||
}
|
||||
} ?>
|
||||
</div>
|
||||
|
||||
<div style="text-align:right;">
|
||||
|
@ -1 +1 @@
|
||||
<a href="/index/reset">Vider la session</a>
|
||||
<a style="color:white"href="/index/reset">Vider la session</a>
|
22
application/views/default/scripts/index/criteres.phtml
Normal file
22
application/views/default/scripts/index/criteres.phtml
Normal file
@ -0,0 +1,22 @@
|
||||
<h3><a href="#">Entreprise - <span style="font-size:10px">Nombre de critéres : <?php echo count($this->entreprise) ?></span></a></h3>
|
||||
<div>
|
||||
<?php foreach($this->entreprise as $item => $valeur): ?>
|
||||
<span><?php echo '<b>'.$item.' :</b> '.(($valeur=='0' or $valeur == '1')?(($valeur=='0')?'Non':'Oui'):str_replace(',', ' à ', implode(' à ', $valeur))); ?><span/><br />
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<h3><a href="#">Situation economique</a></h3>
|
||||
<div>
|
||||
<p></p>
|
||||
</div>
|
||||
<h3><a href="#">Secteur géographique</a></h3>
|
||||
<div>
|
||||
<p></p>
|
||||
</div>
|
||||
<h3><a href="#">Situation juridique</a></h3>
|
||||
<div>
|
||||
<p></p>
|
||||
</div>
|
||||
<h3><a href="#">Situation financiére</a></h3>
|
||||
<div>
|
||||
<p></p>
|
||||
</div>
|
@ -12,24 +12,42 @@
|
||||
</div>
|
||||
|
||||
<div id="result">
|
||||
|
||||
<div id="comptage">
|
||||
Nombre d'entreprises sélectionnées :
|
||||
<span id="count">-</span>
|
||||
<br/>
|
||||
(dont <span id="insee">-</span> unité(s) insee)
|
||||
</div>
|
||||
|
||||
<div id="attente" style="display:none;">
|
||||
Comptage en cours...
|
||||
</div>
|
||||
|
||||
<div id="critères">
|
||||
Rappel des critères de selection
|
||||
</div>
|
||||
<div id="critères">
|
||||
<div id="accordion">
|
||||
<h3><a href="">Résultats</a></h3>
|
||||
<div style="padding:0px;">
|
||||
<div id="comptage" style="margin-bottom:40px">
|
||||
Nombre d'entreprises sélectionnées :
|
||||
<span style="font-weight:800;" id="count">-</span>
|
||||
<br/>
|
||||
(dont <span style="font-weight:800;" id="insee">-</span> unité(s) insee)
|
||||
</div>
|
||||
<div id="attente" style="text-align:center;display:none;">
|
||||
<img width="15%" src="/themes/default/images/ajax.gif" /><br />
|
||||
Chargement...
|
||||
</div>
|
||||
</div>
|
||||
<?php echo $this->action('criteres', 'index');?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
var icons = {
|
||||
header: "ui-icon-circle-arrow-e",
|
||||
headerSelected: "ui-icon-circle-arrow-s"
|
||||
};
|
||||
$( "#accordion" ).accordion({
|
||||
icons: icons
|
||||
});
|
||||
$( "#toggle" ).button().toggle(function() {
|
||||
$( "#accordion" ).accordion( "option", "icons", false );
|
||||
}, function() {
|
||||
$( "#accordion" ).accordion( "option", "icons", icons );
|
||||
});
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$( "#tabs" ).tabs({
|
||||
cache: true,
|
||||
|
@ -17,7 +17,7 @@ Class Ciblage
|
||||
if(!empty($structure)) {
|
||||
foreach($structure as $key => $valeur)
|
||||
{
|
||||
if (method_exists($this, $key) and isset($valeur)) {
|
||||
if (method_exists($this, $key) and isset($valeur) and $valeur != 'tous') {
|
||||
if(count($valeur) == 1){
|
||||
$valeur = $valeur[0];}
|
||||
$this->$key($valeur);
|
||||
@ -57,7 +57,6 @@ Class Ciblage
|
||||
} while($i < $resSphinx['total_found']);
|
||||
return ($resSphinx['total_found']);
|
||||
} else {
|
||||
//$this->sphinx->SetLimits(0, 10000, ConfigurationCiblage::$max_results);
|
||||
$resSphinx = $this->sphinx->Query($this->alpha, ConfigurationCiblage::$index);
|
||||
}
|
||||
return ($resSphinx['total_found']);
|
||||
|
BIN
public/themes/default/images/ajax.gif
Normal file
BIN
public/themes/default/images/ajax.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
@ -1,5 +1,10 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
$('.accordion .head').click(function() {
|
||||
$(this).next().toggle('slow');
|
||||
return false;
|
||||
}).next().hide();
|
||||
|
||||
$('#tabs').delegate('select.criteres', 'change', function(e){
|
||||
e.stopPropagation();
|
||||
set($(this).attr('name'), $(this, ':selected').val());
|
||||
|
@ -5,6 +5,11 @@ body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#comptage
|
||||
{
|
||||
padding:5px;
|
||||
font-size:11px;
|
||||
}
|
||||
select {
|
||||
width:150px;
|
||||
}
|
||||
@ -166,7 +171,7 @@ h3 {
|
||||
}
|
||||
|
||||
#result {
|
||||
background: #ffffff;
|
||||
/*background: #ffffff;*/
|
||||
color: #000000;
|
||||
float:left;
|
||||
width:250px;
|
||||
|
Loading…
Reference in New Issue
Block a user