Label and values
This commit is contained in:
parent
fd50f7ce6c
commit
5a14343455
@ -10,6 +10,20 @@ class ComptageController extends Zend_Controller_Action
|
||||
$cle = $request->getParam('cle');
|
||||
$valeur = $request->getParam('valeur');
|
||||
|
||||
//Values sent must always be an array
|
||||
if ( is_array($valeur) ) {
|
||||
$values = $valeur;
|
||||
} elseif ( is_string($valeur) ) {
|
||||
//Remove all spaces
|
||||
$valeur = preg_replace('/\s+/', '', $valeur);
|
||||
$valeur = str_replace(';', ',', $valeur);
|
||||
//Split valeur
|
||||
$values = explode(',', $valeur);
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info('Comptage');
|
||||
Zend_Registry::get('firebug')->info($values);
|
||||
|
||||
/**
|
||||
* Error code
|
||||
* 0 : OK
|
||||
@ -29,7 +43,7 @@ class ComptageController extends Zend_Controller_Action
|
||||
$fields = new Scores_Ciblage_FieldList();
|
||||
$sessionValue = new Scores_Ciblage_Session($fields);
|
||||
|
||||
$insert = $sessionValue->setSelected($cle, $valeur, $ex);
|
||||
$insert = $sessionValue->setSelected($cle, $values, $ex);
|
||||
|
||||
if ($insert) {
|
||||
//Informations utilisateur
|
||||
|
@ -53,56 +53,14 @@ class IndexController extends Zend_Controller_Action
|
||||
$allFields = $fields->getItems(true);
|
||||
foreach ( $allFields as $key => $params ) {
|
||||
$valueSelected = $sessionValue->getSelectedValue($key);
|
||||
if ( $valueSelected !== false ) {
|
||||
$inValue = $valueSelected['in'];
|
||||
$exValue = $valueSelected['ex'];
|
||||
if ( $valueSelected !== null ) {
|
||||
|
||||
if ( $params['type'] == 'one' ) {
|
||||
|
||||
$inLabel = '';
|
||||
if ( count($inValue)>0 ) {
|
||||
foreach ( $inValue as $value ) {
|
||||
if ( array_key_exists($value, $params['values']) ) {
|
||||
$inLabel = $params['values'][$value];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$exLabel = '';
|
||||
if ( count($exValue)>0 ) {
|
||||
foreach ( $exValue as $value ) {
|
||||
if ( array_key_exists($value, $params['values']) ) {
|
||||
$exLabel = $params['values'][$value];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$inLabel = array();
|
||||
if ( count($inValue)>0 ) {
|
||||
foreach ( $inValue as $value ) {
|
||||
if ( array_key_exists($value, $params['values']) ) {
|
||||
$inLabel[] = $params['values'][$value];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$exLabel = array();
|
||||
if ( count($exValue)>0 ) {
|
||||
foreach ( $exValue as $value ) {
|
||||
if ( array_key_exists($value, $params['values']) ) {
|
||||
$exLabel[] = $params['values'][$value];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$resultLabel = $sessionValue->resumeLabel($key);
|
||||
|
||||
$infosCriteres[$key] = array(
|
||||
'label' => $params['label'],
|
||||
'in' => $inLabel,
|
||||
'ex' => $exLabel,
|
||||
'in' => $resultLabel['in'],
|
||||
'ex' => $resultLabel['ex'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
$fields = new Scores_Ciblage_FieldList();
|
||||
|
||||
$sessionValue = new Scores_Ciblage_Session($fields);
|
||||
$valueSelected = $sessionValue->getSelectedValues();
|
||||
|
||||
$valueSelected = $sessionValue->getSelectedValue($name);
|
||||
$html = $fields->getItemHtml($name, $valueSelected);
|
||||
|
||||
if ($html) {
|
||||
|
@ -12,13 +12,20 @@
|
||||
<div class="alert alert-info">
|
||||
<a class="close" data-dismiss="alert" href="<?=$this->url(array(
|
||||
'controller'=>'index', 'action'=>'remove', 'critere'=>$critere), null, true)?>" aria-hidden="true">×</a>
|
||||
<div style='font-weight: 700;'><?=$item['label']?>:</div>
|
||||
<?php if ( is_string($item['in']) && !empty($item['in']) ) {?>
|
||||
<p> <?=$item['in']?></p>
|
||||
<?php } elseif ( is_array($item['in']) || is_array($item['ex']) ) {?>
|
||||
<p> <a class="criterelist" title="<?=$item['label']?>" href="<?=$this->url(array(
|
||||
'controller'=>'index', 'action'=>'criterelist', 'key'=>$critere), null, true)?>">Liste</a></p>
|
||||
<?php }?>
|
||||
<strong><?=$item['label']?>:</strong>
|
||||
<?php if ( $item['in'] == 'Liste' ) { ?>
|
||||
<a href="<?=$this->url(array('controller'=>'index', 'action'=>'criterelist',
|
||||
'key'=>$critere), null, true)?>">Éléments inclus.</a>
|
||||
<?php } elseif ( !empty($item['in']) ) {?>
|
||||
<span><?=$item['in']?>.</span>
|
||||
<?php }?>
|
||||
|
||||
<?php if ( $item['ex'] == 'Liste' ) { ?>
|
||||
<a href="<?=$this->url(array('controller'=>'index', 'action'=>'criterelist',
|
||||
'key'=>$critere), null, true)?>">Éléments exclus.</a>
|
||||
<?php } elseif ( !empty($item['ex']) ) {?>
|
||||
<span><s><?=$item['ex']?></s>.</span>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php } else {?><div class="alert alert-warning">Aucune sélection.</div><?}?>
|
||||
|
@ -31,7 +31,7 @@ class Application_Controller_Plugin_Comptage extends Zend_Controller_Plugin_Abst
|
||||
|
||||
// Chargement des critères de ciblage à partir de l'enregistrement en bdd
|
||||
$id = $request->getParam('id', 0);
|
||||
if (!empty($id)) {
|
||||
if ( !empty($id) ) {
|
||||
$criteresM = new Application_Model_CiblageCriteres();
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('criteres'))
|
||||
@ -57,6 +57,12 @@ class Application_Controller_Plugin_Comptage extends Zend_Controller_Plugin_Abst
|
||||
$sessionValue->setCritereSession();
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
if ( $sessionValue->getCountTotal() === false ) {
|
||||
$ciblage = new Scores_Ciblage_Engine($sessionValue->getSelectedValues(), $user->globalRNCS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$view->total = $sessionValue->getCountTotal();
|
||||
|
@ -21,19 +21,20 @@ class Scores_Ciblage_Field_Range
|
||||
'<div class="col-md-10">';
|
||||
if ( count($this->data)>0 ) {
|
||||
|
||||
if ( $valueSelected === null || count($valueSelected)==0 ) {
|
||||
$valueSelected = $this->data;
|
||||
if ( $valueSelected === null || count($valueSelected['in'])==0 ) {
|
||||
$selectedMin = $this->data['min'];
|
||||
$selectedMax = $this->data['max'];
|
||||
} else {
|
||||
$selectedMin = $valueSelected['in'][0];
|
||||
$selectedMax = $valueSelected['in'][1];
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info('Range');
|
||||
Zend_Registry::get('firebug')->info($valueSelected);
|
||||
|
||||
$html.= '<b style="margin:0 15px">'.number_format($this->data['min'], 0, ',', ' ').'</b>'.
|
||||
'<input id="slider-'.$this->name.'" type="text" class="span2" value=""
|
||||
data-slider-min="'.$this->data['min'].'"
|
||||
data-slider-max="'.$this->data['max'].'"
|
||||
data-slider-step="1"
|
||||
data-slider-value="['.$valueSelected['min'].','.$valueSelected['max'].']"/>'.
|
||||
data-slider-value="['.$selectedMin.','.$selectedMax.']"/>'.
|
||||
'<b style="margin:0 15px">'.number_format($this->data['max'], 0, ',', ' ').'</b>';
|
||||
}
|
||||
$html.= '</div>'.
|
||||
|
@ -840,4 +840,52 @@ class Scores_Ciblage_FieldList
|
||||
return array();
|
||||
}
|
||||
|
||||
public function checkValue($key, $value)
|
||||
{
|
||||
$info = $this->items[$key];
|
||||
$staticValuesLabel = $this->getItemValues($key);
|
||||
switch($info['type']) {
|
||||
case 'range':
|
||||
if ( floatval($value)>=floatval($staticValuesLabel['min']) && floatval($value)<=floatval($staticValuesLabel['max']) ) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$staticValues = array_keys($staticValuesLabel);
|
||||
if ( in_array($value, $staticValues) ) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function labelValue($key, $values)
|
||||
{
|
||||
$info = $this->items[$key];
|
||||
$staticValuesLabel = $this->getItemValues($key);
|
||||
switch($info['type']) {
|
||||
case 'one':
|
||||
return $staticValuesLabel[$values[0]];
|
||||
break;
|
||||
case 'range':
|
||||
//@todo : unit
|
||||
return $values[0]." à ".$values[1];
|
||||
break;
|
||||
case 'rangedate':
|
||||
return "du ".$values[0]." à ".$values[1];
|
||||
break;
|
||||
default:
|
||||
return "Liste";
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function labelValueDetail($key, $value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -79,18 +79,16 @@ class Scores_Ciblage_Session
|
||||
|
||||
$valueToSave = null;
|
||||
|
||||
//Prepare data
|
||||
//check data
|
||||
if ( is_array($value) ) {
|
||||
foreach ( $value as $item ) {
|
||||
if ( in_array($item, $staticValues) ) {
|
||||
if ( $this->fields->checkValue($key, $item) ){
|
||||
$valueToSave[] = $item;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( in_array($value, $staticValues) ) {
|
||||
$valueToSave = array($value);
|
||||
} else {
|
||||
return false;
|
||||
if ( $this->fields->checkValue($key, $value) ){
|
||||
$valueToSave[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,13 +171,13 @@ class Scores_Ciblage_Session
|
||||
public function getSelectedValue($key)
|
||||
{
|
||||
if ( $this->ciblage === null )
|
||||
return false;
|
||||
return null;
|
||||
|
||||
if ( array_key_exists($key, $this->ciblage->select) ) {
|
||||
return $this->ciblage->select[$key];
|
||||
}
|
||||
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -188,7 +186,7 @@ class Scores_Ciblage_Session
|
||||
public function getSelectedValues()
|
||||
{
|
||||
if ( $this->ciblage === null )
|
||||
return false;
|
||||
return null;
|
||||
|
||||
return $this->ciblage->select;
|
||||
}
|
||||
@ -241,4 +239,25 @@ class Scores_Ciblage_Session
|
||||
Zend_Session::namespaceUnset('ciblage');
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoi les libellés
|
||||
* @param string $key
|
||||
*/
|
||||
public function resumeLabel($key)
|
||||
{
|
||||
$values = $this->getSelectedValue($key);
|
||||
|
||||
if (count($values['in'])>0) {
|
||||
$in = $this->fields->labelValue($key, $values['in']);
|
||||
}
|
||||
|
||||
if (count($values['ex'])>0) {
|
||||
$ex = $this->fields->labelValue($key, $values['ex']);
|
||||
}
|
||||
|
||||
return array(
|
||||
'in' => $in,
|
||||
'ex' => $ex,
|
||||
);
|
||||
}
|
||||
}
|
31
library/Scores/Table/adr_reg.php
Normal file
31
library/Scores/Table/adr_reg.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
return array(
|
||||
'1' => "Guadeloupe",
|
||||
'2' => "Martinique",
|
||||
'3' => "Guyane",
|
||||
'4' => "La Réunion",
|
||||
'11' => "Île-de-France",
|
||||
'21' => "Champagne-Ardenne",
|
||||
'22' => "Picardie",
|
||||
'23' => "Haute-Normandie",
|
||||
'24' => "Centre",
|
||||
'25' => "Basse-Normandie",
|
||||
'26' => "Bourgogne",
|
||||
'31' => "Nord-Pas-de-Calais",
|
||||
'41' => "Lorraine",
|
||||
'42' => "Alsace",
|
||||
'43' => "Franche-Comté",
|
||||
'52' => "Pays de la Loire",
|
||||
'53' => "Bretagne",
|
||||
'54' => "Poitou-Charentes",
|
||||
'72' => "Aquitaine",
|
||||
'73' => "Midi-Pyrénées",
|
||||
'74' => "Limousin",
|
||||
'82' => "Rhône-Alpes",
|
||||
'83' => "Auvergne",
|
||||
'91' => "Languedoc-Roussillon",
|
||||
'93' => "Provence-Alpes-Côte d'Azur",
|
||||
'94' => "Corse",
|
||||
'98' => "Territoires d'outre-mer",
|
||||
'99' => "Etranger",
|
||||
);
|
5
library/Scores/Table/age_entrep.php
Normal file
5
library/Scores/Table/age_entrep.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 0,
|
||||
'max'=> 255,
|
||||
);
|
5
library/Scores/Table/age_etab.php
Normal file
5
library/Scores/Table/age_etab.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 0,
|
||||
'max'=> 255,
|
||||
);
|
5
library/Scores/Table/bilAnnee.php
Normal file
5
library/Scores/Table/bilAnnee.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 0,
|
||||
'max'=> 2014,
|
||||
);
|
5
library/Scores/Table/bilCloture.php
Normal file
5
library/Scores/Table/bilCloture.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 0,
|
||||
'max'=> 2014,
|
||||
);
|
5
library/Scores/Table/bilEE.php
Normal file
5
library/Scores/Table/bilEE.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -934414,
|
||||
'max'=> 164625000000,
|
||||
);
|
5
library/Scores/Table/bilFK.php
Normal file
5
library/Scores/Table/bilFK.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -8069898,
|
||||
'max'=> 7058000000,
|
||||
);
|
5
library/Scores/Table/bilFL.php
Normal file
5
library/Scores/Table/bilFL.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -3755227,
|
||||
'max'=> 69225933400,
|
||||
);
|
5
library/Scores/Table/bilFR.php
Normal file
5
library/Scores/Table/bilFR.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -5728610,
|
||||
'max'=> 54205000000,
|
||||
);
|
5
library/Scores/Table/bilGF.php
Normal file
5
library/Scores/Table/bilGF.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -220460628,
|
||||
'max'=> 55971660000,
|
||||
);
|
5
library/Scores/Table/bilGP.php
Normal file
5
library/Scores/Table/bilGP.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -8508000,
|
||||
'max'=> 10599281000,
|
||||
);
|
5
library/Scores/Table/bilGW.php
Normal file
5
library/Scores/Table/bilGW.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -2147483648,
|
||||
'max'=> 12401380000,
|
||||
);
|
5
library/Scores/Table/bilHD.php
Normal file
5
library/Scores/Table/bilHD.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -7483854,
|
||||
'max'=> 7878000000,
|
||||
);
|
5
library/Scores/Table/bilHH.php
Normal file
5
library/Scores/Table/bilHH.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -8122288,
|
||||
'max'=> 6909000000,
|
||||
);
|
5
library/Scores/Table/bilHL.php
Normal file
5
library/Scores/Table/bilHL.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -79462149,
|
||||
'max'=> 60126000000,
|
||||
);
|
5
library/Scores/Table/bilHM.php
Normal file
5
library/Scores/Table/bilHM.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -377700211,
|
||||
'max'=> 59027792000,
|
||||
);
|
5
library/Scores/Table/bilHN.php
Normal file
5
library/Scores/Table/bilHN.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -2147483648,
|
||||
'max'=> 9766284000,
|
||||
);
|
5
library/Scores/Table/bilYP.php
Normal file
5
library/Scores/Table/bilYP.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> -2278223,
|
||||
'max'=> 50274502,
|
||||
);
|
5
library/Scores/Table/capital.php
Normal file
5
library/Scores/Table/capital.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 0,
|
||||
'max'=> 7821000000000,
|
||||
);
|
109
library/Scores/Table/codesdepts.php
Normal file
109
library/Scores/Table/codesdepts.php
Normal file
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
return array(
|
||||
'03' => "Allier",
|
||||
'04' => "Alpes-de-Haute-Provence",
|
||||
'02' => "Aisne",
|
||||
'01' => "Ain",
|
||||
'05' => "Hautes-Alpes",
|
||||
'06' => "Alpes-Maritimes",
|
||||
'07' => "Ardèche",
|
||||
'08' => "Ardennes",
|
||||
'09' => "Ariège",
|
||||
'10' => "Aube",
|
||||
'11' => "Aude",
|
||||
'12' => "Aveyron",
|
||||
'13' => "Bouches-du-Rhône",
|
||||
'14' => "Calvados",
|
||||
'15' => "Cantal",
|
||||
'16' => "Charente",
|
||||
'17' => "Charente-Maritime",
|
||||
'18' => "Cher",
|
||||
'19' => "Corrèze",
|
||||
'2A' => "Corse-du-Sud",
|
||||
'20' => "Corse",
|
||||
'21' => "Côte-d'Or",
|
||||
'22' => "Côtes-d'Armor",
|
||||
'23' => "Creuse",
|
||||
'24' => "Dordogne",
|
||||
'25' => "Doubs",
|
||||
'26' => "Drôme",
|
||||
'27' => "Eure",
|
||||
'28' => "Eure-et-Loir",
|
||||
'29' => "Finistère",
|
||||
'30' => "Gard",
|
||||
'33' => "Gironde",
|
||||
'32' => "Gers",
|
||||
'34' => "Hérault",
|
||||
'31' => "Haute-Garonne",
|
||||
'36' => "Indre",
|
||||
'37' => "Indre-et-Loire",
|
||||
'35' => "Ille-et-Vilaine",
|
||||
'39' => "Jura",
|
||||
'38' => "Isère",
|
||||
'40' => "Landes",
|
||||
'41' => "Loir-et-Cher",
|
||||
'42' => "Loire",
|
||||
'43' => "Haute-Loire",
|
||||
'44' => "Loire-Atlantique",
|
||||
'45' => "Loiret",
|
||||
'46' => "Lot",
|
||||
'47' => "Lot-et-Garonne",
|
||||
'48' => "Lozère",
|
||||
'49' => "Maine-et-Loire",
|
||||
'53' => "Mayenne",
|
||||
'51' => "Marne",
|
||||
'50' => "Manche",
|
||||
'52' => "Haute-Marne",
|
||||
'54' => "Meurthe-et-Moselle",
|
||||
'56' => "Morbihan",
|
||||
'55' => "Meuse",
|
||||
'57' => "Moselle",
|
||||
'58' => "Nièvre",
|
||||
'59' => "Nord",
|
||||
'60' => "Oise",
|
||||
'62' => "Pas-de-Calais",
|
||||
'61' => "Orne",
|
||||
'63' => "Puy-de-Dôme",
|
||||
'67' => "Bas-Rhin",
|
||||
'68' => "Haut-Rhin",
|
||||
'69' => "Rhône",
|
||||
'64' => "Pyrénées-Atlantiques",
|
||||
'65' => "Hautes-Pyrénées",
|
||||
'66' => "Pyrénées-Orientales",
|
||||
'70' => "Haute-Saône",
|
||||
'71' => "Saône-et-Loire",
|
||||
'72' => "Sarthe",
|
||||
'73' => "Savoie",
|
||||
'74' => "Haute-Savoie",
|
||||
'75' => "Paris",
|
||||
'76' => "Seine-Maritime",
|
||||
'77' => "Seine-et-Marne",
|
||||
'78' => "Yvelines",
|
||||
'79' => "Deux-Sèvres",
|
||||
'80' => "Somme",
|
||||
'81' => "Tarn",
|
||||
'82' => "Tarn-et-Garonne",
|
||||
'83' => "Var",
|
||||
'84' => "Vaucluse",
|
||||
'85' => "Vendée",
|
||||
'86' => "Vienne",
|
||||
'87' => "Haute-Vienne",
|
||||
'88' => "Vosges",
|
||||
'89' => "Yonne",
|
||||
'90' => "Territoire de Belfort",
|
||||
'91' => "Essonne",
|
||||
'92' => "Hauts-de-Seine",
|
||||
'93' => "Seine-Saint-Denis",
|
||||
'94' => "Val-de-Marne",
|
||||
'95' => "Val-d'Oise",
|
||||
'971' => "Guadeloupe",
|
||||
'972' => "Martinique",
|
||||
'973' => "Guyane",
|
||||
'974' => "Réunion",
|
||||
'976' => "Mayotte",
|
||||
'988' => "Nouvelle-Calédonie",
|
||||
'987' => "Polynésie-Française",
|
||||
'975' => "Saint-Pierre-et-Miquelon",
|
||||
'986' => "Wallis-et-Futuna",
|
||||
'2B' => "Haute-Corse",
|
||||
);
|
39780
library/Scores/Table/codesinsee.php
Normal file
39780
library/Scores/Table/codesinsee.php
Normal file
File diff suppressed because it is too large
Load Diff
6275
library/Scores/Table/codespostaux.php
Normal file
6275
library/Scores/Table/codespostaux.php
Normal file
File diff suppressed because it is too large
Load Diff
5
library/Scores/Table/dateCrea_ent.php
Normal file
5
library/Scores/Table/dateCrea_ent.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 19000101,
|
||||
'max'=> 20150501,
|
||||
);
|
5
library/Scores/Table/dateCrea_etab.php
Normal file
5
library/Scores/Table/dateCrea_etab.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 19000101,
|
||||
'max'=> 20150501,
|
||||
);
|
5
library/Scores/Table/dateImmat.php
Normal file
5
library/Scores/Table/dateImmat.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 18000101,
|
||||
'max'=> 20181003,
|
||||
);
|
5
library/Scores/Table/eff_entrep.php
Normal file
5
library/Scores/Table/eff_entrep.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 0,
|
||||
'max'=> 248500,
|
||||
);
|
5
library/Scores/Table/eff_etab.php
Normal file
5
library/Scores/Table/eff_etab.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 0,
|
||||
'max'=> 59700,
|
||||
);
|
5
library/Scores/Table/nbActio.php
Normal file
5
library/Scores/Table/nbActio.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 0,
|
||||
'max'=> 132,
|
||||
);
|
5
library/Scores/Table/nbEtab.php
Normal file
5
library/Scores/Table/nbEtab.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 1,
|
||||
'max'=> 11700,
|
||||
);
|
5
library/Scores/Table/nbPart.php
Normal file
5
library/Scores/Table/nbPart.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'min'=> 0,
|
||||
'max'=> 1024,
|
||||
);
|
@ -27,34 +27,36 @@ $(document).ready(function()
|
||||
e.preventDefault();
|
||||
var btn = $(this);
|
||||
var result = set(btn.attr('name'), btn.val());
|
||||
if (!result) {
|
||||
if (result===false) {
|
||||
alert('error');
|
||||
$('div.critere-one[name='+btn.attr('name')+']').button('reset');
|
||||
btn.button('reset');
|
||||
}
|
||||
});
|
||||
|
||||
$('div.ciblage-many button').change(function(e){
|
||||
$('div.ciblage-many button').click(function(e){
|
||||
e.preventDefault();
|
||||
var key = $(this).data('ciblagename');
|
||||
var values = $('select[name='+key+']:selected').val();
|
||||
var result = set(key, values);
|
||||
if (!result) {
|
||||
alert('error');
|
||||
$('div.critere-one[name='+btn.attr('name')+']').button('reset');
|
||||
if (result===false) {
|
||||
alert('error');
|
||||
}
|
||||
});
|
||||
|
||||
$('div.ciblage-range button').change(function(e){
|
||||
$('div.ciblage-range button').click(function(e){
|
||||
e.preventDefault();
|
||||
var key = $(this).data('ciblagename');
|
||||
var values = $('#slider-'+key).slider('getValue');
|
||||
alert(values);
|
||||
var result = set(key, values);
|
||||
if (result===false) {
|
||||
alert('error');
|
||||
}
|
||||
});
|
||||
|
||||
$('div.ciblage-rangedate button').change(function(e){
|
||||
$('div.ciblage-rangedate button').click(function(e){
|
||||
e.preventDefault();
|
||||
var key = $(this).data('ciblagename');
|
||||
var values = $('#slider-'+key).slider('getValue');
|
||||
|
||||
alert(values);
|
||||
});
|
||||
|
||||
@ -121,9 +123,7 @@ function set(key, value, ex) {
|
||||
ex = typeof ex !== 'undefined' ? ex : 0;
|
||||
$('#panel').html('<span class="glyphicon glyphicon-refresh img-rounded"></span>');
|
||||
var result = false;
|
||||
$.post('/comptage/index', { cle:key, valeur:value, exclude:ex }, function(data, status) {
|
||||
//Resume criteres content
|
||||
$.post('/index/criteres', { total:data.count, insee:data.insee }, function(data) { $('#panel').html(data); });
|
||||
$.post('/comptage/index', { cle:key, valeur:value, exclude:ex }, function(data, status) {
|
||||
if (data.error==1) {
|
||||
$('div#actionMessage').html('<div class="alert alert-danger"><strong>Erreur !</strong> Un problème technique est survenu.</div>');
|
||||
result = false;
|
||||
@ -132,7 +132,9 @@ function set(key, value, ex) {
|
||||
$('div#actionMessage').html('<div class="alert alert-warning"><strong>Information !</strong> Valeur saisi incorrecte.</div>');
|
||||
result = false;
|
||||
}
|
||||
return true;
|
||||
result = true;
|
||||
//Resume criteres content
|
||||
$.post('/index/criteres', { total:data.count, insee:data.insee }, function(data) { $('#panel').html(data); });
|
||||
}, 'json').error(function(){
|
||||
$('div#actionMessage').html('<div class="alert alert-danger"><strong>Erreur !</strong> Un problème inconnu est survenu.</div>');
|
||||
result = false;
|
||||
|
@ -40,4 +40,8 @@ body {
|
||||
|
||||
code {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
#panel div.alert {
|
||||
margin-bottom:0 !important;
|
||||
}
|
Loading…
Reference in New Issue
Block a user