Merge de la version 1.1

This commit is contained in:
Michael RICOIS 2012-02-15 17:14:30 +00:00
commit 919b6b584d
156 changed files with 1073 additions and 737 deletions

View File

@ -6,8 +6,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
$this->bootstrap('view');
$view = $this->getResource('view');
$pathStyle = '/styles';
$pathScript = '/scripts';
$pathStyle = '/themes/default/styles';
$pathScript = '/themes/default/scripts';
$view->setEncoding('UTF-8');
$view->doctype('XHTML1_STRICT');
@ -17,10 +17,9 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
->appendHttpEquiv('Content-Language', 'fr-FR');
$view->headLink()
->appendStylesheet($pathStyle.'/reset.css', 'all')
->appendStylesheet($pathStyle.'/jquery.qtip.css', 'all')
->appendStylesheet($pathScript.'/jstree/default/style.css')
->appendStylesheet($pathScript.'/jqueryui/jquery-ui.css', 'all')
->appendStylesheet('/themes/jstree/default/style.css')
->appendStylesheet('/themes/jqueryui/jquery-ui.css', 'all')
->appendStylesheet($pathStyle.'/main.css', 'all');
$view->headScript()
@ -29,11 +28,11 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
->appendFile($pathScript.'/jquery.cookie.js', 'text/javascript')
->appendFile($pathScript.'/jquery-ui.js', 'text/javascript')
->appendFile($pathScript.'/jquery.qtip.js', 'text/javascript')
->appendFile($pathScript.'/jquery.qtip.js', 'text/javascript')
->appendFile($pathScript.'/scripts.js', 'text/javascript')
->appendFile($pathScript.'/jquery.jstree.js', 'text/javascript')
->appendFile($pathScript.'/fields.js', 'text/javascript');
$view->headTitle()->setSeparator(' - ');
$view->headTitle('Odea');
}

View File

@ -23,11 +23,11 @@ resources.frontController.plugins.Comptage = "Application_Controller_Plugin_Comp
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
;Resource router Backend
resources.router.routes.admin.type = Zend_Controller_Router_Route
resources.router.routes.admin.route = "/backend/*"
resources.router.routes.admin.defaults.module = backend
resources.router.routes.admin.defaults.controller = index
resources.router.routes.admin.defaults.action = index
;resources.router.routes.admin.type = Zend_Controller_Router_Route
;resources.router.routes.admin.route = "/backend/*"
;resources.router.routes.admin.defaults.module = backend
;resources.router.routes.admin.defaults.controller = index
;resources.router.routes.admin.defaults.action = index
; initialize layout resource
resources.layout.layoutPath = APPLICATION_PATH "/layouts"

View File

@ -22,7 +22,7 @@
<?php }?>
</div>
<div id="attente" style="display:none;">
<img src="/images/ajax.gif" />
<img src="/themes/default/images/ajax.gif" />
</div>
<div id="control">
[<a href="<?=$this->url(array('controller'=>'comptage', 'action'=> 'reset'))?>">Initialiser les critères</a>],

View File

@ -1,24 +0,0 @@
<?php
class Backend_IndexController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
if($user->username != 'fzicaro' and $user->username != 'dlasserre')
$this->_redirect('/');
if ($user->customisation) {
$this->view->assign('preferences', $user->customisation);
}
}
}

View File

@ -1,20 +0,0 @@
<div id="tabs">
<ul>
<li><a href="#tabs-1">Gestion des utilisateurs</a></li>
<li><a href="#tabs-2">Gestion des comptages</a></li>
<li><a href="#tabs-3">Gestion des fichiers</a></li>
<li><a href="#tabs-4">Statistiques</a></li>
</ul>
<div id="tabs-1">
<?php //echo $this->action('index', 'entreprise')?>
</div>
<div id="tabs-2">
<?php //echo $this->action('index', 'economique')?>
</div>
<div id="tabs-3">
<?php //echo $this->action('index', 'geographique')?>
</div>
<div id="tabs-4">
<?php //echo $this->action('index', 'juridique')?>
</div>
</div>

View File

@ -2,16 +2,7 @@
class ArborescenceController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
// action body
}
/* Nafs */
public function nafAction()
{
$this->_helper->layout()->disableLayout();
@ -40,13 +31,16 @@ class ArborescenceController extends Libs_Controller
);
}
/* Geographiques */
public function geographiqueAction()
{
$this->_helper->layout()->disableLayout();
$object = new Object_Codepostaux();
$key = $this->getRequest()->getParam('key');
$this->view->assign('key', $key);
$this->view->regions = $object->geographique();
$this->view->key = $key;
$this->view->regions = $object->_getRegions();
}
public function geographiqueajaxAction()
@ -55,114 +49,38 @@ class ArborescenceController extends Libs_Controller
$this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest();
$key = $request->getParam('key');
$id = $request->getParam('id');
$niveau = $request->getParam('niveau');
$object = new Object_Codepostaux();
if($niveau == 0) {
echo ($object->_getDepartements($id));
} else if ($niveau == 1) {
echo ($object->_getCommunes($id));
}
}
/* Forme Juridique */
public function juridiqueAction()
{
$this->_helper->layout()->disableLayout();
$object = new Object_Formejuridique();
$key = $this->getRequest()->getParam('key');
$this->view->key = $key;
$this->view->formejuridiques = $object->_getParents();
}
public function juridiqueajaxAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$object = new Object_Formejuridique();
$request = $this->getRequest();
$id = $request->getParam('id');
if($id[0] == 'R') {
require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage();
$val = $session->getCritere('adr_cp');
$valuesCheckeds = array();
$valuesUndetermined = array();
if($val != null)
{
$values = explode(',', $val);
foreach($values as $valuesChecked) {
if(strlen($valuesChecked) == 5) {
$valuesUndetermined[] = substr($valuesChecked, 0, 2);
}
if(substr($valuesChecked, 0, 1) == 'D') {
$valuesCheckeds[] = substr($valuesChecked, 1);
} else if (substr($valuesChecked, 0, 1) == 'R') {
$table = new Table_Departements();
$sql = $table->select()->from('departements', array('numdep'))->where('codeRegionInsee = ?', substr($valuesChecked, 1));
$result = $table->fetchAll($sql)->toArray();
foreach($result as $item) {
$valuesCheckeds[] = $item['numdep'];
}
}
}
}
$region = substr($request->getParam('id'), 1);
$deps = new Table_Departements();
$sql = $deps->select()
->from('departements')
->where('codeRegionInsee = ?', $region);
$departements = $deps->fetchAll($sql)->toArray();
foreach($departements as $departement) {
$structure = array(
'data' => $departement['libdep'],
'attr' => array('id' => 'D'.$departement['numdep'], 'niveau' => 1),
'state' => 'closed',
'children' => array()
);
if(in_array($departement['numdep'], $valuesCheckeds)) {
$structure['attr']['class'] = 'jstree-checked';
}
if(in_array($departement['numdep'], $valuesUndetermined)) {
$structure['attr']['class'] = 'jstree-undetermined';
}
$departementTab[] = $structure;
}
echo json_encode($departementTab);
} else if ($id[0] == 'D')
{
require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage();
$val = $session->getCritere('adr_cp');
$valuesCheckeds = array();
if($val != null)
{
$values = explode(',', $val);
foreach($values as $valuesChecked) {
if(strlen($valuesChecked) == 5) {
$valuesCheckeds[] = $valuesChecked;
}
else if(substr($valuesChecked, 0, 1) == 'D') {
$table = new Table_Codepostauxs();
$sql = $table->select()->from('codepostaux', array('Codepos'))->where('Codepos LIKE "'.substr($valuesChecked, 1).'%"');
$results = $table->fetchAll($sql)->toArray();
foreach($results as $result) {
if(!in_array($result['Codepos'], $values))
$valuesCheckeds[] = $result['Codepos'];
}
} else if (substr($valuesChecked, 0, 1) == 'R') {
$Departements = new Table_Departements();
$sql = $Departements->select()->from('departements', array('numdep'))->where('codeRegionInsee = ?', substr($valuesChecked, 1));
$results = $Departements->fetchAll($sql)->toArray();
foreach($results as $result) {
$table = new Table_Codepostauxs();
$sql = $table->select()->from('codepostaux', array('Codepos'))->where('Codepos LIKE "'.$result['numdep'].'%"');
$codes = $table->fetchAll($sql)->toArray();
foreach($codes as $code) {
if(!in_array($result['Codepos'], $values))
$valuesCheckeds[] = $code['Codepos'];
}
}
}
}
}
$numdep = substr($request->getParam('id'), 1);
$code = new Table_Codepostauxs();
$sql = $code->select()
->from('codepostaux')
->where('Codepos LIKE "'.$numdep.'%"');
$codePostaux = $code->fetchAll($sql)->toArray();
foreach($codePostaux as $codePostau) {
$structure = array(
'data' => '[ '.$codePostau['Codepos'].' ]'.ucfirst(strtolower($codePostau['Commune'])),
'attr' => array('id' => $codePostau['Codepos'], 'niveau' => 2)
);
if(in_array($codePostau['Codepos'], $valuesCheckeds)) {
$structure['attr']['class'] = 'jstree-checked';
}
$CodePostauxTab[] = $structure;
}
echo json_encode($CodePostauxTab);
}
echo ($object->_getFils($id));
}
}

View File

@ -21,8 +21,10 @@ class ComptageController extends Libs_Controller
public function resetAction()
{
require_once 'Scores/SessionCiblage.php';
$erreurs = new Zend_Session_Namespace('erreurs');
$session = new SessionCiblage();
$session->clearCiblage();
unset($erreurs->erreurs);
$this->_redirect('./');
}

View File

@ -1,11 +1,10 @@
<?php
class DashboardController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
$this->view->headLink()->appendStylesheet('/themes/default/styles/dashboard.css', 'all');
$this->view->headScript()->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
}
public function indexAction()
@ -32,10 +31,13 @@ class DashboardController extends Libs_Controller
public function ciblagedetailAction()
{
$object = new Object_Dashboard();
$request = $this->getRequest();
$comptage = $object->ciblagedetail($request->getParam('id'));
$this->view->assign('comptages', $object->ciblagedetail($request->getParam('id')));
$this->view->criteres = $comptage['criteres'];
$this->view->comptages = $comptage['comptages'];
}
public function rcomptageAction()
@ -44,9 +46,28 @@ class DashboardController extends Libs_Controller
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$object = new Object_Dashboard();
$q = $request->getParam('q');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
echo $object->rcomptage(strtolower($this->getRequest()->getParam('q', '')));
$criteresM = new Table_Criteres();
$sql = $criteresM->select()
->from($criteresM, array('id', 'reference', "DATE_FORMAT(dateAjout, '%d/%m/%Y') as date"))
->where("idClient = ?", $user->idClient)
->where("login = ?", $user->username)
->where("reference LIKE ?", $q.'%');
$rows = $criteresM->fetchAll($sql);
if (count($rows)>0){
$separator = " , ";
foreach ($rows as $item) {
$output[] = array(
'label' => $item->reference . $separator . $item->date,
'value' => $item->reference,
'url' => $this->view->url(array('controller'=>'dashboard', 'action'=>'ciblagedetail', 'id'=>$item->id)),
);
}
}
echo json_encode($output);
}
public function configurationAction()

View File

@ -2,7 +2,6 @@
class EconomiqueController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
@ -11,13 +10,20 @@ class EconomiqueController extends Libs_Controller
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/styles/pages/'.$this->getRequest()->getControllerName().'.css', 'all');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$field = new Fields($user->username);
$this->view->fields = $field;
}
public function resetAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$session->resetFamille('economique');
}
}

View File

@ -0,0 +1,68 @@
<?php
class EnrichissementController extends Zend_Controller_Action
{
public function init()
{
$this->view->headScript()->appendFile('/themes/default/scripts/enrichissement.js', 'text/javascript');
$this->view->headLink()->appendStylesheet('/themes/default/styles/enrichissement.css');
}
/**
* Enter description here ...
*/
public function indexAction(){}
public function fileformAction()
{
$this->view->headScript()->appendFile('/themes/default/scripts/jquery.form.js', 'text/javascript');
$this->view->headScript()->appendFile('/themes/default/scripts/jqueryprogressbar.js', 'text/javascript');
$this->view->assign('filesize', ini_get('upload_max_filesize'));
}
public function fileuploadAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$config = Zend_Registrey::get('configuration');
$path = realpath($config->path->data).'/clients';
if(!file_exists($path)) mkdir($path);
if ( isset($_FILES) && count($_FILES)==1 ){
$n = $_FILES['fichier']['name'];
$s = $_FILES['fichier']['size'];
$tmp_name = $_FILES['fichier']['tmp_name'];
$name = $_REQUEST['ref'];
$extValide = array('csv');
$extension = strrchr($n,'.');
$extension = substr($extension,1);
//@todo : vérifier l'extension du fichier
if (move_uploaded_file($tmp_name, $path.'/'.$name.'.'.$extension)){
echo "Uploadé !";
} else {
echo "Erreur : ".$_FILES['fichier']['error'];
}
}
}
/**
* Etat de progression de l'upload du fichier
*/
public function fileprogressAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$key = $request->getParam('key', '');
if (!empty($key)) {
//$rep sera égal à false si la clef n'existe pas dans le cache apc
$rep = apc_fetch('upload_'.$key);
echo json_encode($rep);
}
}
}

View File

@ -2,7 +2,6 @@
class EntrepriseController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
@ -11,11 +10,20 @@ class EntrepriseController extends Libs_Controller
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/styles/pages/'.$this->getRequest()->getControllerName().'.css', 'all');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$field = new Fields($user->username);
$this->view->fields = $field;
}
public function resetAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$session->resetFamille('entreprise');
}
}

View File

@ -0,0 +1,43 @@
<?php
class ErreurController extends Libs_Controller
{
protected $correlation = array(
'siege' => array('fax', 'tel'),
'fax'=> array('siege'))
;
public function getAction()
{
$session = new Zend_Session_Namespace('erreurs');
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$key = $request->getParam('key');
$valeur = $request->getParam('valeur');
$this->correlation($key, $valeur);
$this->view->erreurs = $session->erreurs;
}
protected function correlation($key, $valeurs)
{
$session = new Zend_Session_Namespace('erreurs');
$session->erreurs[$key] = array('erreur' => false, 'valeur' => $valeurs);
foreach($session->erreurs as $erreur => $valeurs)
{
if(in_array($erreur, $this->correlation[$key]))
{
if($session->erreurs[$key]['valeur'] != 'tous')
$session->erreurs[$key]['erreur'] = true;
else
unset($session->erreurs[$key]);
}
}
}
}

View File

@ -1,5 +1,5 @@
<?php
class ErrorController extends Libs_Controller
class ErrorController extends Zend_Controller_Action
{
public function errorAction()
{
@ -14,6 +14,7 @@ class ErrorController extends Libs_Controller
$this->getResponse()->setHttpResponseCode(404);
$this->view->message = 'Page not found';
break;
default:
// application error
$this->getResponse()->setHttpResponseCode(500);

View File

@ -11,13 +11,20 @@ class FinancierController extends Libs_Controller
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/styles/pages/'.$this->getRequest()->getControllerName().'.css', 'all');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$field = new Fields($user->username);
$this->view->fields = $field;
}
public function resetAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$session->resetFamille('financier');
}
}

View File

@ -11,13 +11,20 @@ class GeographiqueController extends Libs_Controller
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/styles/pages/'.$this->getRequest()->getControllerName().'.css', 'all');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$field = new Fields($user->username);
$this->view->fields = $field;
}
public function resetAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$session->resetFamille('geographique');
}
}

View File

@ -1,5 +1,4 @@
<?php
Class IndexController extends Libs_Controller
{
@ -17,6 +16,14 @@ Class IndexController extends Libs_Controller
}
}
public function criteresAction()
{
$this->_helper->layout()->disableLayout();
require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage();
$this->view->criteres = $session->getCriteres();
}
}

View File

@ -11,13 +11,20 @@ class JuridiqueController extends Libs_Controller
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/styles/pages/'.$this->getRequest()->getControllerName().'.css', 'all');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$field = new Fields($user->username);
$this->view->fields = $field;
}
public function resetAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$session->resetFamille('juridique');
}
}

View File

@ -49,7 +49,7 @@ class UserController extends Libs_Controller
$url = $session->url;
}
}
if (!empty($url) && $url!='/user/login' && $url!='/localauth' && $url!='/favicon.ico'){
if (!empty($url) && $url!='/user/login' && $url!='/localauth' && $url != '/user/logout' && $url!='/favicon.ico'){
$this->_redirect($url);
}
$this->_redirect('/');

View File

@ -1,65 +1,126 @@
<?php
class Object_Codepostaux extends Libs_Row
{
public function geographique()
/* Selection des classes statut pour jstree */
public function _jstree_checked()
{
require_once 'Scores/SessionCiblage.php';
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$val = $session->getCritere('adr_cp');
$valeurs = explode(',', $session->getCritere('adr_com'));
$valuesCheckeds = explode(',', $val);
if(count($valuesCheckeds) > 0) {
for($i=0;count($valuesCheckeds) > $i;$i++) {
$valuesCheckeds[$i] = substr($valuesCheckeds[$i], 1);
foreach ($valeurs as $valeur)
$return[] = $valeur;
if(is_array($return))
return ($return);
return (array($valeurs));
}
}
$valuesUndetermined = array();
if($val != null)
public function _jstree_undetermined($niveau)
{
$values = explode(',', $val);
foreach($values as $valuesChecked) {
if(strlen($valuesChecked) == 5) {
$dept = substr($valuesChecked, 0, 2);
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$table = new Table_Departements();
$sql = $table->select()->from('departements', array('codeRegionInsee'))->where('numdep = ?',$dept);
$results = $table->fetchAll($sql)->toArray();
foreach($results as $result) {
$valuesUndetermined[] = $result['codeRegionInsee'];
}
}
if(substr($valuesChecked, 0, 1) == 'R') {
$valuesCheckeds[] = substr($valuesChecked, 1);
} else if (substr($valuesChecked, 0, 1) == 'D') {
$table = new Table_Departements();
$sql = $table->select()->from('departements', array('codeRegionInsee'))->where('numdep = ?', substr($valuesChecked, 1));
$result = $table->fetchAll($sql)->toArray();
foreach($result as $item) {
$valuesUndetermined[] = $item['codeRegionInsee'];
}
$valeurs = explode(',', $session->getCritere('adr_com'));
$in = array();
foreach($valeurs as $valeur) {
if($niveau == 0) {
if ($valeur[0] == 'D'){
$valeur = substr($valeur, 1, strlen($valeur));
$insee = $table->fetchAll($table->select('departements', array('codeRegionInsee'))
->where('numdep = ?', $valeur))->toArray();
foreach ($insee as $code)
$in[] = 'R'.$code['codeRegionInsee'];
} else{
$valeur = substr($valeur, 1, strlen($valeur));
$insee = $table->fetchAll($table->select('departements', array('codeRegionInsee'))
->where('numdep = ?', substr($valeur, 0, 2)))->toArray();
foreach ($insee as $code)
$in[] = $code;
}
} else if ($niveau == 1) {
$valeur = substr($valeur, 1, strlen($valeur));
$insee = $table->fetchAll($table->select('departements', array('codeRegionInsee'))
->where('numdep = ?', substr($valeur, 0, 2)))->toArray();
foreach ($insee as $code)
$in[] = $code;
}
}
$regionsM = new Table_Regions();
$sql = $regionsM->select()->from('regions');
$regions = $regionsM->fetchAll()->toArray();
return ($in);
}
public function _getClass($valeur, $niveau)
{
if(in_array($valeur, $this->_jstree_checked()))
return ('jstree-checked');
else if (in_array($valeur, $this->_jstree_undetermined($niveau)))
return ('jstree-undetermined');
}
/* Fonctions de construction de jstree */
public function _getRegions()
{
$region = new Table_Regions();
$regions = $region->fetchAll($region->select())->toArray();
$structure = array();
foreach($regions as $region) {
$structure = array(
'data' => $region['NCCENR'],
'attr' => array('id' => 'R'.$region['REGION'], 'niveau' => 0),
foreach($regions as $nom) {
$structure[] = array(
'data' => $nom['NCCENR'],
'attr' => array('id' => 'R'.$nom['REGION'],
'niveau' => 0,
'class' => $this->_getClass('R'.$nom['REGION'], 0)
),
'state' => 'closed',
'children' => array()
);
if(in_array($region['REGION'], $valuesCheckeds)) {
$structure['attr']['class'] = 'jstree-checked';
}
if(in_array($region['REGION'], $valuesUndetermined)) {
$structure['attr']['class'] = 'jstree-undetermined';
return (json_encode($structure));
}
$tabAdrDep[] = $structure;
public function _getDepartements($codeRegionInsee)
{
$departement = new Table_Departements();
$departements = $departement->fetchAll($departement->select()
->where('codeRegionInsee ='.substr($codeRegionInsee, 1, strlen($codeRegionInsee))))->toArray();
$structure = array();
foreach($departements as $nom) {
$structure[] = array(
'data' => $nom['libdep'],
'attr' => array('id' => 'D'.$nom['numdep'],
'niveau' => 1,
'class' => $this->_getClass('D'.$nom['numdep'], 1)
),
'state' => 'closed',
'children' => array()
);
}
return (json_encode($tabAdrDep));
return (json_encode($structure));
}
public function _getCommunes($numdep)
{
$numdep = substr($numdep, 1, strlen($numdep));
$codepostau = new Table_Codepostauxs();
$codepostaux = $codepostau->fetchAll($codepostau->select()->where('codepos LIKE "'.$numdep.'%"'))->toArray();
$structure = array();
foreach($codepostaux as $nom) {
$structure[] = array(
'data' => $nom['Commune'],
'attr' => array('id'=> $nom['INSEE'],
'niveau' => 2,
'class' => $this->_getClass($nom['INSEE'], 2)
),
'state' => 'closed',
'children' => array()
);
}
return (json_encode($structure));
}
}

View File

@ -68,7 +68,6 @@ class Object_Comptage extends Libs_Row
$sessionValeur = $session->getCritere($key);
$session->setCritere($key, $valeur);
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
require_once 'Scores/Field.php';

View File

@ -109,23 +109,20 @@ Class Object_Dashboard
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$table = new Table_Criteres();
$sql = $table->select()
->where('idClient = ?', $user->idClient)
->where('login = ?', $user->username)
->where('id = ?', $id);
$criteresM = new Table_Criteres();
$sql = $criteresM->select()
->where("idClient = ?", $user->idClient)
->where("login = ?", $user->username)
->where("id = ?", $id);
$criteres = $criteresM->fetchRow($sql);
$this->view->assign('criteres', $criteres->toArray());
$criteres = $table->fetchRow($sql)->toArray();
if ($criteres != null){
$comptagesM = new Table_Comptages();
$sql = $comptagesM->select()
$comptage = new Table_Comptages();
$sql = $comptage->select()
->where('idDefinition = ?', $id);
$comptages = $comptagesM->fetchAll($sql);
return ($comptages->toArray());
$comptages = $comptage->fetchAll($sql)->toArray();
}
return (array_merge(array('comptages' => $comptages), array('criteres' => $criteres)));
}
public function rcomptage($q)

View File

@ -1,5 +1,45 @@
<?php
class Object_Formejuridique extends Libs_Row
{
public function _getParents()
{
$formes = new Table_Formejuridiques();
$formes = $formes->fetchAll($formes->select()->where('LENGTH(fjCode) = 1'))->toArray();
$structure = array();
foreach($formes as $forme) {
$structure[] = array(
'data' => $forme['fjCode'].' : '.$forme['fjLibelle'],
'attr' => array('id' => $forme['fjCode']),
'state' => 'closed',
'children' => array($this->_getFils($forme['fjCode']))
);
}
return (json_encode($structure));
}
public function _getFils($fjcode)
{
$lenth = ((strlen($fjcode) == 2)?4:2);
$formes = new Table_Formejuridiques();
$sql = $formes->select()->from('formejuridique', array(
'size' => new Zend_Db_Expr('LENGTH(fjCode)'),
'fjCode',
'fjLibelle'))
->where('fjCode LIKE "'.$fjcode.'%"')
->having('size = ?', $lenth);
$formes = $formes->fetchAll($sql)->toArray();
$structure = array();
foreach($formes as $forme) {
$structure = array(
'data' => $forme['fjCode'].' : '.$forme['fjLibelle'],
'attr' => array('id' => $forme['fjCode']),
'state' => 'close',
'children' => (($lenth < 6)?$this->_getFils($forme['fjCode']):array())
);
$tabfj[] = $structure;
}
return ($tabfj);
}
}

View File

@ -35,7 +35,7 @@ class Object_Naf extends Libs_Row
}
$tabNaf[] = $structure;
}
return (json_encode($tabNaf));
return json_encode($tabNaf);
}
protected function getNafParent($value, $niveau1 = false)
@ -46,7 +46,7 @@ class Object_Naf extends Libs_Row
$new = substr($value,0,$niveau);
$out = array_merge($out, array($new), $this->getNafParent($new, $niveau1));
} elseif (strlen($value)==2 && $niveau1 === true) {
$nafM = new Application_Model_Naf();
$nafM = new Table_Nafs();
$sql = $nafM->select()
->from($nafM, array('parent'))
->where('code = ?', $value);
@ -101,7 +101,6 @@ class Object_Naf extends Libs_Row
}
$tabNaf[] = $structure;
}
echo 'cool';exit;
return (json_encode($tabNaf));
return json_encode($tabNaf);
}
}

View File

@ -0,0 +1,7 @@
<?php
class Table_Formejuridiques extends Libs_Table
{
protected $_name = 'formejuridique';
protected $_primary = 'fjCode';
}

View File

@ -0,0 +1,23 @@
<div id="<?=$this->key?>" class="jstree jstree-default" style="overflow:auto;"></div>
<script>
$("#<?=$this->key?>").jstree({
"themes" : {
"theme" : "default",
"url" : "/style.css",
"dots" : true,
"icons" : false,
},
"plugins" : ["themes", "json_data", "checkbox"],
"json_data" : {
"data" : <?=$this->formejuridiques?>,
"ajax" : {
"url" : '<?=$this->url(array('controller'=>'arborescence', 'action'=>'juridiqueajax', 'key'=> $this->key))?>',
"data" : function(n)
{
return { id: n.attr ? n.attr("id") : 0 };
},
"cache" : true,
}
}
});
</script>

View File

@ -3,7 +3,7 @@
$("#<?=$this->key?>").jstree({
"themes" : {
"theme" : "default",
"url" : "/style.css",
"url" : "/jstree/style.css",
"dots" : true,
"icons" : false,
},

View File

@ -11,7 +11,7 @@ Vous n'avez pas sélectionné de critères !
<span class="message" style="color:#ff0000;"></span>
</div>
<script type="text/javascript" src="/scripts/jquery.form.js"></script>
<script type="text/javascript" src="/themes/default/scripts/jquery.form.js"></script>
<script>
$('form#save').bind('submit', function(){
var options = {

View File

@ -1,45 +1,33 @@
<div id="dashboard">
<div class="dashboard" style="padding:10px">
<a href="/dashboard/index">Tableau de bord</a> > detail du ciblage
<div class="chemin">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
Détail du ciblage
</div>
<h2></h2>
<fieldset>
<legend>Critères</legend>
<?php foreach(json_decode($this->criteres['criteres'], true) as $critere => $valeur): ?>
<?php echo '<b>'.$critere . '</b> : '.$valeur;?>,
<?php endforeach;?>
</fieldset>
<?php if (empty($this->criteres)){?>
<p>Aucun ciblage n'a été trouvé avec ces paramètres.</p>
<?php } else {?>
<h1>Ciblage <?=$this->criteres['reference']?> (<?=$this->criteres['dateAjout']?>)</h1>
<h2>Critères</h2>
<pre>
<?=print_r(json_decode($this->criteres['criteres'], true))?>
</pre>
<h2>Comptages</h2>
<table style="width:100%">
<thead>
<tr>
<fieldset>
<legend>Comptages</legend>
<table style="width:100%">
<thead>
<tr>
<th>Date</th>
<th>Resultat</th>
<th>Nombre d'unité Insee</th>
</tr>
</thead>
<tbody>
<?php foreach($this->comptages as $comptage):?>
<tr>
</tr>
</thead>
<tbody>
<?php foreach($this->comptages as $comptage):?>
<tr>
<th><?=$comptage['dateAjout']?></th>
<th><?=number_format($comptage['resultat'], 0, '', ' ')?></th>
<th><?=number_format($comptage['uniteInsee'], 0, '', ' ')?></th>
</tr>
<?php endforeach;?>
</tbody>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php }?>
</fieldset>
</div>

View File

@ -2,7 +2,7 @@
<div class="chemin">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
Enrichissement fichier
Enrichissement de fichier
</div>
<a href="<?=$this->url(array('controller'=>'enrichissement', 'action'=>'fileform'))?>">Envoyer votre fichier pour enrichissement</a>

View File

@ -4,10 +4,10 @@
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a>
</div>
<div>
<div id="menu">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'ciblages'))?>">Historique de vos ciblages</a> -
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'configuration'))?>">Préférences de l'application</a> -
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'exports'))?>">Enrichissement fichier</a>
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'exports'))?>">Enrichissement de fichier</a>
</div>
<div id="rechercheCiblage">
@ -16,41 +16,40 @@
<input type="submit" value="Rechercher" class="submit"/>
</div>
<div id="lastCiblage" style="">
<h2>Vos derniers ciblages</h2>
<?php if(count($this->comptages)>0):?>
<table class="ciblage">
<thead>
<tr>
<div id="lastCiblage">
<h2>Vos derniers ciblages</h2>
<?php if(count($this->comptages) > 0):?>
<table>
<thead>
<tr>
<th>Référence</th>
<th>Nombre d'entité</th>
<th>Unité Insee</th>
<th colspan="4">actions sur vos comptages</th>
<th>Date</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<?php foreach($this->comptages as $item):?>
<tr>
<td><?=$item['reference']?></td>
<td><?=number_format($item['resultat'], 0, ',', ' ')?></td>
<td><?=number_format($item['uniteInsee'], 0, ',', ' ')?></td>
<td><?=$item['dateComptage']?></td>
<td>
[<a href="<?=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$item['id']))?>">Recharger les critères de ciblage</a>] -
[<a href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Actualiser le comptage</a>] -
[<a href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Enrichissement</a>]
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php else:?>
</tr>
</thead>
<tbody>
<?php foreach($this->comptages as $name => $item):?>
<tr class="tooltip" id="<?php echo $item['id'];?>">
<td class="reference"><?=$item['reference']?></td>
<td class="resultat"><?=number_format($item['resultat'], 0, ',', ' ')?></td>
<td class="insee"><?=number_format($item['uniteInsee'], 0, ',', ' ')?></td>
<td><a class="chargement" href="/dashboard/ciblagedetail/id/<?php echo $item['id'];?>">Detail</a></td>
<td><a href="<?//=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$item['id']))?>">Recharger les critères de ciblage</a></td>
<td><a href="<?//=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Actualiser le comptage</a></td>
<td><a href="<?//=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Enrichissement</a></td>
<td id="ch_<?php echo $item['id'];?>" class="date"><?=$item['dateComptage']?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php else:?>
<p>Aucun ciblage.<p>
<?php endif;?>
<?php endif;?>
</div>
<div id="lastEnrichissement">
<h2>Vos derniers enrichissements</h2>
</div>

View File

@ -16,5 +16,5 @@
</ul>
</div>
<div style="text-align:right;margin-top:20px;">
<a href="">Réinitialiser les critères entreprises</a>
<a class="resetFamille" id="economique">Réinitialiser les critères economiques</a>
</div>

View File

@ -0,0 +1,59 @@
<div id="enrichissement">
<div class="chemin">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
Enrichissement fichier > Envoi d'un fichier
</div>
<h2>Intégration d'un fichier</h2>
<p>Taille maximale d'un fichier : <?=$this->filesize?></p>
<form enctype="multipart/form-data" name="sendfile" action="<?=$this->url(array('controller'=>'enrichissement','action'=>'fileupload'))?>" method="post">
<input type="hidden" name="APC_UPLOAD_PROGRESS" id="key" value="<?=uniqid()?>"/>
<div class="fieldgrp">
<label>Référence</label>
<div class="field"><input type="text" name="ref" /></div>
</div>
<div class="fieldgrp">
<label>Fichier</label>
<div class="field">
<input type="file" id="fichier" name="fichier"/>
<input type="submit" value="Envoi"/>
<div id="progressbar"></div>
<div id="output"></div>
</div>
</div>
</form>
</div>
<script>
var timer;
$('form[name=sendfile]').ajaxForm({
beforeSubmit: function() {
timer = setInterval(checkProgress,200);
$('#progressbar').reportprogress(0);
$('#output').html('Envoi en cours...');
},
success: function(data) {
clearInterval(timer);
$('#progressbar').remove();
$('#output').html('<strong>' + data + '</strong>');
}
});
function checkProgress() {
$.get('<?=$this->url(array('controller'=>'enrichissement', 'action'=>'fileprogress'))?>',
{key: $('#key').val()}, function(data) {
var percent = data.current/data.total*100;
$('#progressbar').reportprogress(percent);
}, 'json');
}
</script>

View File

@ -1,21 +1,24 @@
<!-- <div class="erreur" id="entreprise">
</div> -->
<div id="entreprise">
<ul id="fieldsblock">
<li><?php echo $this->Field('siege', $this->fields->get('siege'));?></li>
<li><?php echo $this->Field('sirenGrp', $this->fields->get('sirenGrp'));?></li>
<li><?php echo $this->Field('tel', $this->fields->get('tel'));?></li>
<li><?php echo $this->Field('fax', $this->fields->get('fax'));?></li>
<li><?php echo $this->Field('web', $this->fields->get('web'));?></li>
<li><?php echo $this->Field('mail', $this->fields->get('mail'));?></li>
<li><?php echo $this->Field('presentRcs', $this->fields->get('presentRcs'));?></li>
<li><?php echo $this->Field('adrDom', $this->fields->get('adrDom'));?></li>
<li><?php echo $this->Field('dirNom', $this->fields->get('dirNom'));?></li>
<li><?php echo $this->Field('nbMPubli', $this->fields->get('nbMPubli'));?></li>
<li><?php echo $this->Field('dateCrea_ent',$this->fields->get('dateCrea_ent'));?></li>
<li><?php echo $this->Field('dateCrea_etab', $this->fields->get('dateCrea_etab'));?></li>
<li><?php echo $this->Field('nbActio', $this->fields->get('nbActio'));?></li>
<li><?php echo $this->Field('nbPart', $this->fields->get('nbPart'));?></li>
<li id="siege"><?php echo $this->Field('siege', $this->fields->get('siege'));?></li>
<li id="sirenGrp" ><?php echo $this->Field('sirenGrp', $this->fields->get('sirenGrp'));?></li>
<li id="tel" ><?php echo $this->Field('tel', $this->fields->get('tel'));?></li>
<li id="fax" ><?php echo $this->Field('fax', $this->fields->get('fax'));?></li>
<li id="web" ><?php echo $this->Field('web', $this->fields->get('web'));?></li>
<li id="mail" ><?php echo $this->Field('mail', $this->fields->get('mail'));?></li>
<li id="presentRcs" ><?php echo $this->Field('presentRcs', $this->fields->get('presentRcs'));?></li>
<li id="adrDom" ><?php echo $this->Field('adrDom', $this->fields->get('adrDom'));?></li>
<li id="dirNom" ><?php echo $this->Field('dirNom', $this->fields->get('dirNom'));?></li>
<li id="nbMPublic" ><?php echo $this->Field('nbMPubli', $this->fields->get('nbMPubli'));?></li>
<li id="li_dateCrea_etab" ><?php echo $this->Field('dateCrea_ent',$this->fields->get('dateCrea_ent'));?></li>
<li id="li_dateCrea_etab" ><?php echo $this->Field('dateCrea_etab', $this->fields->get('dateCrea_etab'));?></li>
<li id="nbActio" ><?php echo $this->Field('nbActio', $this->fields->get('nbActio'));?></li>
<li id="nbPart" ><?php echo $this->Field('nbPart', $this->fields->get('nbPart'));?></li>
</ul>
</div>
<div id="link">
<a href="">Réinitialiser les critères entreprises</a>
<a class="resetFamille" id="entreprise">Réinitialiser les critères entreprises</a>
</div>

View File

@ -0,0 +1,12 @@
<table style="width:100%">
<?php if(!empty($this->erreurs)): ?>
<?php foreach($this->erreurs as $erreur => $valeur):?>
<?php if($valeur['erreur'] and $valeur['valeur'] != 'tous'): ?>
<tr style="border:1px solid red;">
<td style="padding:10px"><?php echo $erreur; ?></td>
<td style="padding:10px"><?php echo $valeur['valeur']; ?></td>
</tr>
<?php endif; ?>
<?php endforeach;?>
<?php endif; ?>
</table>

View File

@ -21,3 +21,6 @@
<li><?php echo $this->Field('bilYP', $this->fields->get('bilYP'));?></li>
</ul>
</div>
<div style="text-align:right;margin-top:20px;">
<a class="resetFamille" id="financier">Réinitialiser les critères financiers</a>
</div>

View File

@ -1,9 +1,8 @@
<div id="geographique">
<ul id="fieldsblock">
<li><?php echo $this->Field('adr_cp', $this->fields->get('adr_cp'));?></li>
<li><?php echo $this->Field('adr_com', $this->fields->get('adr_com'));?></li>
</ul>
</div>
<div style="text-align:right;margin-top:20px;">
<a href="">Réinitialiser les critères entreprises</a>
<a class="resetFamille" id="econmique">Réinitialiser les critères geographiques</a>
</div>

View File

@ -0,0 +1,11 @@
<h1>Rapelle de vos critères de selections</h1>
<table style="margin-top:15px">
<?php foreach($this->criteres as $critere => $valeur):?>
<?php if($valeur != 'tous' and $valeur != null):?>
<tr>
<td style="width:150px"><b style="text-decoration: underline"><?php echo $critere;?></b></td>
<td><?php echo $valeur;?></td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</table>

View File

@ -1,5 +1,5 @@
<div id="panel">
<?php //echo $this->action('index', 'comptage', 'frontend');?>
</div>
<div id="tabs">
<ul>

View File

@ -8,5 +8,5 @@
</ul>
</div>
<div style="text-align:right;margin-top:20px;">
<a href="">Réinitialiser les critères entreprises</a>
<a class="resetFamille" id="econmique">Réinitialiser les critères juridique</a>
</div>

View File

@ -1,4 +0,0 @@
<br /><br />
<div id="view-content">
<p>View script for controller <b>Arborescence</b> and script/action name <b>naf</b></p>
</div>

View File

@ -1,4 +0,0 @@
<br /><br />
<div id="view-content">
<p>View script for controller <b>Arborescence</b> and script/action name <b>nafajax</b></p>
</div>

View File

@ -1,4 +0,0 @@
<br /><br />
<div id="view-content">
<p>View script for controller <b>Dashboard</b> and script/action name <b>ciblagedetail</b></p>
</div>

View File

@ -1,4 +0,0 @@
<br /><br />
<div id="view-content">
<p>View script for controller <b>Dashboard</b> and script/action name <b>ciblages</b></p>
</div>

View File

@ -1,4 +0,0 @@
<br /><br />
<div id="view-content">
<p>View script for controller <b>Dashboard</b> and script/action name <b>configuration</b></p>
</div>

View File

@ -1,4 +0,0 @@
<br /><br />
<div id="view-content">
<p>View script for controller <b>Dashboard</b> and script/action name <b>exports</b></p>
</div>

View File

@ -1,4 +0,0 @@
<br /><br />
<div id="view-content">
<p>View script for controller <b>Dashboard</b> and script/action name <b>menu</b></p>
</div>

View File

@ -1,4 +0,0 @@
<br /><br />
<div id="view-content">
<p>View script for controller <b>Dashboard</b> and script/action name <b>rcomptage</b></p>
</div>

View File

@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS `enrichissement_commandes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idComptage` int(11) NOT NULL,
`idProfil` int(11) NOT NULL,
`fichier` varchar(100) NOT NULL,
`nbLigneTotales` int(11) NOT NULL,
`nbLigneTraites` int(11) NOT NULL,
`uniteInsee` int(11) NOT NULL DEFAULT '0',
`error` varchar(100) NOT NULL,
`dateAdded` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`dateStart` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`dateStop` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;

View File

@ -1,4 +1,4 @@
CREATE TABLE IF NOT EXISTS `profilextraction` (
CREATE TABLE IF NOT EXISTS `enrichissement_profils` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idClient` int(11) NOT NULL,
`login` VARCHAR( 50 ) NOT NULL,
@ -6,9 +6,8 @@ CREATE TABLE IF NOT EXISTS `profilextraction` (
`criteres` text NOT NULL,
`tarifLigne` float NOT NULL,
`dateAjout` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`dateModif` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`dateSuppr` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`actif` tinyint(4) NOT NULL,
PRIMARY KEY (`id`),
KEY `idClient` (`idClient`)
) DEFAULT CHARSET=utf8 COMMENT='Profil d''extraction' AUTO_INCREMENT=1 ;
) DEFAULT CHARSET=utf8 COMMENT='Profil d''extraction';

View File

@ -3,7 +3,6 @@ CREATE TABLE IF NOT EXISTS `comptages` (
`idDefinition` int(11) NOT NULL,
`resultat` int(11) NOT NULL,
`uniteInsee` int(11) NOT NULL,
`tarif` varchar(20) NOT NULL,
`dateAjout` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8 COMMENT='Résultat des comptages' AUTO_INCREMENT=1 ;
) DEFAULT CHARSET=utf8 COMMENT='Résultat des comptages';

View File

@ -9,4 +9,4 @@ CREATE TABLE IF NOT EXISTS `criteres` (
PRIMARY KEY (`id`),
KEY `reference` (`reference`),
KEY `login` (`login`)
) DEFAULT CHARSET=utf8 COMMENT='Sauvegarde des critères pour les comptages' AUTO_INCREMENT=1 ;
) DEFAULT CHARSET=utf8 COMMENT='Sauvegarde des critères pour les comptages' ;

View File

@ -1,7 +0,0 @@
CREATE TABLE IF NOT EXISTS `refexport` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idComptage` int(11) NOT NULL,
`fichier` varchar(100) NOT NULL,
`dateExport` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8 COMMENT='Sauvegarde des noms de fichier pour chaque export' AUTO_INCREMENT=1 ;

View File

@ -28,13 +28,11 @@ Class Ciblage
$this->sphinx->SetServer($this->sphinx_host, $this->sphinx_port);
$this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED2);
$this->sphinx->ResetFilters();
foreach($structure as $key => $valeur)
{
foreach($structure as $key => $valeur) {
if (method_exists($this, $key)) {
if(is_array($valeur)) {
if($valeur[0] != "" and $valeur[0] != 'tous'){
if($valeur[0] != "" and $valeur[0] != 'tous')
$this->$key($valeur);
}
} else {
if($valeur != 'tous' and $valeur != "")
$this->$key($valeur);
@ -228,7 +226,7 @@ Class Ciblage
$valeur = $format[2].$format[1].$format[0];
} else {
$format1 = explode('/', $valeur[0]);
$format2 = explode('/', $valeur[0]);
$format2 = explode('/', $valeur[1]);
$valeur[0] = $format1[2].$format1[1].$format1[0];
$valeur[1] = $format2[2].$format2[1].$format2[0];
@ -243,7 +241,7 @@ Class Ciblage
$valeur = $format[2].$format[1].$format[0];
} else {
$format1 = explode('/', $valeur[0]);
$format2 = explode('/', $valeur[0]);
$format2 = explode('/', $valeur[1]);
$valeur[0] = $format1[2].$format1[1].$format1[0];
$valeur[1] = $format2[2].$format2[1].$format2[0];
@ -362,7 +360,8 @@ Class Ciblage
}
protected function avisCs($valeur) {
$this->setFilte('avisCs', $valeur);
$valeur = explode('-', $valeur);
$this->setFilter('avisCs', $valeur);
}
protected function bilFS($valeur) {

View File

@ -4,16 +4,16 @@ Class Fields
protected $fields = array
(
'siege' => array(
'label' => 'Sociétés Sieges',
'label' => 'Type d\'établissement',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
'select' => array('value' => array('1' => 'Sièges uniquement', '0' => 'Secondaires')),
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'select'
),
'sirenGrp' => array(
'label' => 'Société appartenant à un groupe',
'label' => 'Présence d\'un groupe',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
),
@ -22,7 +22,7 @@ Class Fields
'type' => 'select'
),
'tel' => array(
'label' => 'Contenant un Telephone',
'label' => 'Téléphone renseigné',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
@ -31,7 +31,7 @@ Class Fields
'type' => 'select'
),
'fax' => array(
'label' => 'Contenant un Fax',
'label' => 'Télécopie renseignée',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
@ -41,7 +41,7 @@ Class Fields
'class' => null
),
'web' => array(
'label' => 'Contenant un site internet',
'label' => 'Site Web renseigné',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
@ -51,7 +51,7 @@ Class Fields
'class' => null
),
'mail' => array(
'label' => 'Contenant une adresse email',
'label' => 'Email de contact renseigné',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
@ -61,9 +61,9 @@ Class Fields
'class' => null
),
'presentRcs' => array(
'label' => 'Société présente au RNCS',
'label' => 'Etablissement présent au RNCS',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
'select' => array('value' => array('1' => 'Etablissement présent au RNCS', '0' => 'Non'))
),
'famille' => 'entreprise',
'activated' => true,
@ -71,7 +71,7 @@ Class Fields
'class' => null
),
'adrDom' => array(
'label' => 'A une adresse de domiciliation',
'label' => 'Adresse de domiciliation',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
@ -81,9 +81,9 @@ Class Fields
'class' => null
),
'dirNom' => array(
'label' => 'Contenant le nom du principal dirigeant',
'label' => 'Nom du principal dirigeant',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
'select' => array('value' => array('1' => 'Principal dirigeant renseigné', '0' => 'Non'))
),
'famille' => 'entreprise',
'activated' => true,
@ -102,13 +102,13 @@ Class Fields
'class' => null
),
'nbMPubli' => array(
'label' => 'Nombre de marches publiques remportes',
'label' => 'Marchés publiques remportés',
'fields' => array(
'interval' => array('value' => array('0', '1000'))
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'interval',
'type' => 'select',
'class' => null
),
'dateCrea_ent' => array(
@ -122,7 +122,7 @@ Class Fields
'class' => 'datepicker'
),
'dateCrea_etab' => array(
'label' => 'Date de création de l\'etablissement',
'label' => 'Date de création de l\'établissement',
'fields' => array(
'interval' => array('value' => array('0', '1000'))
),
@ -153,7 +153,7 @@ Class Fields
),
// economique
'ape_etab' => array(
'label' => 'Codes NAF Etablissement',
'label' => 'Activité de l\'établissement (Code NAF)',
'fields' => array(
'text' => array('value' => null),
'textarea' => array('value' => null)
@ -166,7 +166,7 @@ Class Fields
'title' => 'Selection des codes NAF etablissement'
),
'ape_entrep' => array(
'label' => 'Codes NAF Entreprise',
'label' => 'Activité de l\'entreprise (Code NAF)',
'fields' => array(
'text' => array('value' => null),
'textarea' => array('value' => null)
@ -201,7 +201,7 @@ Class Fields
'class' => null
),
'age_etab' => array(
'label' => 'L\'age de l\'etablissement',
'label' => 'Age de l\'entreprise',
'fields' => array(
'interval' => array('value' => null)
),
@ -211,7 +211,7 @@ Class Fields
'class' => null
),
'age_entrep' => array(
'label' => 'L\'age de l\'entreprise',
'label' => 'Age de l\'établissement',
'fields' => array(
'interval' => array('value' => null)
),
@ -247,7 +247,7 @@ Class Fields
'class' => null,
),
'teff_etab' => array(
'label' => 'Tranche d\'effectif de l\'etablissement',
'label' => 'Tranche d\'effectif de l\'établissement',
'fields' => array(
'intervalSelect' => array(
'value' => array(
@ -275,7 +275,7 @@ Class Fields
'class' => null
),
'nbEtab' => array(
'label' => 'Nombre d\'établassiment',
'label' => 'Nombre d\'établissements',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -324,8 +324,8 @@ Class Fields
'class' => null
),
//geographique
'adr_cp' => array(
'label' => 'Codes postaux',
'adr_com' => array(
'label' => 'Code commune Insee',
'fields' => array(
'text' => array('value' => null),
'textarea' => array('value' => null)
@ -337,27 +337,19 @@ Class Fields
'action' => 'geographique',
'title' => 'Localisation'
),
'adr_com' => array(
'label' => 'Code commune Insee',
'fields' => array(
'text' => array('value' => null),
'textarea' => array('value' => null)
),
'famille' => 'geographique',
'activated' => true,
'type' => 'textarea',
'class' => null
),
//juridique
'cj' => array(
'label' => 'Forme Juridique',
'fields' => array(
'select' => array('value' => array('1' => '1', '2' => '2', '3' => '3')),
'text' => array('value' => null),
'textarea' => array('value' => null)
),
'famille' => 'juridique',
'activated' => true,
'type' => 'select',
'class' => null
'type' => 'textarea',
'class' => null,
'action' => 'juridique',
'title' => 'Forme Juridique'
),
'actifEco' => array(
'label' => 'Établissement économiquement actif',
@ -370,7 +362,7 @@ Class Fields
'class' => null
),
'procolHisto' => array(
'label' => 'Procédure collective dans l\'historique.',
'label' => 'Présence procédure collective dans histo',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
),
@ -380,7 +372,7 @@ Class Fields
'class' => null
),
'tvaIntraValide' => array(
'label' => 'Numéro de TVA Valide',
'label' => 'Numéro de TVA intracommunautaire valide',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
),
@ -403,7 +395,7 @@ Class Fields
'bilType' => array(
'label' => 'Type du dernier bilan',
'fields' => array(
'select' => array('value' => array('I' => 'Inconnue', 'E' => 'Estimé', 'R' => 'Réel')),
'select' => array('value' => array('I' => 'Inconnue', 'R' => 'Réel', 'E' => 'Estimé')),
),
'famille' => 'financier',
'activated' => true,
@ -413,31 +405,58 @@ Class Fields
'avisCs' => array(
'label' => 'Informations de paiements',
'fields' => array(
'interval' => array('value' => null),
'select' => array('value' => array(
'' => 'Risque indéterminé',
'00' => 'Aucun risque resencé',
'10' => 'Présence d\'impayé(s)',
'15' => 'Présence de privilèges',
'23-29-39-43' => 'Risque moyen',
'21-26-28' => 'Risque important',
'31-50' => 'Risque très important',
'24' => 'Risque dans le groupe')
),
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'type' => 'select',
'class' => null
),
'bilDuree' => array(
'label' => 'Durée du dernier bilan en mois',
'fields' => array(
'interval' => array('value'=> null),
'intervalSelect' => array(
'value' => array(
array(0, 5),
array(5, 10),
array(10, 15),
array(20, 23),
)
)
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'type' => 'intervalSelect',
'class' => null
),
'bilTca' => array(
'label' => 'Tranche de CA issue du bilan',
'fields' => array(
'interval' => array('value' => null),
'select' => array('value' => array(
'0' => 'Non déterminée',
'1' => 'de 500K€ à1M€',
'2' => 'de 1 à 2 ME',
'3' => 'de 2 à 5 ME',
'4' => 'de 5 à 10 ME',
'5' => 'de 10 à 20 ME',
'6' => 'de 20 à 50 ME',
'7' => '50 à 100 ME',
'8' => 'de 100 à 200 ME',
'9' => '+ de 200 ME'
)),
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'type' => 'select',
'class' => null
),
'bilAnnee' => array(
@ -461,7 +480,7 @@ Class Fields
'class' => 'datepicker'
),
'bilEE' => array(
'label' => 'Total bilan',
'label' => 'Total bilan (EE)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -471,7 +490,7 @@ Class Fields
'class' => null
),
'bilFL' => array(
'label' => 'CA total',
'label' => 'CA total (FL)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -481,7 +500,7 @@ Class Fields
'class' => null
),
'bilFK' => array(
'label' => 'Chiffre d\'affaires Export',
'label' => 'Chiffre d\'affaires Export (FK)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -491,7 +510,7 @@ Class Fields
'class' => null
),
'bilFR' => array(
'label' => 'Produits d\'Exploitation',
'label' => 'Produits d\'Exploitation (FR)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -501,7 +520,7 @@ Class Fields
'class' => null
),
'bilGF' => array(
'label' => 'Charges d\'Exploitation',
'label' => 'Charges d\'Exploitation (GF)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -511,17 +530,7 @@ Class Fields
'class' => null
),
'bilGP' => array(
'label' => 'Produits Financiers',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilGP' => array(
'label' => 'Charges Financières',
'label' => 'Charges Financières (GP)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -531,7 +540,7 @@ Class Fields
'class' => null
),
'bilGW' => array(
'label' => 'RCAI (résultat courant avant impôt)',
'label' => 'R.C.A.I - Résultat courant av. impôt (GW)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -541,7 +550,7 @@ Class Fields
'class' => null
),
'bilHD' => array(
'label' => 'Produits Exceptionnels',
'label' => 'Produits Exceptionnels (HD)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -551,7 +560,7 @@ Class Fields
'class' => null
),
'bilHH' => array(
'label' => 'Charges Exceptionnels',
'label' => 'Charges Exceptionnels (HH)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -561,7 +570,7 @@ Class Fields
'class' => null
),
'bilHL' => array(
'label' => 'Total des Produits',
'label' => 'Total des Produits (HL)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -571,7 +580,7 @@ Class Fields
'class' => null
),
'bilHM' => array(
'label' => 'Total des Charges',
'label' => 'Total des Charges (HM)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -581,7 +590,7 @@ Class Fields
'class' => null
),
'bilHN' => array(
'label' => 'Résultat',
'label' => 'Résultat (HN)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -591,7 +600,7 @@ Class Fields
'class' => null
),
'bilYP' => array(
'label' => 'Effectif de l\'entreprise au dernier bilan (poste YP)',
'label' => 'Effectif salarié (YP)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
@ -611,6 +620,7 @@ Class Fields
foreach($session->getCriteres() as $key => $item)
{
if($item != '') {
if($this->fields[$key]['type'] == 'interval' or
$this->fields[$key]['type'] == 'intervalSelect' or
$this->fields[$key]['type'] == 'textarea' and
@ -623,6 +633,7 @@ Class Fields
$values[$key] = $item;
}
}
}
return ($values);
}
@ -637,18 +648,76 @@ Class Fields
foreach($nafs as $naf)
$values = array_merge($values, $this->nafArbo($name, $naf));
break;
case 'adr_cp':
case 'adr_com':
$valeurs = explode(',', $valeur);
foreach($valeurs as $element) {
$array = $this->deptArbo($name, $element);
$array = $this->localisationArbo($name, $element);
if(!empty($array))
$values = array_merge($values, $array);
}
break;
case 'cj':
$valeurs = explode(',', $valeur);
foreach($valeurs as $valeur)
$values = array_merge($values, $this->fj($name, $valeur));
}
return ($values);
}
protected function fj($name, $valeur)
{
$table = new Table_Formejuridiques();
if(strlen($valeur) < 5) {
$sql = $table->select('formejuridique', array('fjCode'))
->where('fjCode LIKE "'.$valeur.'%"');
} else
$sql = $table->select('formejuridique', array('fjCode'))
->where('fjCode = "'.$valeur.'"');
$result = $table->fetchAll($sql)->toArray();
foreach ($result as $code) {
if(strlen($code['fjCode']) > 2) {
$return[] = $code['fjCode'];
}
}
return ($return);
}
protected function localisationArbo($name, $valeur)
{
if(strlen($valeur) == 3) {
switch($valeur[0]) {
case 'R':
$table = new Table_Departements();
$sql = $table->select()
->from('departements')
->join(array('cp' => 'codepostaux'), 'cp.codepos LIKE CONCAT(departements.numdep, "%")', array('INSEE'))
->where('codeRegionInsee ='.substr($valeur, 1, strlen($valeur)))
->setIntegrityCheck(false);
$result = $table->fetchAll($sql)->toArray();
foreach ($result as $res) {
$return[] = $res['INSEE'];
}
break;
case 'D':
$table = new Table_Departements();
$sql = $table->select()
->from('departements')
->join(array('cp' => 'codepostaux'), 'cp.codepos LIKE CONCAT(departements.numdep, "%")', array('INSEE'))
->where('numdep ='.substr($valeur, 1, strlen($valeur)))
->setIntegrityCheck(false);
$result = $table->fetchAll($sql)->toArray();
foreach ($result as $res) {
$return[] = $res['INSEE'];
}
break;
}
} else
return (array($valeur));
return ($return);
}
protected function deptArbo($name, $valeur)
{
if(strlen($valeur) < 5){

View File

@ -1,33 +0,0 @@
<?php
define('MYSQL_HOST', '192.168.78.230');
define('MYSQL_USER', 'sphinx');
define('MYSQL_PASS', 'indexer');
define('MYSQL_DEFAULT_DB', 'jo');
Class ConfigurationGenerique
{
public static $debug = true;
public static $redevance_insee = 3.295;
public static $api = '2.0.2';
public function __construct(){set_limit(0);}
}
Class ConfigurationCiblage extends ConfigurationGenerique
{
public static $index = 'ciblage';
public static $nb_results = 5000;
public static $max_results = 500000;
public static $mysql_host = MYSQL_HOST;
public static $mysql_user = MYSQL_USER;
public static $mysql_password = MYSQL_PASS;
public static $mysql_database = MYSQL_DEFAULT_DB;
public static $sphinx_host = '192.168.78.252';
public static $sphinx_port = 3312;
public static $sphinx_match = SPH_MATCH_EXTENDED2;
public static $sphinx_sort = SPH_SORT_EXTENDED;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 B

View File

@ -1,16 +0,0 @@
$(document).ready(function(){
//Autocomplete de recherche
$('input.searchCiblage').autocomplete({
delay:600,
source: function(request, response) {
$.getJSON('/dashboard/rcomptage', { q: request.term },
function(data) { response(data); }
);
},
select: function(event, ui){
window.location.href=ui.item.url;
}
});
});

View File

@ -1,34 +0,0 @@
#rechercheCiblage {
margin:5px 0;
}
#rechercheCiblage input.searchCiblage {
border:1px solid;
padding:3px 5px;
}
#rechercheCiblage input.searchCiblage:focus {
border:1px solid #4D90FE;
}
#rechercheCiblage input.submit {
font-weight:bold;
padding:2px 5px;
background-color:#4D90FE;
color:#ffffff;
border:1px solid #3079ED;
}
ul.ui-autocomplete {
width:250px;
font-size:0.9em;
}
.ui-autocomplete-loading {
background:white url('/themes/jqueryui/smoothness/ui-anim_basic_16x16.gif') right center no-repeat;
}
#lastCiblage {
margin:5px 0;
}

View File

@ -1,13 +0,0 @@
*, html, body, div, dl, dt, dd, h1, h2, h3, h4, h5, h6, pre, form, label, fieldset, input, p, blockquote, th, td { margin:0; padding:0 }
table { border-collapse:collapse; border-spacing:0 }
fieldset, img { border:0 }
address, caption, cite, code, dfn, em, strong, th, var { font-style:normal; font-weight:normal }
caption, th { text-align:left }
h1, h2, h3, h4, h5, h6 { font-size:100%; font-weight:normal }
q:before, q:after { content:''}
/* Global reset-RESET */
/* The below restores some sensible defaults */
strong { font-weight: bold }
em { font-style: italic }
a img { border:none } /* Gets rid of IE's blue borders */

View File

Before

Width:  |  Height:  |  Size: 404 B

After

Width:  |  Height:  |  Size: 404 B

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 987 B

After

Width:  |  Height:  |  Size: 987 B

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 655 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 897 B

After

Width:  |  Height:  |  Size: 897 B

View File

Before

Width:  |  Height:  |  Size: 495 B

After

Width:  |  Height:  |  Size: 495 B

View File

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 112 B

View File

Before

Width:  |  Height:  |  Size: 289 B

After

Width:  |  Height:  |  Size: 289 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 897 B

After

Width:  |  Height:  |  Size: 897 B

View File

Before

Width:  |  Height:  |  Size: 495 B

After

Width:  |  Height:  |  Size: 495 B

View File

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 112 B

View File

Before

Width:  |  Height:  |  Size: 987 B

After

Width:  |  Height:  |  Size: 987 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 897 B

After

Width:  |  Height:  |  Size: 897 B

View File

Before

Width:  |  Height:  |  Size: 495 B

After

Width:  |  Height:  |  Size: 495 B

View File

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 112 B

View File

Before

Width:  |  Height:  |  Size: 660 B

After

Width:  |  Height:  |  Size: 660 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

View File

Before

Width:  |  Height:  |  Size: 495 B

After

Width:  |  Height:  |  Size: 495 B

View File

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 112 B

View File

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 332 B

View File

Before

Width:  |  Height:  |  Size: 302 B

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 316 B

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,33 @@
$(document).ready(function(){
//Autocomplete de recherche
$('input.searchCiblage').autocomplete({
delay:600,
source: function(request, response) {
$.getJSON('/dashboard/rcomptage', { q: request.term },
function(data) { response(data); }
);
},
select: function(event, ui){
window.location.href=ui.item.url;
}
});
$(".tooltip").click(function(){
var id = $(this).attr('id');
var date = $('#ch_'+id).html();
$('#ch_'+id).html('<img src="/themes/default/images/ajax.gif" />');
$.ajax({
type : "GET",
cache : false,
url : 'dashboard/ciblagedetail/id/'+id,
data : $(this).serializeArray(),
success: function(data) {
$('#ch_'+id).html(date);
$('.previsualisation').html(data);
}
});
});
});

View File

@ -1,5 +1,5 @@
$(document).ready(function(){
$(document).ready(function()
{
$( "#tabs" ).tabs({
cookie: { expires: 1 }
});
@ -80,22 +80,26 @@ $(document).ready(function(){
$('#tabs').delegate('select.criteres', 'change', function(e){
var valeur = $(this, ':selected').val();
e.stopPropagation();
colorLine(valeur, $(this).attr('name'));
set($(this).attr('name'), $(this, ':selected').val());
});
$('#tabs').delegate('input[type=checkbox].criteres', 'click', function(e){
e.stopPropagation();
colorLine(valeur, $(this).attr('name'));
set($(this).attr('name'), $(this).val());
});
$('#tabs').delegate('input[type=radio].criteres', 'click', function(e){
e.stopPropagation();
colorLine(valeur, $(this).attr('name'));
set($(this).attr('name'), $(this).val());
});
$('#tabs').delegate('input[type=text].criteres', 'blur', function(e){
e.stopPropagation();
colorLine(valeur, $(this).attr('name'));
set($(this).attr('name'), $(this).val());
});
@ -108,33 +112,20 @@ $(document).ready(function(){
e.preventDefault();
var key = $(this).attr('id');
var values = $('input[name='+key+'1]').val() + ',' + $('input[name='+key+'2]').val();
colorLine(values, 'li_'+key);
set(key, values);
return false;
});
/* Cacher le lien validé dans le cas ou les données ne sont pas coohérantes */
$('.intervalSelect').change(function(){
var key = $(this).attr('id');
var number = $(this).attr('number');
if(number == 1) {
if($(this).val() > $('select[name='+key+'2] option:selected').val()){
$('span#'+key).html('');
$('.error').css('display', 'block');
$('.error div').html('<b>'+key+'</b> : '+$(this).val()+' supérieur '+$('select[name='+key+'2] option:selected').val()+', Donnée incohérantes.');
}else {
$('.error').css('display', 'none');
$('span#'+key).html(' <span id="'+key+'"><a href="" class="intervalSelect" id="'+key+'">Valider</a></span>');
}
}else {
if($(this).val() < $('select[name='+key+'1] option:selected').val()){
$('span#'+key).html('');
$('.error').css('display', 'block');
$('.error div').html('<b>'+key+'</b> : '+$(this).val()+' inférieur '+$('select[name='+key+'1] option:selected').val()+', Donnée incohérantes.');
}else {
$('span#'+key).html(' <span id="'+key+'"><a href="" class="intervalSelect" id="'+key+'">Valider</a></span>');
}
}
});
$('#tabs').delegate('a.intervalSelect', 'click', function(e){
@ -177,19 +168,41 @@ $(document).ready(function(){
return false;
});
$('.resetFamille').click(function(){
var famille = $(this).attr('id');
$.ajax({
type : "GET",
cache : false,
url : famille+'/reset',
data : $(this).serializeArray(),
success: function(data) {
set(null, null);
}
});
});
});
function set(key, value)
{
$('#comptage').css('display', 'none');
$('#attente').css('display', 'block');
$('#panel').html('<img src="/themes/default/images/ajax.gif" />');
$.post('/comptage', { cle:key, valeur:value}, function(data, status) {
var html = 'Nombre sélectionnées : <span class="valeur">' +
data.count + '</span> (dont <span class="valeur">'+
data.insee +'</span> unité(s) insee)';
$('#attente').css('display', 'none');
$('#comptage').html(html).css('display','block');
$.ajax({
type : "GET",
cache : false,
url : '/index/criteres',
data : $(this).serializeArray(),
success: function(data) {
$('#panel').html(data);
}
});
}, 'json')
.error(function(){ alert('error'); });
}

Some files were not shown because too many files have changed in this diff Show More