Compare commits
303 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4bf2ca7a4b | ||
|
8c4fb83566 | ||
|
6889d5294a | ||
|
57aa0bc875 | ||
|
77368058b1 | ||
|
286ad446cf | ||
|
676e15833e | ||
|
d9ac13d453 | ||
|
2d6c9545c8 | ||
|
4adddfb061 | ||
|
b0c5b83115 | ||
|
8bc286bdab | ||
|
5a47a6a24a | ||
|
4fd7614f58 | ||
|
85ed70bdb0 | ||
|
fcafbe31f8 | ||
|
70e6ac262a | ||
|
1f29e9f4d8 | ||
|
5f86ae58b6 | ||
|
0f81a66b90 | ||
|
f0285eb499 | ||
|
0eab5291e9 | ||
|
511e2af345 | ||
|
2180eb9f3a | ||
|
adaaa66dd1 | ||
|
0db3c8907c | ||
|
95a57d9446 | ||
|
fdd3dddbe1 | ||
|
8932eb138a | ||
|
619da73aae | ||
|
3a78d2bb5c | ||
|
d8d52662f4 | ||
|
605e963695 | ||
|
a153844832 | ||
|
51cab1e5d2 | ||
|
42710f7528 | ||
|
0610903073 | ||
|
b62d3189e9 | ||
|
4526fe80f0 | ||
|
a65a9fc2a2 | ||
|
75c0391a19 | ||
|
d2cd06d96b | ||
|
2931f21cc4 | ||
|
d99f974c7c | ||
|
046db3272d | ||
|
d68cf89d21 | ||
|
e097a2074d | ||
|
d4a3ca4360 | ||
|
f7fd60c9a0 | ||
|
5399c57010 | ||
|
d0a0857987 | ||
|
35e837af81 | ||
|
fbb019c7d4 | ||
|
7ca32d69e4 | ||
|
088dd975a6 | ||
|
6487cb4532 | ||
|
83d3cb5f4a | ||
|
e96ce7127b | ||
|
b06cd50d82 | ||
|
6a22104b36 | ||
|
3e48103956 | ||
|
4ad4c24221 | ||
|
62fc0c17d5 | ||
|
401dfa0cf3 | ||
|
d2996c69f7 | ||
|
2ab8d3e583 | ||
|
55e05fbe63 | ||
|
512abb9d38 | ||
|
e6e169fbe7 | ||
|
349dde60de | ||
|
f6a9e222c1 | ||
|
1bdce6771c | ||
|
4197ad76cb | ||
|
da28d19390 | ||
|
38922b0fd0 | ||
|
9fc24e0ab1 | ||
|
697c7ebb5d | ||
|
82a99a4efa | ||
|
bb82175e59 | ||
|
b0207bf239 | ||
|
9510505afd | ||
|
a346cf5505 | ||
|
7c18e4a4b1 | ||
|
17e152ce0b | ||
|
0233d4b34f | ||
|
b0962b753c | ||
|
5ad2717112 | ||
|
2f26c2409d | ||
|
42c9f843e3 | ||
|
7cf0b68865 | ||
|
0d1a39b237 | ||
|
e18f1b3b40 | ||
|
3d867a8c7f | ||
|
9db6f449a1 | ||
|
7f3954d470 | ||
|
e2bc5393a7 | ||
|
b3bc52e460 | ||
|
57c1766c60 | ||
|
003681a91d | ||
|
f83053458e | ||
|
cbe5f56cc4 | ||
|
26fdd036c4 | ||
|
e2c64172fb | ||
|
a638ebf87f | ||
|
bbd9d47187 | ||
|
572eaf92c9 | ||
|
875025e507 | ||
|
4686cbc8d5 | ||
|
838c0aeb4a | ||
|
26d4ad4ae0 | ||
|
18bd65b991 | ||
|
3993257e59 | ||
|
27438be586 | ||
|
b0ba3c25ba | ||
|
82fd8a3fae | ||
|
943eb22c7c | ||
|
ee95e69664 | ||
|
bfe9a89091 | ||
|
8cd4fe17d0 | ||
|
fe9747f9e4 | ||
|
976e10b434 | ||
|
6025314471 | ||
|
9983e9c1eb | ||
|
d6bcd86464 | ||
|
b9cec9515b | ||
|
af1730d2e6 | ||
|
fa03081e67 | ||
|
d9253f962e | ||
|
a2568e417b | ||
|
21ddf64775 | ||
|
7135be80d3 | ||
|
d668dbc2d1 | ||
|
9581c825db | ||
|
1da719624c | ||
|
791e5c14ad | ||
|
80e214a19b | ||
|
ecc492c1ce | ||
|
189a519597 | ||
|
58b1e456f7 | ||
|
eb58f69819 | ||
|
23166356d4 | ||
|
28f7d52e43 | ||
|
75e6913ccf | ||
|
78c4d98eee | ||
|
4b4608f306 | ||
|
edf7b7e028 | ||
|
0e43da9d1c | ||
|
3c89575003 | ||
|
e5929d53c4 | ||
|
d6b00d4063 | ||
|
a4391f3886 | ||
|
c1c8449c72 | ||
|
d3684f6835 | ||
|
05b829d0d7 | ||
|
2bb37b2e11 | ||
|
71b6864bcc | ||
|
90031051ee | ||
|
d6532f955a | ||
|
efa137c644 | ||
|
2c816731ed | ||
|
ffc27e0766 | ||
|
59df244e79 | ||
|
85dd71c9fa | ||
|
4a3f20b578 | ||
|
74187e5e35 | ||
|
ad3c39fcfc | ||
|
9c860a1f1f | ||
|
42c7be5e22 | ||
|
fe9a39bd82 | ||
|
9a0853c2ea | ||
|
e579d3a90a | ||
|
06c50d0d36 | ||
|
aaf95f0b35 | ||
|
3d8bdbba8b | ||
|
cee2fe1bd3 | ||
|
a76be3aae3 | ||
|
aade0196ae | ||
|
b8933aa09a | ||
|
d8d87f04f2 | ||
|
23fae60167 | ||
|
398171e813 | ||
|
1b7965fbd2 | ||
|
4b99c809fc | ||
|
b790b950f1 | ||
|
878b621a08 | ||
|
24eb5def51 | ||
|
bb5b0b707a | ||
|
26869a2fd8 | ||
|
41a7d74bfd | ||
|
db04d8c77e | ||
|
6ec41300d2 | ||
|
79dd70b755 | ||
|
0ea33fb71b | ||
|
87e98e8848 | ||
|
3038e83be4 | ||
|
504d74b63e | ||
|
eb097d1535 | ||
|
b530470273 | ||
|
ba61d4c817 | ||
|
f4f050dadd | ||
|
a79970de29 | ||
|
b33b364f32 | ||
|
843bb1fb5b | ||
|
c1c655d84b | ||
|
537340d274 | ||
|
54c828c7ff | ||
|
219f23f227 | ||
|
cc1f7de75c | ||
|
1568c4ad72 | ||
|
21f4d8824c | ||
|
f5f3711cbf | ||
|
2966e158cd | ||
|
d2ff25fc12 | ||
|
f6e540eb64 | ||
|
626795a877 | ||
|
6bdf5bfa6e | ||
|
1e678a2311 | ||
|
f3805d0982 | ||
|
eb6586aaac | ||
|
a66664c166 | ||
|
9a97455d5b | ||
|
94503708a4 | ||
|
b28cf0c144 | ||
|
a7d3ac6158 | ||
|
c88eb0c2fb | ||
|
9a8d4b6967 | ||
|
8cb021d031 | ||
|
6e6d0e7eae | ||
|
d9bb3e8a74 | ||
|
d10344ae41 | ||
|
faf22f9755 | ||
|
5bcee45652 | ||
|
915d54a719 | ||
|
57c6565b86 | ||
|
2155ccfc3d | ||
|
bc1a47cc5c | ||
|
ef01f0d618 | ||
|
32d7023345 | ||
|
c81c3a6b29 | ||
|
8881b8f576 | ||
|
57c2bfa9a1 | ||
|
9fb82f87a1 | ||
|
9a70310c6a | ||
|
af568d45d2 | ||
|
38bb1176ee | ||
|
e235c8545b | ||
|
fb2d7b2c4e | ||
|
c5cdaa3e8c | ||
|
52aecfd2e2 | ||
|
792c243f3a | ||
|
80e12eda14 | ||
|
fe2e2dfb74 | ||
|
71f591e16a | ||
|
2100693b79 | ||
|
a3fe0d3af0 | ||
|
abe6ad158e | ||
|
04c7bb6f02 | ||
|
3d54b21d08 | ||
|
a48e8eeaaf | ||
|
d2a574d49e | ||
|
9312fee50b | ||
|
2bf6e1bb6d | ||
|
c49a520bf5 | ||
|
f600df4cd6 | ||
|
e3e2587a08 | ||
|
55845ab56e | ||
|
df51ce2355 | ||
|
25147d0665 | ||
|
fed721dff2 | ||
|
833dd45596 | ||
|
9592b189b5 | ||
|
cceb47deaf | ||
|
31667cac6c | ||
|
8677f04e5a | ||
|
8d7fb98111 | ||
|
6762b15a00 | ||
|
60b733b8b6 | ||
|
e12080b214 | ||
|
5fdd0a9e0a | ||
|
bed36082ae | ||
|
2677c972bf | ||
|
6baa4f4edd | ||
|
8f72a9e539 | ||
|
68126b1576 | ||
|
f7f2574321 | ||
|
6c3fa57080 | ||
|
3f7061b48d | ||
|
99ba700276 | ||
|
6adc157fc9 | ||
|
b906fc56ea | ||
|
e6f1065c19 | ||
|
8e6c107fe2 | ||
|
65cc5b272b | ||
|
dee2273c53 | ||
|
f7a0c0d33a | ||
|
b888f2b128 | ||
|
d0cac19a26 | ||
|
3f4e689a90 | ||
|
9619043e94 | ||
|
cbbc35290c | ||
|
ccfc6ac497 | ||
|
f9175c5e8b | ||
|
a72755c3a1 |
@ -1,65 +1,90 @@
|
||||
<?php
|
||||
|
||||
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
{
|
||||
//Initialisation global des paramètres de vue
|
||||
protected function _initViewSettings()
|
||||
{
|
||||
$this->bootstrap('view');
|
||||
$view = $this->getResource('view');
|
||||
/*
|
||||
* Si on détecte un périphérique mobile alors on charge
|
||||
* les bons scripts
|
||||
$theme = 'mobile';
|
||||
$path = realpath(APPLICATION_PATH.'/views/'.$theme);
|
||||
$view = new Zend_View();
|
||||
$view->addBasePath($path);
|
||||
*/
|
||||
$theme = 'default';
|
||||
$pathStyle = '/themes/'.$theme.'/styles';
|
||||
$pathScript = '/themes/'.$theme.'/scripts';
|
||||
$view = $this->getResource('view');
|
||||
$pathStyle = '/themes/default/styles';
|
||||
$pathScript = '/themes/default/scripts';
|
||||
|
||||
$view->setEncoding('UTF-8');
|
||||
$view->doctype('XHTML1_STRICT');
|
||||
|
||||
$view->headMeta()
|
||||
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
|
||||
->appendHttpEquiv('Content-Language', 'fr-FR');
|
||||
|
||||
->appendHttpEquiv('Content-Language', 'fr-FR');
|
||||
|
||||
$view->headLink()
|
||||
->appendStylesheet($pathStyle.'/reset.css', 'all')
|
||||
->appendStylesheet($pathStyle.'/jquery.qtip.css', 'all')
|
||||
->appendStylesheet('/themes/jstree/default/style.css')
|
||||
->appendStylesheet('/themes/jqueryui/jquery-ui.css', 'all')
|
||||
->appendStylesheet($pathStyle.'/main.css', 'all');
|
||||
|
||||
//->appendStylesheet('/themes/multiselect/css/ui.multiselect.css', 'all');
|
||||
|
||||
$view->headScript()
|
||||
->appendFile($pathScript.'/jquery.js', 'text/javascript')
|
||||
->appendFile($pathScript.'/jquery.bgiframe.js', 'text/javascript')
|
||||
->appendFile($pathScript.'/jquery.cookie.js', 'text/javascript')
|
||||
->appendFile($pathScript.'/jquery-ui.js', 'text/javascript')
|
||||
->appendFile($pathScript.'/jquery.qtip.js', 'text/javascript')
|
||||
->appendFile($pathScript.'/scripts.js', 'text/javascript');
|
||||
|
||||
$view->headTitle()->setSeparator(' - ');
|
||||
$view->headTitle('Odea');
|
||||
->appendFile($pathScript.'/upload.js', 'text/javascript')
|
||||
->appendFile($pathScript.'/scripts.js', 'text/javascript');
|
||||
//->appendFile($pathScript.'/ui.multiselect.js', 'text/javascript');
|
||||
|
||||
$view->headTitle()->setSeparator(' - ');
|
||||
$view->headTitle('Odea');
|
||||
}
|
||||
|
||||
protected function _initLogging()
|
||||
{
|
||||
//Logger de développement
|
||||
//Logger de développement
|
||||
$writer = new Zend_Log_Writer_Firebug();
|
||||
if(APPLICATION_ENV=='production') $writer->setEnabled(false);
|
||||
$logger = new Zend_Log($writer);
|
||||
Zend_Registry::set('firebug', $logger);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected function _initDb()
|
||||
{
|
||||
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
|
||||
try {
|
||||
$db = Zend_Db::factory($dbConfig->db);
|
||||
$db = Zend_Db::factory($dbConfig->db);
|
||||
Zend_Db_Table::setDefaultAdapter ($db);
|
||||
} catch ( Exception $e ) {
|
||||
exit ( $e->getMessage() );
|
||||
}
|
||||
Zend_Registry::set('db', $db);
|
||||
Zend_Registry::set('db', $db);
|
||||
}
|
||||
}
|
||||
|
||||
protected function _initAutoload()
|
||||
{
|
||||
require_once APPLICATION_PATH . '/../library/Zend/Loader/Autoloader.php';
|
||||
|
||||
$appPath = realpath(dirname(__FILE__));
|
||||
$rootPath = dirname($appPath);
|
||||
$autoload = Zend_Loader_Autoloader::getInstance();
|
||||
|
||||
$application = new Zend_Loader_Autoloader_Resource(array(
|
||||
'basePath' => $appPath . '/modules/frontend/models/',
|
||||
'namespace' => '',
|
||||
'resourceTypes' => array('tables'=>array('path'=>'Tables/','namespace'=>'Table'),
|
||||
'objects'=>array('path'=>'Objects/', 'namespace'=>'Object'),
|
||||
'forms'=>array('path'=>'Forms/', 'namespace'=>'Form')
|
||||
)));
|
||||
|
||||
$libs = new Zend_Loader_Autoloader_Resource(array(
|
||||
'basePath' => $rootPath . '/library',
|
||||
'namespace' => 'library',
|
||||
'resourceTypes' => array('libs'=>array('path'=>'libs/','namespace'=>'Libs'),
|
||||
)));
|
||||
|
||||
$loader = new Zend_Application_Module_Autoloader(array(
|
||||
'namespace' => '',
|
||||
'basePath' => APPLICATION_PATH));
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,34 +0,0 @@
|
||||
- Critères
|
||||
Etablissements : Tous / Seulement les actifs / Seulement les inactifs
|
||||
Type Etablissements : Tous / Uniquement les sièges / Uniquement les secondaires
|
||||
Entreprises appartenant à un groupe français
|
||||
Entreprise appartenant à un groupe étranger
|
||||
Téléphone renseigné / non renseigné
|
||||
|
||||
- Secteur Géographique
|
||||
Régions (insee.regions)
|
||||
Départements (insee.departements)
|
||||
Code Postal - Communes (insee.codepostaux)
|
||||
+ Recherche textuel sur ville (code postal, commune) pour affichage liste code postal
|
||||
Codes Communes Insee (insee.codepostaux)
|
||||
|
||||
- Forme juridique (insee.tabFJ)
|
||||
Arbre de selection avec déploiement des groupes
|
||||
|
||||
- Activité (naf) - Entreprise, Etablissements (insee.tabNAF)
|
||||
Arbre de sélection avec déploiement des groupes
|
||||
|
||||
- Chiffre clés
|
||||
Date de création - Ancienneté (Moins d'un an, de 1 à 2, 3 à 5, 6 à 9, 10 et plus )
|
||||
Nombre d'établissements (inférieur, égal, supérieur, intervalle)
|
||||
Intervalle Effectif (Tranches ou Réel) - Entreprise, Etablissement
|
||||
|
||||
- Critères bilantiel
|
||||
Date de clôture de l'exercice
|
||||
Intervalle CA - Selection (Moins de 15000 euros, de 15000 à 30000, de 30000 à 75000, de 75000 à 150000, de 150000 à 750000, Plus de 750000)
|
||||
Intervalle Résultat net
|
||||
Intervalle CA à l'export
|
||||
ACTIF - PASSIF - COMPTE DE RESULTAT - ANNEXES
|
||||
Ratios
|
||||
Scores (Risques de défaillance)
|
||||
|
@ -1,84 +0,0 @@
|
||||
Placer les critères en session
|
||||
Enregistrer régulièrement en session (SessionCriteres)
|
||||
On sauvegarde, seulement si le client à mis une référence, et cliquer sur le bouton sauvegarder
|
||||
Exploser les critères pour des sous comptage
|
||||
Enregistrement d'un fichier login-idDefinition-timestamp
|
||||
|
||||
Définir la structure d'envoi des critères
|
||||
Formulaire
|
||||
Voir avec API Ciblage Sphinx
|
||||
|
||||
Voir pour l'enrichissement
|
||||
Pour simplifer, l'enrichissement devra se faire à partir de la table etablissements_act
|
||||
+ quelques autres tables pour des données supplémentaires
|
||||
|
||||
Générer un fichier avec la liste des SIREN+NIC ou SIRET + les entêtes nécessaires à l'enrichissement
|
||||
Voir si le fichier doit être généré sur la plateforme de ciblage, ou par le webservice
|
||||
|
||||
Réplication des tables sur la plateforme ciblage
|
||||
|
||||
Gestion d'une queue, voir todo dans webservice
|
||||
|
||||
Table naf
|
||||
Table régions
|
||||
Table departements
|
||||
Table codepostaux
|
||||
Table formejuridique (tabFJ)
|
||||
|
||||
|
||||
- Table pour la sauvegarde des critères (criteres)
|
||||
id int primary key autoincrement
|
||||
idClient int
|
||||
login varchar
|
||||
reference varchar obligatoire ?
|
||||
criteres text
|
||||
parent int identifiant comptage parent pour les explode default 0
|
||||
dateAjout
|
||||
|
||||
- Table pour la sauvegarde des comptages (comptages)
|
||||
id
|
||||
idDefinition
|
||||
resultat
|
||||
uniteInsee
|
||||
tarif
|
||||
dateComptage
|
||||
|
||||
- Tables pour la sauvegarde des exports de siren (refexport)
|
||||
id
|
||||
idDefinition
|
||||
fichier
|
||||
dateExport
|
||||
|
||||
- profilExtraction
|
||||
id
|
||||
idClient
|
||||
reference
|
||||
criteres
|
||||
tarifLigne
|
||||
dateAjout
|
||||
dateModif
|
||||
dateSuppr
|
||||
actif
|
||||
|
||||
|
||||
- tarifsInsee
|
||||
id
|
||||
tarifLigne
|
||||
montantMax
|
||||
dateEffet
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -2,29 +2,46 @@
|
||||
phpSettings.date.timezone = "Europe/Paris"
|
||||
phpSettings.display_startup_errors = 0
|
||||
phpSettings.display_errors = 0
|
||||
includePaths.library = APPLICATION_PATH "/../library"
|
||||
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
|
||||
bootstrap.class = "Bootstrap"
|
||||
appnamespace = "Application"
|
||||
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
resources.session.save_path = APPLICATION_PATH "/../cache/sessions"
|
||||
resources.session.gc_maxlifetime = 86400
|
||||
resources.session.cookie_lifetime = 86400
|
||||
resources.session.remember_me_seconds = 86400
|
||||
|
||||
; so auto-loading will find our classes in library/App
|
||||
autoloaderNamespaces[] = "Structure_" ;Les structures de données
|
||||
autoloaderNamespaces[] = "Libs_" ;Librairies de l'application
|
||||
resources.view[] = ""
|
||||
|
||||
; initialize front controller resource
|
||||
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
|
||||
resources.frontController.defaultControllerName = "index"
|
||||
resources.frontController.defaultAction = "index"
|
||||
resources.frontController.defaultModule = "frontend"
|
||||
|
||||
autoloaderNamespaces[] = "Scores_"
|
||||
autoloaderNamespaces[] = "Application_"
|
||||
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
|
||||
resources.frontController.plugins.Comptage = "Application_Controller_Plugin_Comptage"
|
||||
resources.layout.layout = "main"
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/views/default"
|
||||
resources.view.basePath = APPLICATION_PATH "/views/default"
|
||||
|
||||
|
||||
;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
|
||||
|
||||
; initialize layout resource
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/layouts"
|
||||
|
||||
[staging : production]
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
phpSettings.soap.wsdl_cache_enabled = 0
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 1
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
[development : production]
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 1
|
||||
phpSettings.soap.wsdl_cache_enabled = 0
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
[testing : production]
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 1
|
@ -1,331 +0,0 @@
|
||||
<?php
|
||||
class ArborescenceController extends Zend_Controller_Action
|
||||
{
|
||||
/**
|
||||
* Affiche l'arborescence des NAFs de premier niveau
|
||||
*/
|
||||
public function nafAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
$this->view->assign('key', $key);
|
||||
|
||||
//Récupération des valeurs enregistrées en session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$sessionCiblage = new SessionCiblage();
|
||||
$val = $sessionCiblage->getCritere($key);
|
||||
$valuesChecked = array();
|
||||
$valuesUndetermined = array();
|
||||
if ($val != null){
|
||||
$valuesChecked = explode(',',$val);
|
||||
foreach($valuesChecked as $value){
|
||||
$valuesUndetermined = array_merge($valuesUndetermined, $this->getNafParent($value, true));
|
||||
}
|
||||
}
|
||||
|
||||
$niveau = $request->getParam('niveau', 1);
|
||||
$nafM = new Application_Model_Naf();
|
||||
$sql = $nafM->select()->where('niveau = ?', $niveau)->order('code ASC');
|
||||
$result = $nafM->fetchAll($sql)->toArray();
|
||||
$tabNaf = array();
|
||||
foreach($result as $item)
|
||||
{
|
||||
$structure = array(
|
||||
'data' => $item['code'].' - '.$item['lib'],
|
||||
'attr' => array('id' => $item['code'], 'niveau' => $item['niveau']),
|
||||
'state' => 'closed',
|
||||
'children' => array(),
|
||||
);
|
||||
if (in_array($item['code'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if (in_array($item['code'], $valuesUndetermined)){
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
$tabNaf[] = $structure;
|
||||
}
|
||||
$this->view->assign('naf', json_encode($tabNaf));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'arborecence des NAFs de niveau supérieur à 1
|
||||
*/
|
||||
public function nafajaxAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
|
||||
//Récupération des valeurs enregistrées en session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$sessionCiblage = new SessionCiblage();
|
||||
$val = $sessionCiblage->getCritere($key);
|
||||
$valuesChecked = array();
|
||||
|
||||
$valuesUndetermined = array();
|
||||
if ($val != null){
|
||||
$valuesChecked = explode(',',$val);
|
||||
foreach($valuesChecked as $value){
|
||||
$valuesUndetermined = array_merge($valuesUndetermined, $this->getNafParent($value));
|
||||
}
|
||||
}
|
||||
|
||||
$request = $this->getRequest();
|
||||
$niveau = $request->getParam('niveau', 1);
|
||||
$niveau++;
|
||||
$parent = $request->getParam('parent', '');
|
||||
$nafM = new Application_Model_Naf();
|
||||
$sql = $nafM->select();
|
||||
if (!empty($parent) && $niveau==2) {
|
||||
$sql->where('parent = ?', $parent);
|
||||
} elseif (!empty($parent) && $niveau>2) {
|
||||
$sql->where("code LIKE '".$parent."%'");
|
||||
}
|
||||
$sql->where('niveau = ?', $niveau)->order('code ASC');
|
||||
|
||||
$result = $nafM->fetchAll($sql)->toArray();
|
||||
$tabNaf = array();
|
||||
foreach($result as $item){
|
||||
$structure = array(
|
||||
'data' => $item['code'].' - '.$item['lib'],
|
||||
'attr' => array('id' => $item['code'], 'niveau' => $item['niveau']),
|
||||
);
|
||||
if (in_array($item['code'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if (in_array($item['code'], $valuesUndetermined)){
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
if ($niveau<5){
|
||||
$structure['state'] = 'closed';
|
||||
$structure['children'] = array();
|
||||
}
|
||||
$tabNaf[] = $structure;
|
||||
}
|
||||
echo json_encode($tabNaf);
|
||||
}
|
||||
|
||||
protected function getNafParent($value, $niveau1 = false)
|
||||
{
|
||||
$out = array();
|
||||
if (strlen($value)>2) {
|
||||
$niveau = strlen($value)-1;
|
||||
$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();
|
||||
$sql = $nafM->select()
|
||||
->from($nafM, array('parent'))
|
||||
->where('code = ?', $value);
|
||||
$result = $nafM->fetchRow($sql);
|
||||
$out[] = $result->parent;
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function geographiqueAction()
|
||||
{
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->view->inlineScript()->appendFile('/themes/default/scripts/jquery.jstree.js');
|
||||
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$val = $session->getCritere('adr_cp');
|
||||
|
||||
$valuesCheckeds = explode(',', $val);
|
||||
if(count($valuesCheckeds) > 0) {
|
||||
for($i=0;count($valuesCheckeds) > $i;$i++) {
|
||||
$valuesCheckeds[$i] = substr($valuesCheckeds[$i], 1);
|
||||
}
|
||||
}
|
||||
$valuesUndetermined = array();
|
||||
if($val != null)
|
||||
{
|
||||
$values = explode(',', $val);
|
||||
foreach($values as $valuesChecked) {
|
||||
if(strlen($valuesChecked) == 5) {
|
||||
$dept = substr($valuesChecked, 0, 2);
|
||||
$table = new Application_Model_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 Application_Model_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'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$key = $this->getRequest()->getParam('key');
|
||||
$this->view->assign('key', $key);
|
||||
|
||||
$regionsM = new Application_Model_Regions();
|
||||
$sql = $regionsM->select()->from('regions');
|
||||
$regions = $regionsM->fetchAll()->toArray();
|
||||
|
||||
$structure = array();
|
||||
foreach($regions as $region) {
|
||||
$structure = array(
|
||||
'data' => $region['NCCENR'],
|
||||
'attr' => array('id' => 'R'.$region['REGION'], 'niveau' => 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';
|
||||
}
|
||||
$tabAdrDep[] = $structure;
|
||||
}
|
||||
$this->view->regions = json_encode($tabAdrDep);
|
||||
}
|
||||
|
||||
public function geographiqueajaxAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
$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 Application_Model_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 Application_Model_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 Application_Model_Codepostaux();
|
||||
$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 Application_Model_Departements();
|
||||
$sql = $Departements->select()->from('departements', array('numdep'))->where('codeRegionInsee = ?', substr($valuesChecked, 1));
|
||||
$results = $Departements->fetchAll($sql)->toArray();
|
||||
foreach($results as $result) {
|
||||
$table = new Application_Model_Codepostaux();
|
||||
$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 Application_Model_Codepostaux();
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function juridqueAction()
|
||||
{
|
||||
$valeurs = $this>getRequest()->getParam('');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,132 +0,0 @@
|
||||
<?php
|
||||
class ComptageController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
//Session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('cle');
|
||||
$valeur = $request->getParam('valeur');
|
||||
|
||||
$sessionValeur = $session->getCritere($key);
|
||||
if($sessionValeur == "" && empty($valeur)) {
|
||||
$session->unsetCritere($key);
|
||||
} else {
|
||||
$session->setCritere($key, $valeur);
|
||||
}
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
require_once 'Scores/Field.php';
|
||||
$field = new Fields($user->username);
|
||||
|
||||
//Comptage
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($field->getValues());
|
||||
$total = $ciblage->execute();
|
||||
$insee = $ciblage->calculRedevanceInsee();
|
||||
|
||||
$session->setNb('total', $total);
|
||||
$session->setNb('insee', $insee);
|
||||
|
||||
//Retour comptage, unité Insee
|
||||
$result = array(
|
||||
'count' => number_format($total, 0, '', ' '),
|
||||
'insee' => number_format($insee, 0, '', ' ')
|
||||
);
|
||||
echo json_encode($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Affichage formulaire de sauvegarde
|
||||
*/
|
||||
public function savedialogAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
//Récupération de la session pour le profil et les valeurs du comptage
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$criteres = $session->getCriteres();
|
||||
$this->view->assign('criteres', $criteres);
|
||||
if (count($criteres)==0) {
|
||||
$this->view->assign('noSelection', true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sauvegarde du profil de ciblage et de son comptage
|
||||
*/
|
||||
public function saveAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$ref = $request->getParam('ref', '');
|
||||
|
||||
if (empty($ref)) {
|
||||
echo json_encode(array(
|
||||
'error'=>1,
|
||||
'msg'=> "Référence non définie !"));
|
||||
} else {
|
||||
//Session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$criteres = $session->getCriteres();
|
||||
$resultat = $session->getNb('total');
|
||||
$nbInsee = $session->getNb('insee');
|
||||
|
||||
//Informations utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
//Enregistrement des critères
|
||||
$criteresM = new Application_Model_Criteres($db);
|
||||
$data = array(
|
||||
'idClient' => $user->idClient,
|
||||
'login' => $user->username,
|
||||
'reference' => $ref,
|
||||
'criteres' => json_encode($criteres),
|
||||
'parent' => 0,
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
$id = $criteresM->insert($data);
|
||||
|
||||
if ($id){
|
||||
//Enregistrement des valeurs du comptage
|
||||
$comptageM = new Application_Model_Comptages($db);
|
||||
$data = array(
|
||||
'idDefinition' => $id,
|
||||
'resultat' => $resultat,
|
||||
'uniteInsee' => $nbInsee,
|
||||
'tarif' => '',
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
if ($comptageM->insert($data)) {
|
||||
echo json_encode(array(
|
||||
'error'=>0,
|
||||
'msg'=> "Vos critères ont été sauvegardés sous la référence $ref"));
|
||||
} else {
|
||||
echo json_encode(array(
|
||||
'error'=>1,
|
||||
'msg'=> "Erreur lors de l'enregistrement"));
|
||||
}
|
||||
} else {
|
||||
echo json_encode(array(
|
||||
'error'=>1,
|
||||
'msg'=> "Erreur lors de l'enregistrement"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
<?php
|
||||
class CriteresController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$field = new Fields($user->username);
|
||||
$this->view->fields = $field;
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/jquery.jstree.js', 'text/javascript');
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
if ($user->customisation) {
|
||||
$this->view->assign('preferences', $user->customisation);
|
||||
}
|
||||
}
|
||||
|
||||
public function entrepriseAction(){
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
|
||||
}
|
||||
|
||||
public function economiqueAction(){
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
|
||||
}
|
||||
|
||||
public function geographiqueAction(){
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
|
||||
}
|
||||
|
||||
public function juridiqueAction(){
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
|
||||
}
|
||||
|
||||
public function financiereAction(){
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
|
||||
}
|
||||
|
||||
}
|
@ -1,227 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Tableau de bord de gestion pour le client
|
||||
* Permet de retrouver ces différents comptages et export
|
||||
*
|
||||
*/
|
||||
class DashboardController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/dashboard.css');
|
||||
}
|
||||
|
||||
/**
|
||||
* Affiche le tableau de bord
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
//Liste des derniers comptages
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$criteresM = new Application_Model_Criteres($db);
|
||||
$sql = $criteresM->select(true)
|
||||
->columns(array('id', 'reference', 'dateAjout'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username)
|
||||
->order('dateAjout DESC')
|
||||
->limit(5);
|
||||
|
||||
$rows = $criteresM->fetchAll($sql);
|
||||
|
||||
$results = array();
|
||||
$comptagesM = new Application_Model_Comptages($db);
|
||||
foreach($rows->toArray() as $item)
|
||||
{
|
||||
$info = array(
|
||||
'id' => $item['id'],
|
||||
'reference' => $item['reference'],
|
||||
'dateCriteres' => $item['dateAjout'],
|
||||
);
|
||||
//Recherche des comptages
|
||||
$sql = $comptagesM->select(true)
|
||||
->columns(array('resultat', 'uniteInsee', 'dateAjout'))
|
||||
->where('idDefinition = ?', $item['id'])
|
||||
->order('dateAjout DESC')->limit(1);
|
||||
$comptage = $comptagesM->fetchAll($sql)->toArray();
|
||||
|
||||
if (count($comptage)>0){
|
||||
$info['resultat'] = $comptage[0]['resultat'];
|
||||
$info['uniteInsee'] = $comptage[0]['uniteInsee'];
|
||||
$info['dateComptage'] = $comptage[0]['dateAjout'];
|
||||
}
|
||||
|
||||
$results[] = $info;
|
||||
}
|
||||
$this->view->assign('comptages', $results);
|
||||
|
||||
//Rechercher un comptage
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function menuAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Affiche la liste des ciblages avec pagination
|
||||
*/
|
||||
public function ciblagesAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$page = $request->getParam('page', 1);
|
||||
$offset = 20;
|
||||
|
||||
//Liste des ciblages par paquet de n
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$criteresM = new Application_Model_Criteres($db);
|
||||
|
||||
//Compter le nombre de page
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('nb' => 'COUNT(*)'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username);
|
||||
$count = $criteresM->fetchRow($sql);
|
||||
$nbCiblage = $count->nb;
|
||||
|
||||
//Récupérer les informations
|
||||
$position = ($page-1)*$offset+1;
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('id', 'reference', 'dateAjout'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username)
|
||||
->order('dateAjout DESC')
|
||||
->limitPage($position, $offset);
|
||||
|
||||
$rows = $criteresM->fetchAll($sql);
|
||||
$results = array();
|
||||
$comptagesM = new Application_Model_Comptages($db);
|
||||
foreach($rows->toArray() as $item)
|
||||
{
|
||||
$info = array(
|
||||
'id' => $item['id'],
|
||||
'reference' => $item['reference'],
|
||||
'dateCriteres' => $item['dateAjout'],
|
||||
);
|
||||
//Recherche des comptages
|
||||
$sql = $comptagesM->select(true)
|
||||
->columns(array('resultat', 'uniteInsee', 'dateAjout'))
|
||||
->where('idDefinition = ?', $item['id'])
|
||||
->order('dateAjout DESC')->limit(1);
|
||||
$comptage = $comptagesM->fetchAll($sql)->toArray();
|
||||
|
||||
if (count($comptage)>0){
|
||||
$info['resultat'] = $comptage[0]['resultat'];
|
||||
$info['uniteInsee'] = $comptage[0]['uniteInsee'];
|
||||
$info['dateComptage'] = $comptage[0]['dateAjout'];
|
||||
}
|
||||
|
||||
$results[] = $info;
|
||||
}
|
||||
$this->view->assign('ciblages', $results);
|
||||
$this->view->assign('nbCiblage', $nbCiblage);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Affiche le détail du comptage
|
||||
* comptage multiple, fichier, etc....
|
||||
*/
|
||||
public function ciblagedetailAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$id = $request->getParam('id');
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$criteresM = new Application_Model_Criteres($db);
|
||||
$sql = $criteresM->select()
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username)
|
||||
->where("id = ?", $id);
|
||||
$criteres = $criteresM->fetchRow($sql);
|
||||
$this->view->assign('criteres', $criteres->toArray());
|
||||
|
||||
if ($criteres != null){
|
||||
$comptagesM = new Application_Model_Comptages($db);
|
||||
$sql = $comptagesM->select()
|
||||
->where('idDefinition = ?', $id);
|
||||
$comptages = $comptagesM->fetchAll($sql);
|
||||
|
||||
$this->view->assign('comptages', $comptages->toArray());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recherche un comptage avec la référence ou la date
|
||||
*/
|
||||
public function rcomptageAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$q = strtolower($this->getRequest()->getParam('q', ''));
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$criteresM = new Application_Model_Criteres($db);
|
||||
$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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion de la configuration de l'application
|
||||
*/
|
||||
public function configurationAction()
|
||||
{
|
||||
//Préférences
|
||||
//Profil extraction
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste des exportations simple non lié à un ciblage
|
||||
*/
|
||||
public function exportsAction()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
<?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 = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'path');
|
||||
$path = realpath($config->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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
class ExtractionController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction(){
|
||||
}
|
||||
}
|
||||
|
@ -1,72 +0,0 @@
|
||||
<?php
|
||||
class IndexController extends Zend_Controller_Action
|
||||
{
|
||||
public function init(){}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
if ($user->customisation) {
|
||||
$this->view->assign('preferences', $user->customisation);
|
||||
}
|
||||
}
|
||||
|
||||
public function selectionAction(){}
|
||||
|
||||
public function historiqueAction(){}
|
||||
|
||||
public function criteresAction()
|
||||
{
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/fields.js', 'text/javascript');
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$session = new SessionCiblage();
|
||||
//Chargement de la structure des champs et des préférences utilisateurs
|
||||
require_once 'Scores/Field.php';
|
||||
$fields = new Fields($user->username);
|
||||
$this->view->fields = $fields;
|
||||
$this->view->criteres = $session->getCriteres();
|
||||
}
|
||||
|
||||
public function resetAction()
|
||||
{
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$session->clearCiblage();
|
||||
$this->_redirect('./');
|
||||
}
|
||||
|
||||
public function saveAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$field = $this->getRequest()->getParam('name');
|
||||
$fields = $this->fields->getFields();
|
||||
$fields[$field]['activated'] = (($fields[$field]['activated'] == false)?true:false);
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$prefsModel = new Application_Model_Prefs($db);
|
||||
$data = array(
|
||||
'login' => $user->username,
|
||||
'json' => $this->fields->getNotActivated($fields),
|
||||
);
|
||||
|
||||
$prefsModel->select()->where('login = "?"', $user->username);
|
||||
$rows =$prefsModel->fetchRow();
|
||||
$rows = $rows->toArray();
|
||||
if (count($rows) > 0) {
|
||||
$prefsModel->update($data, 'login = "'.$user->unsername.'"');
|
||||
} else {
|
||||
$prefsModel->insert($data);
|
||||
}
|
||||
$this->_redirect('./');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,57 +0,0 @@
|
||||
<?php
|
||||
class PreferencesController extends Zend_Controller_Action
|
||||
{
|
||||
public function saveAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$fields = $this->getRequest()->getParam('fields');
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$prefsModel = new Application_Model_Prefs($db);
|
||||
$data = array(
|
||||
'login' => $user->username,
|
||||
'json' => json_encode($this->getNotActivated(json_decode($fields))),
|
||||
);
|
||||
$sql = $prefsModel->select()->where('login = ?', $user->username);
|
||||
$rows = $prefsModel->fetchAll($sql);
|
||||
if (count($rows)>0) {
|
||||
$prefsModel->update($data, 'login = '.$user->unsername);
|
||||
} else {
|
||||
$prefsModel->insert($data);
|
||||
}
|
||||
$this->_redirect('./');
|
||||
}
|
||||
|
||||
public function getNotActivated($fields)
|
||||
{
|
||||
foreach($fields as $name => $field)
|
||||
{
|
||||
if(!$field['activated']) {
|
||||
$desactivated[] = array($name => "");
|
||||
}
|
||||
}
|
||||
return ($desactivated);
|
||||
}
|
||||
|
||||
/**
|
||||
* Place un marqueur d'activation du mode de personnalisation dans la session Utilisateur
|
||||
* On retourne ensuite dans index/index pour permettre le choix des préférences d'affichage
|
||||
*/
|
||||
public function activeAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
//@todo : Vérifier que l'utilisateur à le droit de customiser
|
||||
$user->customisation = true;
|
||||
$auth->getStorage()->write($user);
|
||||
$this->_redirect('./');
|
||||
}
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
class PrefsController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$prefs = new Application_Model_Prefs($db);
|
||||
$sql = $prefs->select()->where('login = ?', $user->username);
|
||||
|
||||
$this->view->entries = $prefs->fetchAll($sql);
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
<?php
|
||||
class RechercheController extends Zend_Controller_Action
|
||||
{
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function nafAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function geographiqueAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function juridiqueAction()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,91 +0,0 @@
|
||||
<?php
|
||||
class UserController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
require_once 'Forms/Login.php';
|
||||
require_once 'Scores/WebAuthAdapter.php';
|
||||
require_once 'Scores/WsScores.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion de l'authentification
|
||||
*/
|
||||
public function loginAction()
|
||||
{
|
||||
$this->view->headTitle()->append('Connexion');
|
||||
$form = new Form_Login();
|
||||
$this->view->form = $form;
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost()) {
|
||||
$formData = $request->getPost();
|
||||
if ($form->isValid($formData)) {
|
||||
$login = $form->getValue('login');
|
||||
$pass = $form->getValue('pass');
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$authAdapter = new WebAuthAdapter($login, md5($login.'|'.$pass));
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
if (!$result->isValid()){
|
||||
$this->view->message = '';
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
foreach ($result->getMessages() as $message) {
|
||||
$this->view->message.= $message."<br/>";
|
||||
}
|
||||
} else {
|
||||
$timeout = $auth->getIdentity()->timeout;
|
||||
|
||||
//Ecrit un cookie persistant valide pendant le temps definit
|
||||
Zend_Session::rememberMe($timeout);
|
||||
|
||||
$storage = new Zend_Auth_Storage_Session();
|
||||
$sessionNamespace = new Zend_Session_Namespace($storage->getNamespace());
|
||||
$sessionNamespace->setExpirationSeconds($timeout);
|
||||
$auth->setStorage($storage);
|
||||
$url = '';
|
||||
if (Zend_Session::namespaceIsset('login')){
|
||||
$session = new Zend_Session_Namespace('login');
|
||||
if (isset($session->url)) {
|
||||
$url = $session->url;
|
||||
}
|
||||
}
|
||||
if (!empty($url) && $url!='/user/login' && $url!='/localauth'){
|
||||
$this->_redirect($url);
|
||||
}
|
||||
$this->_redirect('/');
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->render('login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion de la déconnexion
|
||||
*/
|
||||
public function logoutAction()
|
||||
{
|
||||
//Suppression des critères de comptage en session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$session->clearCiblage();
|
||||
|
||||
//Suppression de l'identité
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$url = 'http://www.scores-decisions.com/';
|
||||
$refresh = 5;
|
||||
|
||||
if (APPLICATION_ENV != 'production'){
|
||||
$url = 'http://'.$_SERVER['SERVER_NAME'].$this->view->url(array(
|
||||
'controller' => 'user',
|
||||
'action' => 'login',
|
||||
));
|
||||
}
|
||||
|
||||
$this->view->assign('url', $url);
|
||||
$this->view->headMeta()->appendHttpEquiv('refresh', '5; url='.$url);
|
||||
$this->render('logout');
|
||||
}
|
||||
}
|
35
application/layouts/header.phtml
Normal file
35
application/layouts/header.phtml
Normal file
@ -0,0 +1,35 @@
|
||||
<div id="primaryNavigation" class="clearfix">
|
||||
<ul>
|
||||
<li><a href="<?=$this->url(array('controller'=>'index', 'action'=>'index'), null, true)?>">Accueil</a></li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'index'), null, true)?>">Tableau de bord</a></li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'aide', 'action'=>'index'), null, true)?>">Aide</a></li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'aide', 'action'=>'aproposde'), null, true)?>">A propos de</a></li>
|
||||
<?php if ( $this->admin ) {?>
|
||||
<li><a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'index'), null, true)?>">Gestion</a></li>
|
||||
<?php }?>
|
||||
<li><a href="<?=$this->url(array('controller'=>'user', 'action'=>'logout'), null, true)?>">Déconnexion</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="logo">
|
||||
<h1>Odea</h1>
|
||||
</div>
|
||||
<div id="message">
|
||||
<?php if ($this->msgComptage){?>
|
||||
<div id="comptage" >
|
||||
<?php if (!empty($this->total)) {?>
|
||||
Nombre sélectionnées :
|
||||
<span class="valeur"><?=$this->total?></span>
|
||||
(dont <span class="valeur"><?=$this->insee?></span> unité(s) insee)
|
||||
<?php } else {?>
|
||||
Aucune sélection.
|
||||
<?php }?>
|
||||
</div>
|
||||
<div id="attente" style="display:none;">
|
||||
<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>],
|
||||
[<a class="saveciblage" href="<?=$this->url(array('controller'=>'comptage', 'action'=>'savedialog'))?>">Sauvegarder le profil du ciblage</a>]
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Codepostaux extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'codepostaux';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Comptages extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'comptages';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Criteres extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'criteres';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Departements extends Zend_Db_Table_Abstract
|
||||
{
|
||||
public $_name = 'departements';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Naf extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'naf';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Prefs extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'prefs';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_ProfilExtraction extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'profilExtraction';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_RefExport extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'refexport';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Regions extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'regions';
|
||||
}
|
||||
|
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
class ArborescenceController extends Libs_Controller
|
||||
{
|
||||
/* Nafs */
|
||||
public function nafAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
$object = new Object_Naf();
|
||||
|
||||
$this->view->key = $key;
|
||||
$this->view->naf = $object->naf($request->getParam('niveau', 1), $key);
|
||||
}
|
||||
|
||||
public function nafajaxAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
$object = new Object_Naf();
|
||||
|
||||
echo $object->ajax($request->getParam('parent', ''),
|
||||
$request->getParam('niveau', 1),
|
||||
$request->getParam('key')
|
||||
);
|
||||
}
|
||||
|
||||
/* Geographiques */
|
||||
public function geographiqueAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$object = new Object_Codepostaux();
|
||||
$key = $this->getRequest()->getParam('key');
|
||||
|
||||
$this->view->key = $key;
|
||||
$this->view->regions = $object->_getRegions();
|
||||
}
|
||||
|
||||
public function geographiqueajaxAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$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');
|
||||
|
||||
echo ($object->_getFils($id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
137
application/modules/frontend/controllers/ComptageController.php
Normal file
137
application/modules/frontend/controllers/ComptageController.php
Normal file
@ -0,0 +1,137 @@
|
||||
<?php
|
||||
class ComptageController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
/* Initialize action controller here */
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$object = new Object_Comptage();
|
||||
echo $object->count($request->getParam('cle'), $request->getParam('valeur'));
|
||||
}
|
||||
|
||||
public function resetAction()
|
||||
{
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$erreurs = new Zend_Session_Namespace('erreurs');
|
||||
$session = new SessionCiblage();
|
||||
$session->clearCiblage();
|
||||
unset($erreurs->erreurs);
|
||||
$this->_redirect('./');
|
||||
}
|
||||
|
||||
public function savedialogAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
//Récupération de la session pour le profil et les valeurs du comptage
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$criteres = $session->getCriteres();
|
||||
$this->view->criteres = $criteres;
|
||||
|
||||
if (count($criteres) == 0) {
|
||||
$this->view->noSelection = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function saveAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
$request = $this->getRequest();
|
||||
$object = new Object_Comptage();
|
||||
$object->saveComptage($request->getParam('ref', ''));
|
||||
}
|
||||
|
||||
public function updateAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$request = $this->getRequest();
|
||||
$idCriteres = $request->getParam('id');
|
||||
|
||||
//Récupération des critères du ciblage
|
||||
$criteresM = new Table_Criteres();
|
||||
$criteresRow = $criteresM->find($idCriteres);
|
||||
$criteres = $criteresRow->current();
|
||||
$structure = json_decode($criteres->criteres, true);
|
||||
|
||||
require_once 'Scores/Field.php';
|
||||
$field = new Fields();
|
||||
$values = $field->getValues($structure);
|
||||
|
||||
//Comptage
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($values);
|
||||
|
||||
$data = array(
|
||||
'idDefinition' => $idCriteres,
|
||||
'resultat' => $ciblage->execute(),
|
||||
'uniteInsee' => $ciblage->calculRedevanceInsee(),
|
||||
'dateAjout' => date('YmdHis'),
|
||||
);
|
||||
//Enregistrement
|
||||
$comptageM = new Table_Comptages();
|
||||
$comptageM->insert($data);
|
||||
//Retour comptage, unité Insee
|
||||
$result = array(
|
||||
'resultat' => number_format($data['resultat'], 0, '', ' '),
|
||||
'uniteInsee' => number_format($data['uniteInsee'], 0, '', ' '),
|
||||
'dateAjout' => substr($data['dateAjout'],6,2).'/'.substr($data['dateAjout'],4,2).'/'.substr($data['dateAjout'],6,2)
|
||||
.' '.substr($data['dateAjout'],8,2).':'.substr($data['dateAjout'],10,2).':'.substr($data['dateAjout'],12,2),
|
||||
);
|
||||
$this->view->result = $result;
|
||||
}
|
||||
|
||||
public function previsualisationAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$object = new Object_Comptage();
|
||||
$sirets = $object->count(null, null, true);
|
||||
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
|
||||
try {
|
||||
$dbMetier = Zend_Db::factory($dbConfig->jo);
|
||||
} catch ( Exception $e ) {
|
||||
exit ( $e->getMessage() );
|
||||
}
|
||||
$i = 0;
|
||||
foreach($sirets as $siret) {
|
||||
if($i>10)
|
||||
break;
|
||||
$sql = $dbMetier->select()->from('etablissements_act')->where('siren = ?', substr($siret, 0, 9))
|
||||
->where('nic = ?', substr($siret, 9, strlen($siret)));
|
||||
$result = $dbMetier->fetchRow($sql);
|
||||
/*Provisoir...*/
|
||||
$result['tel'] = str_pad($result['tel'], 10, 0, STR_PAD_LEFT);
|
||||
$result['fax'] = str_pad($result['fax'], 10, 0, STR_PAD_LEFT);
|
||||
$previ[] = $result;
|
||||
$i++;
|
||||
}
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
//$object->getProfil($user->username, $user->idClient);
|
||||
$table = new Table_EnrichissementProfils();
|
||||
$sql = $table->select()
|
||||
->where('login = ?', $user->username)
|
||||
->where('idClient = ?', $user->idClient);
|
||||
$result = $table->fetchRow($sql);
|
||||
if(!empty($result)) {
|
||||
$result = $result->toArray();
|
||||
$champs = json_decode($result['criteres']);
|
||||
require_once('Scores/Enrichissement.php');
|
||||
$fields = new Enrichissement();
|
||||
$this->view->reference = $fields->getFields();
|
||||
}
|
||||
$this->view->champs = $champs;
|
||||
$this->view->liste = $previ;
|
||||
}
|
||||
}
|
||||
|
152
application/modules/frontend/controllers/DashboardController.php
Normal file
152
application/modules/frontend/controllers/DashboardController.php
Normal file
@ -0,0 +1,152 @@
|
||||
<?php
|
||||
class DashboardController extends Libs_Controller
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/dashboard.css', 'all');
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$object = new Object_Dashboard();
|
||||
|
||||
$this->view->comptages = $object->index();
|
||||
$this->view->enrichissements = $object->enrichissements();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function ciblagesAction()
|
||||
{
|
||||
$object = new Object_Dashboard();
|
||||
$request = $this->getRequest();
|
||||
$assigns = $object->ciblage($request->getParam('page', 1));
|
||||
|
||||
$this->view->ciblages = $assigns['ciblages'];
|
||||
$this->view->nbCiblage = $assigns['nbCiblage'];
|
||||
}
|
||||
|
||||
public function ciblageAction()
|
||||
{
|
||||
require_once('Scores/Field.php');
|
||||
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini');
|
||||
$object = new Object_Dashboard();
|
||||
$request = $this->getRequest();
|
||||
$comptage = $object->ciblagedetail($request->getParam('id'));
|
||||
$enrichissement = $object->enrichissement($request->getParam('id'));
|
||||
|
||||
$this->view->comptageId = $request->getParam('id');
|
||||
$this->view->label = new Fields();
|
||||
$this->view->criteres = $comptage['criteres'];
|
||||
$this->view->comptages = $comptage['comptages'];
|
||||
$this->view->enrichissements = $enrichissement;
|
||||
$this->view->pathfile = $config->path->data;
|
||||
}
|
||||
|
||||
public function rcomptageAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$q = $request->getParam('q');
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$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'=>'ciblage', 'id'=>$item->id)),
|
||||
);
|
||||
}
|
||||
}
|
||||
echo json_encode($output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste des enrichissements
|
||||
*/
|
||||
public function enrichissementsAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini');
|
||||
//Criteres => Comptages (last) => enrichissement_identifiants => enrichissement_commandes
|
||||
$enrichissementsM = new Table_EnrichissementIdentifiants();
|
||||
|
||||
$sql = $enrichissementsM->select()
|
||||
->setIntegrityCheck(false)
|
||||
->from(
|
||||
array('i' => 'enrichissement_identifiants'),
|
||||
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
|
||||
)
|
||||
->join(
|
||||
array('c' => 'comptages'), 'i.idComptage = c.id',
|
||||
array('')
|
||||
)
|
||||
->join(
|
||||
array('criteres' => 'criteres'), 'i.idCriteres = criteres.id',
|
||||
array('')
|
||||
);
|
||||
$sql->where('i.dateStop = ?', 0)
|
||||
->where('criteres.idClient = ?', $user->idClient)
|
||||
->where('criteres.login = ?', $user->username);
|
||||
$encours = $enrichissementsM->fetchAll($sql);
|
||||
$this->view->encours = $encours;
|
||||
|
||||
// Impossible de copie la varible issu d'un select car sinon elle conserve les meme propriété que sont parent
|
||||
// donc les selects... donc obliger de faire deux requetes pour le moment.
|
||||
$sql = $enrichissementsM->select()
|
||||
->setIntegrityCheck(false)
|
||||
->from(
|
||||
array('i' => 'enrichissement_identifiants'),
|
||||
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
|
||||
)
|
||||
->join(
|
||||
array('c' => 'comptages'), 'i.idComptage = c.id',
|
||||
array('')
|
||||
)
|
||||
->join(
|
||||
array('criteres' => 'criteres'), 'i.idCriteres = criteres.id',
|
||||
array('')
|
||||
);
|
||||
$sql->where('criteres.idClient = ?', $user->idClient)
|
||||
->where('criteres.login = ?', $user->username)
|
||||
->where('i.dateStart != ?', '0000-00-00 00:00:00');
|
||||
$fini = $enrichissementsM->fetchAll($sql)->toArray();
|
||||
$this->view->fini = $fini;
|
||||
$this->view->pathfile = $config->path->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Détail d'un enrichissment
|
||||
*/
|
||||
public function enrichissementAction()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
class EconomiqueController extends Libs_Controller
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
/* Initialize action controller here */
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
require_once('Scores/Field.php');
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
|
||||
$field = new Fields();
|
||||
$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');
|
||||
}
|
||||
|
||||
public function completedAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
$request = $this->getRequest();
|
||||
$table = new Table_Nafs();
|
||||
|
||||
$sql = $table->select()
|
||||
->where('lib LIKE "%'.$this->getRequest()->getParam('q').'%"');
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->lib . $separator . $item->code,
|
||||
'value' => $item->code
|
||||
);
|
||||
}
|
||||
echo json_encode($output);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,253 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enregistrement de la commande pour l'ennrichissement
|
||||
*/
|
||||
public function commandeAction()
|
||||
{
|
||||
set_time_limit(60);
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$idCriteres = $request->getParam('id', null);
|
||||
$idProfil = $request->getParam('profil', null);
|
||||
|
||||
//Vérifier les profils du client
|
||||
if ( $idProfil===null ){
|
||||
|
||||
//Selection du profil du client
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$profilsM = new Table_EnrichissementProfils();
|
||||
$sql = $profilsM->select()
|
||||
->from($profilsM, array('id'))
|
||||
->where('idClient=?', $user->idClient)
|
||||
->where('login=?', $user->username)
|
||||
->where('actif=?', 1);
|
||||
$profil = $profilsM->fetchRow($sql);
|
||||
$idProfil = $profil->id;
|
||||
}
|
||||
|
||||
$comptage = new Table_Comptages();
|
||||
$sql = $comptage->select()->where('idDefinition = ?', $idCriteres);
|
||||
$result = $comptage->fetchRow($sql);
|
||||
$idComptage = $result['id'];
|
||||
|
||||
//Récupération des critères du ciblage
|
||||
$criteresM = new Table_Criteres();
|
||||
$criteresRow = $criteresM->find($idCriteres);
|
||||
$criteres = $criteresRow->current();
|
||||
|
||||
$structure = json_decode($criteres->criteres, true);
|
||||
require_once 'Scores/Field.php';
|
||||
$field = new Fields();
|
||||
$values = $field->getValues($structure);
|
||||
|
||||
//Récupération des SIRET
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($values, true);
|
||||
$infosExtraction = $ciblage->execute(true);
|
||||
|
||||
//Attention calcul uniteInsee réelle
|
||||
//car si donnée insee alors toutes les lignes doivent être comptés en unité insee
|
||||
$data = array(
|
||||
'idComptage' => $idComptage,
|
||||
'reference' => $this->getRequest()->getParam('ref'),
|
||||
'idCriteres' => $criteres->id,
|
||||
'idProfil' => $idProfil,
|
||||
'identifiants' => json_encode($infosExtraction),
|
||||
'idProfil' => $idProfil,
|
||||
'fichier' => '',
|
||||
'nbLigneTotales' => count($infosExtraction),
|
||||
'nbLigneTraites' => 0,
|
||||
'uniteInsee' => $ciblage->calculRedevanceInsee(),
|
||||
'error' => '',
|
||||
'dateAdded' => date('YmdHms'),
|
||||
);
|
||||
$identifiantsM = new Table_EnrichissementIdentifiants();
|
||||
$idIdentifiant = $identifiantsM->insert($data);
|
||||
exec('php '.APPLICATION_PATH.'/../batch/enrichissement.php --id '.$idIdentifiant);
|
||||
}
|
||||
|
||||
/**
|
||||
* Demande de référence pour l'enrichissement
|
||||
*/
|
||||
public function referenceAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$request = $this->getRequest();
|
||||
|
||||
//Récupération du profil de l'utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$profilsM = new Table_EnrichissementProfils();
|
||||
$sql = $profilsM->select()
|
||||
->from($profilsM, array('id', 'reference', 'tarifLigne', 'dataInsee'))
|
||||
->where('idClient=?', $user->idClient)
|
||||
->where('login=?', $user->username)
|
||||
->where('actif=?', 1);
|
||||
$profil = $profilsM->fetchRow($sql);
|
||||
//
|
||||
if ($profil!==null)
|
||||
{
|
||||
$this->view->assign('profil', true);
|
||||
$idCritere = $request->getParam('id', null);
|
||||
$comptagesM = new Table_Comptages();
|
||||
$sql = $comptagesM->select()
|
||||
->where('idDefinition = ?', $idCritere)
|
||||
->order('dateAjout DESC')
|
||||
->limit(1);
|
||||
$comptages = $comptagesM->fetchAll($sql);
|
||||
$old = $comptages;
|
||||
$oldResultat = $old[0]->resultat;
|
||||
$oldResultatInsee = $old[0]->uniteInsee;
|
||||
if ( $comptages->count()>0 ) {
|
||||
$item = $comptages[0];
|
||||
$date = explode(' ', $item->dateAjout);
|
||||
$date = $date[0];
|
||||
if($date != '0000-00-00') {
|
||||
if($date != date('Y-m-d')) {
|
||||
$criteres = new Table_Criteres();
|
||||
$sql = $criteres->select()->where('id = ?', $idCritere);
|
||||
$result = $criteres->fetchRow($sql)->toArray();
|
||||
$criteres = json_decode($result['criteres'], true);
|
||||
require_once('Scores/Field.php');
|
||||
require_once('Scores/Ciblage.php');
|
||||
$field = new Fields();
|
||||
$count = new Ciblage($field->getValues($criteres));
|
||||
$item['resultat'] = $count->execute();
|
||||
$item['uniteInsee'] = $count->calculRedevanceInsee();
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->assign('resultat', $item['resultat']);
|
||||
$this->view->assign('uniteInsee', $item['uniteInsee']);
|
||||
|
||||
//Calcul du prix
|
||||
$redevanceInsee = 3.295/100; //Seuil de facturation 52 734 euros
|
||||
$prixInsee = $item['uniteInsee']*$redevanceInsee;
|
||||
$infoInsee = '';
|
||||
if ($profil->dataInsee){
|
||||
$prixInsee = $item['resultat']*$redevanceInsee;
|
||||
$infoInsee = "Votre profil inclus au moins une donnée Insee, la redevance sera applicable sur chaque ligne.";
|
||||
}
|
||||
$prix = $item['resultat'] * $profil->tarifLigne + $prixInsee;
|
||||
|
||||
$this->view->prix = round($prix, 2);
|
||||
$this->view->prixInsee = round($prixInsee, 2);
|
||||
$this->view->infoInsee = $infoInsee;
|
||||
$this->view->id = $item['id'];
|
||||
|
||||
/*$this->view->oldDate = $date;
|
||||
$this->view->oldResult = $oldResultat;
|
||||
$this->view->oldResultInsee = $oldResultatInsee;
|
||||
$this->view->oldPrice = round(($oldResultat* $profil->tarifLigne)+ $oldResultatInsee);
|
||||
$this->view->oldPriceInsee = round($oldResultatInsee*$redevanceInsee, 2);*/
|
||||
|
||||
$this->view->criteres = $criteres;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function downloadAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$id = $this->getRequest()->getParam('id');
|
||||
$table = new Table_EnrichissementIdentifiants();
|
||||
$sql = $table->select()
|
||||
->where('id = ?', $id);
|
||||
$result = $table->fetchRow($sql);
|
||||
if(!empty($result)) {
|
||||
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini');
|
||||
$result = $result->toArray();
|
||||
$date = explode(' ', $result['dateAdded']);
|
||||
$path = $config->path->data.'/'.substr($date[0], 0, 7).'/';
|
||||
$file = $result['fichier'];
|
||||
}
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($path.$file) ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($path.$file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
|
||||
header('Content-Disposition: filename="' . basename($path.$file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($path.$file);
|
||||
} else {
|
||||
echo 'Impossible de charger le fichier.';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
class EntrepriseController extends Libs_Controller
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
/* Initialize action controller here */
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
require_once('Scores/Field.php');
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
|
||||
$field = new Fields();
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ class ErrorController extends Zend_Controller_Action
|
||||
$errors = $this->_getParam('error_handler');
|
||||
|
||||
switch ($errors->type) {
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
|
||||
|
||||
@ -14,13 +14,14 @@ class ErrorController extends Zend_Controller_Action
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
$this->view->message = 'Page not found';
|
||||
break;
|
||||
|
||||
default:
|
||||
// application error
|
||||
$this->getResponse()->setHttpResponseCode(500);
|
||||
$this->view->message = 'Application error';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Log exception, if logger available
|
||||
if ($log = $this->getLog()) {
|
||||
$log->crit($this->view->message, $errors->exception);
|
||||
@ -33,7 +34,7 @@ class ErrorController extends Zend_Controller_Action
|
||||
|
||||
$this->view->request = $errors->request;
|
||||
}
|
||||
|
||||
|
||||
public function getLog()
|
||||
{
|
||||
$bootstrap = $this->getInvokeArg('bootstrap');
|
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
Class ExtractController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
require_once 'Scores/Ciblage.php';
|
||||
require_once 'Scores/Field.php';
|
||||
|
||||
$field = new Fields();
|
||||
$ciblage = new Ciblage($field->getValues());
|
||||
|
||||
$ciblage->extract();
|
||||
}
|
||||
|
||||
public function batchAction()
|
||||
{
|
||||
$action = $this->getRequest();
|
||||
$request = $action->getParam('reference');
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
class FinancierController extends Libs_Controller
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
/* Initialize action controller here */
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
require_once('Scores/Field.php');
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$field = new Fields();
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
class GeographiqueController extends Libs_Controller
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
/* Initialize action controller here */
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
require_once('Scores/Field.php');
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$field = new Fields();
|
||||
$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');
|
||||
}
|
||||
|
||||
public function completedAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
$request = $this->getRequest();
|
||||
|
||||
if($request->getParam('dep')) {
|
||||
$output = $this->completedDep($request->getParam('q'));
|
||||
} else if ($request->getParam('reg')) {
|
||||
$output = $this->completedReg($request->getParam('q'));
|
||||
} else if($request->getParam('vil')) {
|
||||
$output = $this->completedVil($request->getParam('q'));
|
||||
}else if($request->getParam('adr_com')) {
|
||||
$output = $this->completedVil($request->getParam('q'));
|
||||
}else if($request->getParam('adr_com_ex')) {
|
||||
$output = $this->completedVil($request->getParam('q'));
|
||||
}
|
||||
|
||||
echo json_encode($output);
|
||||
}
|
||||
|
||||
protected function completedDep($q)
|
||||
{
|
||||
$table = new Table_Departements();
|
||||
$sql = $table->select()
|
||||
->where('libdep LIKE "'.$q.'%"');
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->libdep . $separator . $item->numdep,
|
||||
'value' => $item->numdep
|
||||
);
|
||||
}
|
||||
return ($output);
|
||||
}
|
||||
|
||||
protected function completedVil($q)
|
||||
{
|
||||
$table = new Table_Codepostauxs();
|
||||
$separator = ' ';
|
||||
|
||||
$sql = $table->select()->where('Commune LIKE "'.$q.'%"');
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->Commune . $separator . $item->Codepos,
|
||||
'value' => $item->INSEE
|
||||
);
|
||||
}
|
||||
return ($output);
|
||||
}
|
||||
|
||||
protected function getDeptFromReg($dep)
|
||||
{
|
||||
$table = new Table_Departements();
|
||||
$sql = $table->select()
|
||||
->where('codeRegionInsee = '.$dep);
|
||||
$result = $table->fetchAll($sql)->toArray();
|
||||
$string = '';
|
||||
foreach ($result as $res) {
|
||||
$string .= $res['numdep'].',';
|
||||
}
|
||||
$string = substr($string, 0, strlen($string)-1);
|
||||
return ($string);
|
||||
}
|
||||
|
||||
protected function completedReg($q)
|
||||
{
|
||||
$table = new Table_Regions();
|
||||
$separator = ' ';
|
||||
|
||||
$sql = $table->select()
|
||||
->where('NCCENR LIKE "%'.$q.'%" OR REGION LIKE "%'.$q.'%"');
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->REGION .' '.$item->NCCENR . $separator . $item->REGION,
|
||||
'value' => $this->getDeptFromReg($item->REGION)
|
||||
);
|
||||
}
|
||||
return ($output);
|
||||
}
|
||||
}
|
||||
|
127
application/modules/frontend/controllers/GestionController.php
Normal file
127
application/modules/frontend/controllers/GestionController.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
class GestionController extends Zend_Controller_Action
|
||||
{
|
||||
public function preDispatch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/dashboard.css', 'all');
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function profilsAction()
|
||||
{
|
||||
$profilsM = new Table_EnrichissementProfils();
|
||||
$sql = $profilsM->select()
|
||||
->from($profilsM, array('id', 'idClient', 'login', 'reference', 'tarifLigne', 'dateAjout', 'dateSuppr', 'actif'));
|
||||
$profils = $profilsM->fetchAll($sql);
|
||||
|
||||
$this->view->assign('profils', $profils);
|
||||
}
|
||||
|
||||
public function profilAction(){}
|
||||
|
||||
public function profiladdAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
//Sauvegarde du formulaire
|
||||
if ( $request->isPost() && $request->getParam('submit')=='Enregistrer' ){
|
||||
$params = $request->getParams();
|
||||
|
||||
//Vérifier le formulaire
|
||||
$errForm = 0;
|
||||
foreach ( $params as $key => $value ) {
|
||||
if (empty($value)) {
|
||||
$errForm++;
|
||||
}
|
||||
}
|
||||
if (!$errForm) {
|
||||
|
||||
$dataInsee = 0;
|
||||
// Est ce qu'il existe une donnée insee
|
||||
require_once 'Scores/Enrichissement.php';
|
||||
$fieldsM = new Enrichissement();
|
||||
$fields = $fieldsM->getFields();
|
||||
foreach ( $fields as $key => $val) {
|
||||
if ( array_key_exists('insee', $val) && $val['insee']===true) {
|
||||
$dateInsee = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'idClient' => $params['idClient'],
|
||||
'login' => $params['login'],
|
||||
'reference' => $params['reference'],
|
||||
'criteres' => json_encode($params['criteres']),
|
||||
'tarifLigne' => $params['tarifLigne'],
|
||||
'dataInsee' => $dataInsee,
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
'actif' => 1,
|
||||
);
|
||||
$profilM = new Table_EnrichissementProfils();
|
||||
if ( $profilM->insert($data) ){
|
||||
$this->view->assign('message', "Profil enregistré");
|
||||
} else {
|
||||
$this->view->assign('message', "Erreur lors de la sauvegarde");
|
||||
}
|
||||
} else {
|
||||
$this->view->assign('message', "Erreur lors de la saisie");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Affichage du formulaire
|
||||
require_once 'Scores/Enrichissement.php';
|
||||
$fieldsM = new Enrichissement();
|
||||
$allFields = $fieldsM->getFields();
|
||||
$this->view->assign('fields', $allFields);
|
||||
}
|
||||
|
||||
public function profildelAction(){}
|
||||
|
||||
public function comptagesAction()
|
||||
{
|
||||
$table = new Table_Comptages();
|
||||
$sql = $table->select()
|
||||
->order('dateAjout DESC');
|
||||
$this->view->comptages = $table->fetchAll($sql)->toArray();
|
||||
}
|
||||
|
||||
public function enrichissementsAction()
|
||||
{
|
||||
$table = new Table_EnrichissementIdentifiants();
|
||||
$sql = $table->select()
|
||||
->order('dateAdded DESC');
|
||||
$this->view->enrichissements = $table->fetchAll($sql)->toArray();
|
||||
}
|
||||
|
||||
public function extractAction()
|
||||
{
|
||||
$id = $this->getRequest()->getParam('id');
|
||||
$table = new Table_EnrichissementIdentifiants();
|
||||
$sql = $table->select()
|
||||
->where('idComptage = ?', $id);
|
||||
$result = $table->fetchRow($sql);
|
||||
if(!empty($result)) {
|
||||
$result = $result->toArray();
|
||||
$sirets = json_decode($result['identifiants']);
|
||||
foreach($sirets as $siret) {
|
||||
echo $siret."\n";
|
||||
}
|
||||
}else {
|
||||
echo 'Aucune commande d\'enrichissement sur ce comptage';
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
47
application/modules/frontend/controllers/IndexController.php
Normal file
47
application/modules/frontend/controllers/IndexController.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
Class IndexController extends Libs_Controller
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->view->headScript()
|
||||
->appendFile('/themes/default/scripts/jquery.jstree.js', 'text/javascript')
|
||||
->appendFile('/themes/default/scripts/fields.js', 'text/javascript')
|
||||
->appendFile('/themes/default/scripts/autocompleted.js', 'text/javascript');
|
||||
/* Initialize action controller here */
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
if ($user->customisation) {
|
||||
$this->view->assign('preferences', $user->customisation);
|
||||
}
|
||||
}
|
||||
|
||||
public function criteresAction()
|
||||
{
|
||||
$ajax = $this->getRequest()->getParam('ajax');
|
||||
if($ajax)
|
||||
$this->_helper->layout()->disableLayout();
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
require_once 'Scores/Field.php';
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$this->view->field = new Fields();
|
||||
$this->view->criteres = $session->getCriteres();
|
||||
}
|
||||
|
||||
public function removeAction()
|
||||
{
|
||||
require_once('Scores/SessionCiblage.php');
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$session = new SessionCiblage();
|
||||
$session->unsetCritere($this->getRequest()->getParam('critere'));
|
||||
$objet = new Object_Comptage();
|
||||
$objet->count(null, null);
|
||||
$this->_redirect('/');
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
class JuridiqueController extends Libs_Controller
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
/* Initialize action controller here */
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
require_once('Scores/Field.php');
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
|
||||
$field = new Fields();
|
||||
$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');
|
||||
}
|
||||
|
||||
public function completedAction()
|
||||
{
|
||||
$table = new Table_Formejuridiques();
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
$request = $this->getRequest();
|
||||
|
||||
$sql = $table->select()
|
||||
->where('fjLibelle LIKE "'.$request->getParam('q').'%"');
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->fjLibelle . $separator . $item->fjCode,
|
||||
'value' => $item->fjCode
|
||||
);
|
||||
}
|
||||
echo json_encode($output);
|
||||
}
|
||||
}
|
||||
|
18
application/modules/frontend/controllers/LoginController.php
Normal file
18
application/modules/frontend/controllers/LoginController.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
class LoginController extends Libs_Controller
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
/* Initialize action controller here */
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
// action body
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
Class UploadController extends Zend_Controller_Action
|
||||
{
|
||||
protected $path;
|
||||
protected $extensions;
|
||||
|
||||
public function init()
|
||||
{
|
||||
/*$config = Zend_Registrey::get('configuration');
|
||||
$path = realpath($config->path->data).'/clients';
|
||||
$this->path = $path;
|
||||
$this->extensions = array('.csv');
|
||||
|
||||
if(!file_exists($path)) mkdir($path);*/
|
||||
}
|
||||
|
||||
public function upload()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
if(!empty($_FILES) and count($_FILES) == 1)
|
||||
{
|
||||
$tmp_name = $_FILES['fichier']['tmp_name'];
|
||||
$extension = strrchr($_FILES['fichier']['name'], '.');
|
||||
if(in_array($extension, $this->extensions)) {
|
||||
if (move_uploaded_file($tmp_name, $path.'/'.$tmp_name.'.'.$extension))
|
||||
return ($tmp_name);
|
||||
}
|
||||
}
|
||||
return (false);
|
||||
}
|
||||
|
||||
public function arborescanceAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
$url = implode('/', $this->getRequest()->getParams());
|
||||
echo $url;
|
||||
//$file = $this->upload();
|
||||
/*if($file)
|
||||
{
|
||||
$csv = fgetcsv($file);
|
||||
$csv = str_replace(';', ',', $csv);
|
||||
echo $csv;
|
||||
}*/
|
||||
}
|
||||
}
|
78
application/modules/frontend/controllers/UserController.php
Normal file
78
application/modules/frontend/controllers/UserController.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
class UserController extends Libs_Controller
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
require_once APPLICATION_PATH.'/modules/frontend/models/Forms/Login.php';
|
||||
require_once 'Scores/WsScores.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion de l'authentification
|
||||
*/
|
||||
public function loginAction()
|
||||
{
|
||||
//@todo : gestion des affichages particuliers pour les clients
|
||||
$this->view->headTitle()->append('Connexion');
|
||||
$form = new Form_Login();
|
||||
$this->view->form = $form;
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost()) {
|
||||
$formData = $request->getPost ();
|
||||
if ($form->isValid($formData)) {
|
||||
$login = $form->getValue('login');
|
||||
$pass = $form->getValue('pass');
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$authAdapter = new Scores_AuthAdapter($login, md5($login.'|'.$pass));
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
if (!$result->isValid()){
|
||||
$this->view->message = '';
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
foreach ($result->getMessages() as $message) {
|
||||
$this->view->message.= $message."<br/>";
|
||||
}
|
||||
} else {
|
||||
$url = '';
|
||||
if (Zend_Session::namespaceIsset('login')){
|
||||
$session = new Zend_Session_Namespace('login');
|
||||
if (isset($session->url)) {
|
||||
$url = $session->url;
|
||||
}
|
||||
}
|
||||
if (!empty($url) && $url!='/user/login' && $url!='/localauth'){
|
||||
$this->_redirect($url);
|
||||
}
|
||||
$this->_redirect('/');
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->render('login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion de la déconnexion
|
||||
*/
|
||||
public function logoutAction()
|
||||
{
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$message = $request->getParam('message');
|
||||
$this->view->assign('message', $message);
|
||||
|
||||
$url = 'http://'.$_SERVER['SERVER_NAME'].$this->view->url(array(
|
||||
'controller' => 'user',
|
||||
'action' => 'login',
|
||||
));
|
||||
|
||||
$this->view->assign('url', $url);
|
||||
$this->view->headMeta()->appendHttpEquiv('refresh', '5; url='.$url);
|
||||
$this->render('logout');
|
||||
}
|
||||
|
||||
}
|
||||
|
152
application/modules/frontend/models/Objects/Codepostaux.php
Normal file
152
application/modules/frontend/models/Objects/Codepostaux.php
Normal file
@ -0,0 +1,152 @@
|
||||
<?php
|
||||
class Object_Codepostaux extends Libs_Row
|
||||
{
|
||||
/* Selection des classes statut pour jstree */
|
||||
public function _jstree_checked($type)
|
||||
{
|
||||
require_once('Scores/SessionCiblage.php');
|
||||
$session = new SessionCiblage();
|
||||
$valeurs = $session->getCritere($type);
|
||||
return (substr($valeurs, 0, strlen($valeurs)-1));
|
||||
}
|
||||
|
||||
public function _jstree_undetermined($niveau, $type)
|
||||
{
|
||||
require_once('Scores/SessionCiblage.php');
|
||||
$session = new SessionCiblage();
|
||||
$table = new Table_Departements();
|
||||
$valeurs = explode(',', $session->getCritere($type));
|
||||
//print_r($valeurs);
|
||||
/*$valeurs = array_merge($valeurs, explode(',', $session->getCritere('adr_com')));*/
|
||||
$in = array();
|
||||
|
||||
foreach($valeurs as $valeur) {
|
||||
if($niveau == 0) {
|
||||
if ($type == 'adr_dept'){
|
||||
$insee = $table->fetchAll($table->select('departements', array('codeRegionInsee'))
|
||||
->where('numdep = ?', substr($valeur, 0, 2)))->toArray();
|
||||
foreach ($insee as $code)
|
||||
$in[] = 'adr_reg:'.$code['codeRegionInsee'];
|
||||
} else{
|
||||
$insee = $table->fetchAll($table->select('departements', array('codeRegionInsee'))
|
||||
->where('numdep = ?', substr($valeur, 0, 2)))->toArray();
|
||||
foreach ($insee as $code)
|
||||
$in[] = 'adr_reg:'.$code['codeRegionInsee'];
|
||||
}
|
||||
} else if ($niveau == 1) {
|
||||
$insee = $table->fetchAll($table->select('departements', array('codeRegionInsee'))
|
||||
->where('numdep = ?', substr($valeur, 0, 2)))->toArray();
|
||||
foreach ($insee as $code)
|
||||
$in[] = 'adr_dept:'.$code['numdep'];
|
||||
}
|
||||
}
|
||||
return ($in);
|
||||
}
|
||||
|
||||
public function _getClass($valeur, $niveau)
|
||||
{
|
||||
require_once('Scores/SessionCiblage.php');
|
||||
$session = new SessionCiblage();
|
||||
$valeurs = explode(',', $valeur);
|
||||
$key = ((strlen($valeur) < 5)?'adr_dept':'adr_com');
|
||||
$session = explode(',', $session->getCritere('adr_dept'));
|
||||
$row = 0;
|
||||
foreach ($session as $dept) {
|
||||
if(in_array($dept, $valeurs))
|
||||
$row++;
|
||||
}
|
||||
if($row == count($valeurs) and $row != 1) {
|
||||
return ('jstree-checked');
|
||||
}
|
||||
else if($row > 1)
|
||||
return ('jstree-undetermined');
|
||||
|
||||
/*$type = explode(':', $valeur);
|
||||
if($type[1] == $this->_jstree_checked($type[0]))
|
||||
return ('jstree-checked');
|
||||
else if (in_array($valeur, $this->_jstree_undetermined($niveau, $type[0])))
|
||||
return ('jstree-undetermined');*/
|
||||
}
|
||||
|
||||
protected function getDepartement($region)
|
||||
{
|
||||
$table = new Table_Departements();
|
||||
$sql = $table->select()
|
||||
->where('codeRegionInsee = '.$region);
|
||||
$result = $table->fetchAll($sql)->toArray();
|
||||
$depts = array();
|
||||
foreach($result as $departement) {
|
||||
$depts[] = $departement['numdep'];
|
||||
}
|
||||
return (implode(',', $depts));
|
||||
}
|
||||
|
||||
/* Fonctions de construction de jstree */
|
||||
public function _getRegions()
|
||||
{
|
||||
$region = new Table_Regions();
|
||||
$regions = $region->fetchAll($region->select()->order('NCCENR ASC'))->toArray();
|
||||
$structure = array();
|
||||
|
||||
foreach($regions as $nom) {
|
||||
$structure[] = array(
|
||||
'data' => $nom['NCCENR'],
|
||||
'attr' => array('id' => $this->getDepartement($nom['REGION']),
|
||||
'niveau' => 0,
|
||||
'class' => $this->_getClass($this->getDepartement($nom['REGION']), 0)
|
||||
),
|
||||
'state' => 'closed',
|
||||
'children' => array()
|
||||
);
|
||||
}
|
||||
return (json_encode($structure));
|
||||
}
|
||||
|
||||
public function _getDepartements($codeRegionInsee)
|
||||
{
|
||||
//$code = explode(':', $codeRegionInsee);
|
||||
$departement = new Table_Departements();
|
||||
foreach(explode(',', $codeRegionInsee) as $dept) {
|
||||
$departements[] = $departement->fetchAll($departement->select()
|
||||
->where('numdep ='.$dept))->toArray();
|
||||
}
|
||||
$structure = array();
|
||||
|
||||
foreach($departements as $nom) {
|
||||
$structure[] = array(
|
||||
'data' => $nom[0]['numdep'].' '.$nom[0]['libdep'],
|
||||
'attr' => array('id' => $nom[0]['numdep'],
|
||||
'niveau' => 1,
|
||||
'class' => $this->_getClass($nom[0]['numdep'], 1)
|
||||
),
|
||||
'state' => 'closed',
|
||||
'children' => array()
|
||||
);
|
||||
}
|
||||
|
||||
return (json_encode($structure));
|
||||
}
|
||||
|
||||
public function _getCommunes($numdep)
|
||||
{
|
||||
|
||||
//$numdep = explode(':', $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['Codepos'].' '.$nom['Commune'],
|
||||
'attr' => array('id'=> $nom['INSEE'],
|
||||
'niveau' => 2,
|
||||
'class' => $this->_getClass($nom['INSEE'], 2)
|
||||
),
|
||||
'state' => 'closed',
|
||||
'children' => array()
|
||||
);
|
||||
}
|
||||
|
||||
return (json_encode($structure));
|
||||
}
|
||||
}
|
156
application/modules/frontend/models/Objects/Comptage.php
Normal file
156
application/modules/frontend/models/Objects/Comptage.php
Normal file
@ -0,0 +1,156 @@
|
||||
<?php
|
||||
class Object_Comptage extends Libs_Row
|
||||
{
|
||||
public function saveComptage($ref)
|
||||
{
|
||||
if (empty($ref)) {
|
||||
echo json_encode(array(
|
||||
'error'=>1,
|
||||
'msg'=> "Référence non définie !"));
|
||||
} else {
|
||||
//Session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$criteres = $session->getCriteres();
|
||||
$resultat = $session->getNb('total');
|
||||
$nbInsee = $session->getNb('insee');
|
||||
|
||||
//Informations utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Enregistrement des critères
|
||||
$criteresM = new Table_Criteres();
|
||||
$data = array(
|
||||
'idClient' => $user->idClient,
|
||||
'login' => $user->username,
|
||||
'reference' => $ref,
|
||||
'criteres' => json_encode($criteres),
|
||||
'parent' => 0,
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
$id = $criteresM->insert($data);
|
||||
|
||||
if ($id){
|
||||
//Enregistrement des valeurs du comptage
|
||||
$comptageM = new Table_Comptages();
|
||||
$data = array(
|
||||
'idDefinition' => $id,
|
||||
'resultat' => $resultat,
|
||||
'uniteInsee' => $nbInsee,
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
if ($comptageM->insert($data)) {
|
||||
echo json_encode(array(
|
||||
'error'=>0,
|
||||
'msg'=> "Vos critères ont été sauvegardés sous la référence $ref",
|
||||
'id' => $id));
|
||||
} else {
|
||||
echo json_encode(array(
|
||||
'error'=>1,
|
||||
'msg'=> "Erreur lors de l'enregistrement"));
|
||||
}
|
||||
} else {
|
||||
echo json_encode(array(
|
||||
'error'=>1,
|
||||
'msg'=> "Erreur lors de l'enregistrement"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function count($key, $valeur, $need = false)
|
||||
{
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
|
||||
if(in_array($key, array('adr_dept', 'adr_com', 'adr_reg', 'adr_com_ex', 'adr_dept_ex')))
|
||||
{
|
||||
$valeurs = explode(',', $valeur);
|
||||
if($key == 'adr_dept') {
|
||||
$reg_ = $session->getCritere('adr_reg');
|
||||
if(!empty($reg_)) {
|
||||
$reg_ = explode(',', $reg_);
|
||||
$table = new Table_Departements();
|
||||
$result = array();
|
||||
foreach($reg_ as $item) {
|
||||
$sql = $table->select()->where('codeRegionInsee = ?', $item);
|
||||
$donner = $table->fetchAll($sql)->toArray();
|
||||
foreach ($donner as $don) {
|
||||
$result[] = $don['numdep'];
|
||||
}
|
||||
foreach($result as $dep) {
|
||||
if(in_array($dep, $valeurs)) {
|
||||
$diff[] = $dep;
|
||||
}
|
||||
}
|
||||
$session->unsetCritereValue('adr_reg', $item);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach($valeurs as $valeur)
|
||||
{
|
||||
$type = explode(':', $valeur);
|
||||
if(count($type) == 2) {
|
||||
$key = $type[0];
|
||||
$valeur = $type[1];
|
||||
}
|
||||
switch($key) {
|
||||
case 'adr_dept':
|
||||
case 'adr_reg':
|
||||
$dept .= trim($valeur).',';
|
||||
break;
|
||||
case 'adr_com':
|
||||
case 'vil':
|
||||
default:
|
||||
$vil .= trim($valeur).',';
|
||||
break;
|
||||
case 'adr_com_ex':
|
||||
$adr_com_ex .= trim($valeur).',';
|
||||
break;
|
||||
case 'adr_dept_ex':
|
||||
$adr_dept_ex .= trim($valeur).',';
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(strlen($dept)>0) {
|
||||
$dept = substr($dept, 0, strlen($dept)-1);
|
||||
$session->setCritere('adr_dept', $dept);
|
||||
}
|
||||
if(strlen($vil)>0) {
|
||||
$vil = substr($vil, 0, strlen($vil)-1);
|
||||
$session->setCritere('adr_com', $vil);
|
||||
}
|
||||
if(strlen($adr_com_ex)>0) {
|
||||
$adr_com_ex = substr($adr_com_ex, 0, strlen($adr_com_ex)-1);
|
||||
$session->setCritere('adr_com_ex', $adr_com_ex);
|
||||
}
|
||||
if(strlen($adr_dept_ex)>0) {
|
||||
$adr_dept_ex = substr($adr_dept_ex, 0, strlen($adr_dept_ex)-1);
|
||||
$session->setCritere('adr_dept_ex', $adr_dept_ex);
|
||||
}
|
||||
} else
|
||||
$session->setCritere($key, $valeur);
|
||||
|
||||
require_once 'Scores/Field.php';
|
||||
$field = new Fields();
|
||||
|
||||
//Comptage
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($field->getValues());
|
||||
if($need) {
|
||||
return $ciblage->execute(true, 10);
|
||||
}
|
||||
$total = $ciblage->execute();
|
||||
$insee = $ciblage->calculRedevanceInsee();
|
||||
|
||||
$session->setNb('total', $total);
|
||||
$session->setNb('insee', $insee);
|
||||
|
||||
//Retour comptage, unité Insee
|
||||
$result = array(
|
||||
'count' => number_format($total, 0, '', ' '),
|
||||
'insee' => number_format($insee, 0, '', ' ')
|
||||
);
|
||||
return (json_encode($result));
|
||||
}
|
||||
}
|
5
application/modules/frontend/models/Objects/Critere.php
Normal file
5
application/modules/frontend/models/Objects/Critere.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Object_Critere extends Libs_Row
|
||||
{
|
||||
|
||||
}
|
196
application/modules/frontend/models/Objects/Dashboard.php
Normal file
196
application/modules/frontend/models/Objects/Dashboard.php
Normal file
@ -0,0 +1,196 @@
|
||||
<?php
|
||||
Class Object_Dashboard
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$criteresM = new Table_Criteres();
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('id', 'reference', 'dateAjout'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username)
|
||||
->order('dateAjout DESC')
|
||||
->limit(5);
|
||||
|
||||
$rows = $criteresM->fetchAll($sql);
|
||||
|
||||
$results = array();
|
||||
$comptagesM = new Table_Comptages();
|
||||
foreach($rows->toArray() as $item)
|
||||
{
|
||||
$info = array(
|
||||
'id' => $item['id'],
|
||||
'reference' => $item['reference'],
|
||||
'dateCriteres' => $item['dateAjout'],
|
||||
);
|
||||
//Recherche des comptages
|
||||
$sql = $comptagesM->select()
|
||||
->from($comptagesM, array('resultat', 'uniteInsee', "DATE_FORMAT(dateAjout, '%Y/%m/%d %H:%i:%s') as dateAjout"))
|
||||
->where('idDefinition = ?', $item['id'])
|
||||
->order('dateAjout DESC')->limit(1);
|
||||
$comptage = $comptagesM->fetchAll($sql)->toArray();
|
||||
|
||||
if (count($comptage)>0){
|
||||
$info['resultat'] = $comptage[0]['resultat'];
|
||||
$info['uniteInsee'] = $comptage[0]['uniteInsee'];
|
||||
$info['dateComptage'] = $comptage[0]['dateAjout'];
|
||||
}
|
||||
|
||||
$results[] = $info;
|
||||
}
|
||||
return ($results);
|
||||
}
|
||||
|
||||
public function enrichissement($idComptage)
|
||||
{
|
||||
$enrichissements = new Table_EnrichissementIdentifiants();
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$sql = $enrichissements->select()
|
||||
->setIntegrityCheck(false)
|
||||
->from(
|
||||
array('i' => 'enrichissement_identifiants'),
|
||||
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
|
||||
)
|
||||
->join(
|
||||
array('criteres' => 'criteres'), 'i.idCriteres = criteres.id',
|
||||
array('')
|
||||
)
|
||||
->where('criteres.idClient = ?', $user->idClient)
|
||||
->where('criteres.login = ?', $user->username)
|
||||
->where('i.idCriteres = ?', $idComptage);
|
||||
return ($enrichissements->fetchAll($sql));
|
||||
}
|
||||
|
||||
public function enrichissements()
|
||||
{
|
||||
$enrichissementsM = new Table_EnrichissementIdentifiants();
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$sql = $enrichissementsM->select()
|
||||
->setIntegrityCheck(false)
|
||||
->from(
|
||||
array('i' => 'enrichissement_identifiants'),
|
||||
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
|
||||
)
|
||||
->join(
|
||||
array('c' => 'comptages'), 'i.idComptage = c.id',
|
||||
array('')
|
||||
)
|
||||
->join(
|
||||
array('criteres' => 'criteres'), 'i.idCriteres = criteres.id',
|
||||
array('')
|
||||
)
|
||||
->where('criteres.idClient = ?', $user->idClient)
|
||||
->where('criteres.login = ?', $user->username)
|
||||
->order('dateAdded DESC');
|
||||
return ($enrichissementsM->fetchAll($sql));
|
||||
}
|
||||
|
||||
public function menu()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function ciblage($page)
|
||||
{
|
||||
$offset = 20;
|
||||
//Liste des ciblages par paquet de n
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$criteresM = new Table_Criteres();
|
||||
|
||||
//Compter le nombre de page
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('nb' => 'COUNT(*)'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username);
|
||||
$count = $criteresM->fetchRow($sql);
|
||||
$nbCiblage = $count->nb;
|
||||
|
||||
//Récupérer les informations
|
||||
$position = ($page-1)*$offset+1;
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('id', 'reference', 'dateAjout'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username)
|
||||
->order('dateAjout DESC')
|
||||
->limitPage($position, $offset);
|
||||
|
||||
$rows = $criteresM->fetchAll($sql);
|
||||
$results = array();
|
||||
$comptagesM = new Table_Comptages();
|
||||
foreach($rows->toArray() as $item)
|
||||
{
|
||||
$info = array(
|
||||
'id' => $item['id'],
|
||||
'reference' => $item['reference'],
|
||||
'dateCriteres' => $item['dateAjout'],
|
||||
);
|
||||
//Recherche des comptages
|
||||
$sql = $comptagesM->select()
|
||||
->from($comptagesM, array('resultat', 'uniteInsee', "DATE_FORMAT(dateAjout, '%d/%m/%Y %H:%i:%s') as dateAjout"))
|
||||
->where('idDefinition = ?', $item['id'])
|
||||
->order('dateAjout DESC')->limit(1);
|
||||
$comptage = $comptagesM->fetchAll($sql)->toArray();
|
||||
|
||||
if (count($comptage)>0){
|
||||
$info['resultat'] = $comptage[0]['resultat'];
|
||||
$info['uniteInsee'] = $comptage[0]['uniteInsee'];
|
||||
$info['dateComptage'] = $comptage[0]['dateAjout'];
|
||||
}
|
||||
|
||||
$results[] = $info;
|
||||
}
|
||||
|
||||
return (array('ciblages' => $results, 'nbCiblage' => $nbCiblage));
|
||||
}
|
||||
|
||||
public function ciblagedetail($id)
|
||||
{
|
||||
$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);
|
||||
|
||||
$criteres = $table->fetchRow($sql)->toArray();
|
||||
if ($criteres != null){
|
||||
$comptage = new Table_Comptages();
|
||||
$sql = $comptage->select()
|
||||
->where('idDefinition = ?', $id)->order('dateAjout DESC');
|
||||
$comptages = $comptage->fetchAll($sql)->toArray();
|
||||
}
|
||||
return (array_merge(array('comptages' => $comptages), array('criteres' => $criteres)));
|
||||
}
|
||||
|
||||
public function rcomptage($q)
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$criteresM = new Table_Criteres($db);
|
||||
$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'=>'ciblage', 'id'=>$item->id)),
|
||||
);
|
||||
}
|
||||
}
|
||||
return (json_encode($output));
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Object_Departement extends Libs_Row
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
class Object_Formejuridique extends Libs_Row
|
||||
{
|
||||
protected function _jstree_checked()
|
||||
{
|
||||
require_once('Scores/SessionCiblage.php');
|
||||
$session = new SessionCiblage();
|
||||
$valeurs = explode(',', $session->getCritere('cj'));
|
||||
|
||||
foreach($valeurs as $valeur) {
|
||||
if($valeur != '')
|
||||
$return[] = $valeur;
|
||||
}
|
||||
if(is_array($return))
|
||||
return ($return);
|
||||
return (array($valeurs));
|
||||
}
|
||||
|
||||
protected function _jstree_undetermined()
|
||||
{
|
||||
return (array());
|
||||
}
|
||||
|
||||
public function _getClass($valeur)
|
||||
{
|
||||
if(in_array($valeur, $this->_jstree_checked()))
|
||||
return ('jstree-checked');
|
||||
else if (in_array($valeur, $this->_jstree_undetermined()))
|
||||
return ('jstree-undetermined');
|
||||
}
|
||||
|
||||
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'],
|
||||
'class' => $this->_getClass($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'],
|
||||
'class' => $this->_getClass($forme['fjCode'])),
|
||||
'state' => 'close',
|
||||
'children' => (($lenth < 6)?$this->_getFils($forme['fjCode']):array())
|
||||
);
|
||||
$tabfj[] = $structure;
|
||||
}
|
||||
|
||||
return ($tabfj);
|
||||
}
|
||||
}
|
5
application/modules/frontend/models/Objects/Minmax.php
Normal file
5
application/modules/frontend/models/Objects/Minmax.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Object_Minmax extends Libs_Row
|
||||
{
|
||||
|
||||
}
|
107
application/modules/frontend/models/Objects/Naf.php
Normal file
107
application/modules/frontend/models/Objects/Naf.php
Normal file
@ -0,0 +1,107 @@
|
||||
<?php
|
||||
class Object_Naf extends Libs_Row
|
||||
{
|
||||
public function naf($niveau, $key)
|
||||
{
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$sessionCiblage = new SessionCiblage();
|
||||
$val = $sessionCiblage->getCritere($key);
|
||||
$valuesChecked = array();
|
||||
$valuesUndetermined = array();
|
||||
|
||||
if ($val != null){
|
||||
$valuesChecked = explode(',',$val);
|
||||
foreach($valuesChecked as $value){
|
||||
$valuesUndetermined = array_merge($valuesUndetermined, $this->getNafParent($value, true));
|
||||
}
|
||||
}
|
||||
$nafM = new Table_Nafs();
|
||||
$sql = $nafM->select()->where('niveau = ?', $niveau)->order('code ASC');
|
||||
|
||||
$result = $nafM->fetchAll($sql)->toArray();
|
||||
$tabNaf = array();
|
||||
foreach($result as $item)
|
||||
{
|
||||
$structure = array(
|
||||
'data' => $item['code'].' - '.$item['lib'],
|
||||
'attr' => array('id' => $item['code'], 'niveau' => $item['niveau']),
|
||||
'state' => 'closed',
|
||||
'children' => array(),
|
||||
);
|
||||
if (in_array($item['code'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if (in_array($item['code'], $valuesUndetermined)){
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
$tabNaf[] = $structure;
|
||||
}
|
||||
return json_encode($tabNaf);
|
||||
}
|
||||
|
||||
protected function getNafParent($value, $niveau1 = false)
|
||||
{
|
||||
$out = array();
|
||||
if (strlen($value)>2) {
|
||||
$niveau = strlen($value)-1;
|
||||
$new = substr($value,0,$niveau);
|
||||
$out = array_merge($out, array($new), $this->getNafParent($new, $niveau1));
|
||||
} elseif (strlen($value)==2 && $niveau1 === true) {
|
||||
$nafM = new Table_Nafs();
|
||||
$sql = $nafM->select()
|
||||
->from($nafM, array('parent'))
|
||||
->where('code = ?', $value);
|
||||
$result = $nafM->fetchRow($sql);
|
||||
$out[] = $result->parent;
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
public function ajax($parent, $niveau, $key)
|
||||
{
|
||||
//Récupération des valeurs enregistrées en session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$sessionCiblage = new SessionCiblage();
|
||||
$val = $sessionCiblage->getCritere($key);
|
||||
$valuesChecked = array();
|
||||
|
||||
$valuesUndetermined = array();
|
||||
if ($val != null){
|
||||
$valuesChecked = explode(',',$val);
|
||||
foreach($valuesChecked as $value){
|
||||
$valuesUndetermined = array_merge($valuesUndetermined, $this->getNafParent($value));
|
||||
}
|
||||
}
|
||||
|
||||
$niveau++;
|
||||
$nafM = new Table_Nafs();
|
||||
$sql = $nafM->select();
|
||||
if (!empty($parent) && $niveau==2) {
|
||||
$sql->where('parent = ?', $parent);
|
||||
} elseif (!empty($parent) && $niveau>2) {
|
||||
$sql->where("code LIKE '".$parent."%'");
|
||||
}
|
||||
$sql->where('niveau = ?', $niveau)->order('code ASC');
|
||||
|
||||
$result = $nafM->fetchAll($sql)->toArray();
|
||||
$tabNaf = array();
|
||||
foreach($result as $item){
|
||||
$structure = array(
|
||||
'data' => $item['code'].' - '.$item['lib'],
|
||||
'attr' => array('id' => $item['code'], 'niveau' => $item['niveau']),
|
||||
);
|
||||
if (in_array($item['code'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if (in_array($item['code'], $valuesUndetermined)){
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
if ($niveau<5){
|
||||
$structure['state'] = 'closed';
|
||||
$structure['children'] = array();
|
||||
}
|
||||
$tabNaf[] = $structure;
|
||||
}
|
||||
return json_encode($tabNaf);
|
||||
}
|
||||
}
|
5
application/modules/frontend/models/Objects/Pref.php
Normal file
5
application/modules/frontend/models/Objects/Pref.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Object_Prefs extends Libs_Row
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Object_ProfilExtraction extends Libs_Row
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Object_RefExport extends Libs_Row
|
||||
{
|
||||
|
||||
}
|
6
application/modules/frontend/models/Objects/Region.php
Normal file
6
application/modules/frontend/models/Objects/Region.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Object_Region extends Libs_Row
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Table_Codepostauxs extends Libs_Table
|
||||
{
|
||||
protected $_name = 'codepostaux';
|
||||
}
|
5
application/modules/frontend/models/Tables/Comptages.php
Normal file
5
application/modules/frontend/models/Tables/Comptages.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Table_Comptages extends Libs_Table
|
||||
{
|
||||
protected $_name = 'comptages';
|
||||
}
|
5
application/modules/frontend/models/Tables/Criteres.php
Normal file
5
application/modules/frontend/models/Tables/Criteres.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Table_Criteres extends Libs_Table
|
||||
{
|
||||
protected $_name = 'criteres';
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Table_Departements extends Libs_Table
|
||||
{
|
||||
public $_name = 'departements';
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Table_EnrichissementIdentifiants extends Zend_Db_Table_Abstract
|
||||
{
|
||||
public $_name = 'enrichissement_identifiants';
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Table_EnrichissementProfils extends Zend_Db_Table_Abstract
|
||||
{
|
||||
public $_name = 'enrichissement_profils';
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Application_Model_Formejuridique extends Zend_Db_Table_Abstract
|
||||
class Table_Formejuridique extends Libs_Table
|
||||
{
|
||||
protected $_name = 'formejuridique';
|
||||
protected $_primary = 'fjCode';
|
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
class Table_Formejuridiques extends Libs_Table
|
||||
{
|
||||
protected $_name = 'formejuridique';
|
||||
protected $_primary = 'fjCode';
|
||||
|
||||
}
|
5
application/modules/frontend/models/Tables/Minmaxs.php
Normal file
5
application/modules/frontend/models/Tables/Minmaxs.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Table_Minmaxs extends Libs_Table
|
||||
{
|
||||
protected $_name = 'minmax';
|
||||
}
|
5
application/modules/frontend/models/Tables/Nafs.php
Normal file
5
application/modules/frontend/models/Tables/Nafs.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Table_Nafs extends Libs_Table
|
||||
{
|
||||
protected $_name = 'naf';
|
||||
}
|
5
application/modules/frontend/models/Tables/Prefs.php
Normal file
5
application/modules/frontend/models/Tables/Prefs.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Table_Prefs extends Libs_Table
|
||||
{
|
||||
protected $_name = 'prefs';
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Table_ProfilExtraction extends Libs_Table
|
||||
{
|
||||
protected $_name = 'profilExtraction';
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Table_ProfilExtractions extends Libs_Table
|
||||
{
|
||||
protected $_name = 'profileExtraction';
|
||||
}
|
5
application/modules/frontend/models/Tables/RefExport.php
Normal file
5
application/modules/frontend/models/Tables/RefExport.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Table_RefExport extends Libs_Table
|
||||
{
|
||||
protected $_name = 'refexport';
|
||||
}
|
6
application/modules/frontend/models/Tables/Regions.php
Normal file
6
application/modules/frontend/models/Tables/Regions.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Table_Regions extends Libs_Table
|
||||
{
|
||||
protected $_name = 'regions';
|
||||
}
|
||||
|
@ -1,12 +1,13 @@
|
||||
<?php
|
||||
Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function Field($name, $field)
|
||||
public function Field($name, $field, $type = null)
|
||||
{
|
||||
$html = '';
|
||||
if($field != null) {
|
||||
$html.= '<div class="fieldgrp">';
|
||||
$type = $field['type'];
|
||||
if($type == null)
|
||||
$type = $field['type'];
|
||||
switch($type)
|
||||
{
|
||||
case 'select':
|
||||
@ -35,9 +36,23 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
$this->dateHTML($name, $field));
|
||||
break;
|
||||
case 'text':
|
||||
switch($name) {
|
||||
case 'reg':
|
||||
$label = 'Localisation Régions';
|
||||
break;
|
||||
case 'vil':
|
||||
case 'adr_com':
|
||||
$label = 'Localisation Villes';
|
||||
break;
|
||||
case 'dep':
|
||||
$label = 'Localisation Départements';
|
||||
break;
|
||||
default:
|
||||
$label = $field['label'];
|
||||
}
|
||||
$html.= $this->structureHTML(
|
||||
$field['label'],
|
||||
$this->textHTML($name, $field));
|
||||
$label,
|
||||
$this->textHTML($name, $field, $name), $field['help'][ucfirst($name)]);
|
||||
break;
|
||||
case 'textarea':
|
||||
$html.= $this->structureHTML(
|
||||
@ -49,17 +64,22 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
$field['label'],
|
||||
$this->radioHTML($name, $field));
|
||||
break;
|
||||
case 'file':
|
||||
$html.= $this->structureHTML(
|
||||
$field['label'],
|
||||
$this->fileuploadHtml($name, $field));
|
||||
break;
|
||||
}
|
||||
$html.= '</div>';
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
private function structureHTML($label, $html, $liens = array())
|
||||
private function structureHTML($label, $html, $help = null)
|
||||
{
|
||||
$out = '';
|
||||
$out.= $this->structureLabel($label);
|
||||
$out.= '<div class="field">'.$html.$this->structureLink($liens).'</div>';
|
||||
$out.= $this->structureLabel($label, $help);
|
||||
$out.= '<div class="field">'.$html.'</div>';
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -67,43 +87,48 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
* Définition du label
|
||||
* @param unknown_type $label
|
||||
*/
|
||||
private function structureLabel($label)
|
||||
private function structureLabel($label, $help)
|
||||
{
|
||||
return '<label>'.$label.'</label>';
|
||||
$return = '<label>'.$label.'</label>';
|
||||
if($help)
|
||||
$return .= '<p style="font-size:9px;">'.$help.'</p>';
|
||||
|
||||
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/**
|
||||
* Définition des liens
|
||||
*/
|
||||
private function structureLink($liens = array())
|
||||
|
||||
protected function getMinMax($name, $valeur)
|
||||
{
|
||||
$html = '';
|
||||
if (count($liens)>0) {
|
||||
foreach($liens as $lien){
|
||||
$html.= '<a href="'.$lien['url'].'">'.$lien['lib'].'</a>';
|
||||
}
|
||||
if(!empty($name)) {
|
||||
$default = Fields::getMinMax($name);
|
||||
if(empty($valeur[0])){$valeur[0] = $default[0]['min'];}
|
||||
if(empty($valeur[1])){$valeur[1] = $default[0]['max'];}
|
||||
}
|
||||
if (!empty($html)) {
|
||||
return '<span>'.$html.'</span>';
|
||||
}
|
||||
return '';
|
||||
return ($valeur);
|
||||
}
|
||||
|
||||
private function intervalSelectHTML($name, $field)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$sessionValeur = explode(',', $session->getCritere($name));
|
||||
$minMax = $this->getMinMax($name, array(0,0));
|
||||
$return = '<select class="intervalSelect" name="'.$name.'1" id="'.$name.'" number="1">';
|
||||
foreach($field['fields'][$field['type']]['value'] as $elements) {
|
||||
$return .= '<option value="'. $elements[0].'">'.number_format($elements[0], 0,'', ' ').'</option>';
|
||||
if($elements[0] == 0)
|
||||
$return .= '<option value="'.$minMax[0].'">Min</option>';
|
||||
else
|
||||
$return .= '<option '.(($sessionValeur[0] == $elements[0])?'selected':'').' value="'. $elements[0].'">'.number_format($elements[0], 0,'', ' ').'</option>';
|
||||
}
|
||||
|
||||
$return .= '</select> à ';
|
||||
$return .= '<select class="intervalSelect" name="'.$name.'2" id="'.$name.'" number="2">';
|
||||
foreach($field['fields'][$field['type']]['value'] as $elements) {
|
||||
$return .= '<option value="'. $elements[1].'">'.number_format($elements[1], 0,'', ' ').'</option>';
|
||||
if($elements[1] == 0)
|
||||
$return .= '<option value="'.$minMax[1].'">Max</option>';
|
||||
else
|
||||
$return .= '<option '.(($sessionValeur[1] == $elements[1])?'selected':'').' value="'. $elements[1].'">'.number_format($elements[1], 0,'', ' ').'</option>';
|
||||
}
|
||||
|
||||
|
||||
$return .= '</select>';
|
||||
$return .= ' <span id="'.$name.'"><a href="" class="intervalSelect" id="'.$name.'">Valider</a></span>';
|
||||
return ($return);
|
||||
@ -114,13 +139,16 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$return = '<select class="criteres" name="'.$name.'">';
|
||||
$return .= '<option value="tous">Tous</option>';
|
||||
$sessionValeur = $session->getCritere($name);
|
||||
/*if(is_array($sessionValeur))
|
||||
$sessionValeur = implode(',', $sessionValeur);*/
|
||||
$return = '<select size="'.count($field['fields'][$field['type']]['value']).'" class="criteres '.$field['type']['class'].'" name="'.$name.'" multiple>';
|
||||
$return .= '<option '.(($sessionValeur == 'tous')?'selected':'').' value="tous">Tous</option>';
|
||||
foreach($field['fields'][$field['type']]['value'] as $value => $label) {
|
||||
$selected = "";
|
||||
if(($session->getCritere($name) != null) and $session->getCritere($name) == $value)
|
||||
if(($sessionValeur != null) and in_array($value, $sessionValeur) and $sessionValeur != "tous")
|
||||
$selected = " selected";
|
||||
$return .= '<option'.((!empty($selected))?$selected:null).' value="'.$value.'">'.$label.'</option>';
|
||||
$return .= '<option'.$selected.' value="'.$value.'">'.$label.'</option>';
|
||||
}
|
||||
$return .= '</select>';
|
||||
return ($return);
|
||||
@ -135,12 +163,12 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
if(is_array($sessionValeur))
|
||||
$sessionValeur = implode(',', $sessionValeur);
|
||||
$return = '<select class="criteres '.$field['type']['class'].'" name="'.$name.'">';
|
||||
$return .= '<option value="tous">Tous</option>';
|
||||
$return .= '<option '.(($sessionValeur == 'tous')?'selected':'').' value="tous">Tous</option>';
|
||||
foreach($field['fields'][$field['type']]['value'] as $value => $label) {
|
||||
$selected = "";
|
||||
if(($sessionValeur != null) and $sessionValeur == $value)
|
||||
if(($sessionValeur != null) and $sessionValeur == $value and $sessionValeur != "tous")
|
||||
$selected = " selected";
|
||||
$return .= '<option'.((!empty($selected))?$selected:null).' value="'.$value.'">'.$label.'</option>';
|
||||
$return .= '<option'.$selected.' value="'.$value.'">'.$label.'</option>';
|
||||
}
|
||||
$return .= '</select>';
|
||||
return ($return);
|
||||
@ -151,6 +179,7 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
$valeur = $session->getCritere($name);
|
||||
$valeur = explode(',', $valeur);
|
||||
|
||||
$return = '<div class="interval" >';
|
||||
$return .= '<input class="'.$field['class'].'" type="text" name="'.$name.'1" value="'.$valeur[0].'" /> à ';
|
||||
@ -175,12 +204,35 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
}
|
||||
|
||||
/* Textes */
|
||||
private function textHTML($name, $field)
|
||||
private function textHTML($name, $field, $name)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$return = '<input style="border:1px inset silver;width:60%" class="criteres" type="text" name="'.$name.'" value="'.$session->getCritere($name).'" />';
|
||||
|
||||
switch($name) {
|
||||
case 'ape_entrep':
|
||||
case 'ape_etab':
|
||||
$type = 'Naf';
|
||||
break;
|
||||
case 'vil':
|
||||
$type= 'Vil';
|
||||
break;
|
||||
case 'adr_com':
|
||||
case 'adr_com_ex':
|
||||
$type= $name;
|
||||
break;
|
||||
case 'cj':
|
||||
$type = 'Cj';
|
||||
break;
|
||||
case 'cj_ex':
|
||||
$type = 'Cj_ex';
|
||||
break;
|
||||
case 'adr_dept':
|
||||
case 'adr_dept_ex':
|
||||
$type= $name;
|
||||
break;
|
||||
}
|
||||
/* Modifier les données */
|
||||
$return = '<textarea rows="5" style="border:1px inset silver;width:60%" class="criteres complited'.$type.'" id="textarea_'.$name.'" name="'.$name.'">'.$session->getCritere($name).'</textarea>';
|
||||
$return .= '<a href="" class="autocomplet" textarea="'.$name.'">Valider</a> <a href="">Aide</a>';
|
||||
return ($return);
|
||||
}
|
||||
|
||||
@ -188,8 +240,16 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
private function textareaHTML($name, $field)
|
||||
{
|
||||
$return = '<a class="arborescence" title="'.$field['title'].'" href="'.$this->view->url(array('controller' => 'arborescence', 'action' => $field['action'], 'key' => $name)).'">
|
||||
Selection dans une arborescence
|
||||
</a>';
|
||||
<img src="/themes/default/images/arborescence.gif" />
|
||||
</a> <img style="cursor:pointer" class="manuel" ref="'.$name.'" src="/themes/default/images/Textarea.gif" title="Champs texte"/>';
|
||||
if($name == 'adr_com')
|
||||
$return .= ' <img src="/themes/default/images/img_carte_fr.gif" title="Carte de france"/>';
|
||||
return ($return);
|
||||
}
|
||||
|
||||
private function fileuploadHtml($name, $field)
|
||||
{
|
||||
$return = '<input class="upload" type="file" name="fichier" id="'.$name.'" /> ';
|
||||
return ($return);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
$("#<?=$this->key?>").jstree({
|
||||
"themes" : {
|
||||
"theme" : "default",
|
||||
"url" : "/themes/jstree/default/style.css",
|
||||
"url" : "/themes/jstree/classic/style.css",
|
||||
"dots" : true,
|
||||
"icons" : false,
|
||||
},
|
@ -0,0 +1,4 @@
|
||||
<br /><br />
|
||||
<div id="view-content">
|
||||
<p>View script for controller <b>Arborescence</b> and script/action name <b>index</b></p>
|
||||
</div>
|
@ -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>
|
@ -3,9 +3,9 @@
|
||||
$("#<?=$this->key?>").jstree({
|
||||
"themes" : {
|
||||
"theme" : "default",
|
||||
"url" : "/themes/jstree/default/style.css",
|
||||
"url" : "/jstree/style.css",
|
||||
"dots" : true,
|
||||
"icons" : false,
|
||||
"icons" : false,
|
||||
},
|
||||
"plugins" : ["themes", "json_data", "checkbox"],
|
||||
"json_data" : {
|
@ -0,0 +1,4 @@
|
||||
<br /><br />
|
||||
<div id="view-content">
|
||||
<p>View script for controller <b>Comptage</b> and script/action name <b>index</b></p>
|
||||
</div>
|
@ -0,0 +1,29 @@
|
||||
<div style="width:100%;">
|
||||
<style>
|
||||
.color{
|
||||
background-color: #DCE3FC;
|
||||
}
|
||||
</style>
|
||||
<table width="100%" style="font-size:10px;">
|
||||
<tr>
|
||||
<?php foreach($this->champs as $champ): ?>
|
||||
<th style="border-left:1px solid black;padding:2px;"><b><?php echo $champ; ?></b></th>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php
|
||||
$i=0;
|
||||
if(count($this->liste) > 0) {
|
||||
foreach($this->liste as $societe) {
|
||||
echo '<tr '.((($i%2) == 0)?'class="color"':'').'>';
|
||||
foreach($this->champs as $champ) {
|
||||
echo '<td style="border-left:1px solid silver;padding:2px">'.$societe[$this->reference[$champ]['column']].'</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
echo '<tr><td>Vous n\'avez selectionné aucuns critères</td></tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<div>
|
@ -0,0 +1,16 @@
|
||||
<?php if ($this->noSelection): ?>
|
||||
Vous n'avez pas sélectionné de critères !
|
||||
<?php else:?>
|
||||
|
||||
<div id="result">
|
||||
<form method="post" id="save" name="save" action="<?=$this->url(array('controller'=>'comptage', 'action'=>'save'))?>">
|
||||
<center>
|
||||
<label>Votre référence</label><br />
|
||||
<input type="text" name="ref" value="<?=date('Y-m-d:H-i-m').'_'.uniqid()?>" />
|
||||
</form>
|
||||
<span class="message" style="color:#ff0000;"></span>
|
||||
</center>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="/themes/default/scripts/jquery.form.js"></script>
|
||||
<?php endif;?>
|
@ -0,0 +1 @@
|
||||
<?=json_encode($this->result)?>
|
@ -0,0 +1,81 @@
|
||||
<div id="dashboard" style="padding:10px">
|
||||
<a href="/dashboard/index">Tableau de bord</a> > Detail du ciblage<br /><br />
|
||||
<a class="update" href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$this->comptageId))?>">Actualiser</a> |
|
||||
<a href="<?=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$this->comptageId))?>">Recharger les critères de ciblage</a> |
|
||||
<a class="enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement','action'=>'reference', 'id'=>$this->comptageId))?>">Enrichissement</a>
|
||||
|
||||
<fieldset>
|
||||
<legend>Critères</legend>
|
||||
<?php foreach(json_decode($this->criteres['criteres'], true) as $critere => $valeur): ?>
|
||||
<?php if(!empty($valeur) and $valeur != ',' and !empty($critere)): ?>
|
||||
<?php $label = $this->label->get($critere); ?>
|
||||
<?php if(!is_array($valeur)): ?>
|
||||
<?php if($label['type'] != 'textarea' and $label['type'] != 'interval') :?>
|
||||
<?php echo '<b>'.$label['label'] . '</b> : '.$label['fields'][$label['type']]['value'][$valeur];?><br />
|
||||
<?php else: ?>
|
||||
<?php echo '<b>'.$label['label'] . '</b>:'.$valeur; ?><br />
|
||||
<?php endif; ?>
|
||||
<?php else:?>
|
||||
<?php echo '<b>'.$label['label'] .'</b> : '. implode(',', $valeur).'<br />'; ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php endforeach;?>
|
||||
</fieldset>
|
||||
|
||||
<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>
|
||||
<th><?=$comptage['dateAjout']?></th>
|
||||
<th><?=number_format($comptage['resultat'], 0, '', ' ')?></th>
|
||||
<th><?=number_format($comptage['uniteInsee'], 0, '', ' ')?></th>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend>Enrichissements</legend>
|
||||
<?php if ( count($this->enrichissements)>0 ) {?>
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Reférence</th>
|
||||
<th>Nombre de lignes</th>
|
||||
<th>Fichier</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->enrichissements as $item):?>
|
||||
<tr>
|
||||
<th><?=$item['dateAdded']?></th>
|
||||
<th><?=$item['reference']?></th>
|
||||
<th><?=number_format($item['nbLigneTotales'], 0, '', ' ')?></th>
|
||||
<td>
|
||||
<?php if($item['dateStart']>0): ?>
|
||||
<a href="/enrichissement/download/id/<?php echo $item['id'];?>"><?php echo $item['fichier']; ?></a>
|
||||
<?php else: ?>
|
||||
En attente de traitement
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php }?>
|
||||
</fieldset>
|
||||
|
||||
|
||||
</div>
|
@ -0,0 +1,45 @@
|
||||
<div id="dashboard">
|
||||
|
||||
<div class="chemin">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
|
||||
Liste de vos ciblages
|
||||
</div>
|
||||
|
||||
<div style="margin:5px 0;">
|
||||
<h2>Liste de vos ciblages</h2>
|
||||
|
||||
<?php if(count($this->ciblages)>0):?>
|
||||
|
||||
<table class="ciblage">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Référence</th>
|
||||
<th>Nombre d'entité</th>
|
||||
<th>Unité Insee</th>
|
||||
<th>Date</th>
|
||||
<th colspan="4"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->ciblages as $item):?>
|
||||
<tr>
|
||||
<td class="reference"><?=$item['reference']?></td>
|
||||
<td class="update resultat"><?=number_format($item['resultat'], 0, ',', ' ')?></td>
|
||||
<td class="update insee"><?=number_format($item['uniteInsee'], 0, ',', ' ')?></td>
|
||||
<td class="update date"><?=$item['dateComptage']?></td>
|
||||
<td><a class="update" href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Actualiser</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'=> 'dashboard','action'=>'ciblage', 'id'=>$item['id']))?>">Detail</a></td>
|
||||
<td><a class="enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement','action'=>'reference', 'id'=>$item['id']))?>">Enrichissement</a></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php else:?>
|
||||
<p>Aucun ciblage.<p>
|
||||
<?php endif;?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
@ -0,0 +1 @@
|
||||
<?php
|
@ -0,0 +1,94 @@
|
||||
<div id="dashboard">
|
||||
|
||||
<div class="chemin">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
|
||||
Enrichissement à partir d'un ciblage
|
||||
</div>
|
||||
|
||||
<h2>Fichiers en cours d'enrichissement</h2>
|
||||
|
||||
<?php if(count($this->encours) > 0):?>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Référence</th>
|
||||
<th>Nombre de lignes totales</th>
|
||||
<th>Nombre de lignes traitées</th>
|
||||
<th>Date</th>
|
||||
<th>Etat</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $i=0; foreach($this->encours as $item):?>
|
||||
<tr>
|
||||
<td><?=$item['reference']?></td>
|
||||
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td>
|
||||
<td><?=number_format($item['nbLigneTraites'], 0, ',', ' ')?></td>
|
||||
<td><?=$item['dateAdded']?></td>
|
||||
<td>
|
||||
<?php if ( $item['dateStart']!='0000-00-00 00:00:00' ) {?>
|
||||
En cours de traitement
|
||||
<?php } else {?>
|
||||
En attente de traitement
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else:?>
|
||||
<p>Aucun enrichissement en cours.<p>
|
||||
<?php endif;?>
|
||||
|
||||
<h2>Fichiers enrichis</h2>
|
||||
|
||||
<?php if(count($this->fini) > 0):?>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Référence</th>
|
||||
<th>Nombre de lignes totales</th>
|
||||
<th>Date</th>
|
||||
<th>Fichier</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->fini as $item):?>
|
||||
<tr>
|
||||
<td><?=$item['reference']?></td>
|
||||
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td>
|
||||
<td><?=$item['dateAdded']?></td>
|
||||
<td><a href="/enrichissement/download/id/<?php echo $item['id'];?>"><?php echo $item['fichier']; ?></a></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else:?>
|
||||
<p>Aucun enrichissement.<p>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function()
|
||||
{
|
||||
$(document).focusin(function(){
|
||||
timer = setInterval(updateInfo, 10000);
|
||||
});
|
||||
$(document).focusout(function(){
|
||||
clearInterval(timer);
|
||||
});
|
||||
timer = setInterval(updateInfo, 10000);
|
||||
});
|
||||
|
||||
var timer;
|
||||
function updateInfo()
|
||||
{
|
||||
$('tr.encours').each(function(){
|
||||
var objet = $(this);
|
||||
var id = $(this).attr('id');
|
||||
$.getJSON('/index/getinfo', {id: id}, function(data){
|
||||
if (data!=''){ objet.find('td.ligne').text(data.nbLigneT); }
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
@ -0,0 +1,89 @@
|
||||
<div id="dashboard">
|
||||
|
||||
<div class="chemin">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a>
|
||||
</div>
|
||||
|
||||
<div id="menu">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'ciblages'))?>">Liste de vos ciblages</a> -
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'enrichissements'))?>">Liste de vos enrichissements</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'=>''))?>">Enrichissement de fichier</a>
|
||||
</div>
|
||||
|
||||
<div id="rechercheCiblage">
|
||||
<h2>Rechercher dans vos ciblages</h2>
|
||||
<input type="text" name="searchCiblage" class="searchCiblage" />
|
||||
<input type="submit" value="Rechercher" class="submit"/>
|
||||
</div>
|
||||
|
||||
<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>Date</th>
|
||||
<th colspan="4"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->comptages as $name => $item):?>
|
||||
<tr>
|
||||
<td class="reference"><?=$item['reference']?></td>
|
||||
<td class="update resultat"><?=number_format($item['resultat'], 0, ',', ' ')?></td>
|
||||
<td class="update insee"><?=number_format($item['uniteInsee'], 0, ',', ' ')?></td>
|
||||
<td class="update date"><?=$item['dateComptage']?></td>
|
||||
<td><a class="update" href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Actualiser</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'=> 'dashboard','action'=>'ciblage', 'id'=>$item['id']))?>">Detail</a></td>
|
||||
<td><a class="enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement','action'=>'reference', 'id'=>$item['id']))?>">Enrichissement</a></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else:?>
|
||||
<p>Aucun ciblage.<p>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="lastEnrichissement">
|
||||
<h2>Vos derniers enrichissements</h2>
|
||||
<?php if(count($this->enrichissements) > 0):?>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Référence</th>
|
||||
<th>Nombre de lignes totales</th>
|
||||
<th>Date</th>
|
||||
<th>Etat</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $i=0;foreach($this->enrichissements as $item):?>
|
||||
<?php if($i++ == 5)break;?>
|
||||
<tr>
|
||||
<td><?=$item['reference']?></td>
|
||||
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td>
|
||||
<td><?=$item['dateAdded']?></td>
|
||||
<td>
|
||||
<?php if ( $item['dateStop']!='0000-00-00 00:00:00' ) {?>
|
||||
<a href="/enrichissement/download/id/<?php echo $item['id'];?>"><?php echo $item['fichier']; ?></a>
|
||||
<?php }elseif ( $item['dateStart']!='0000-00-00 00:00:00' ) {?>
|
||||
En cours de traitement
|
||||
<?php } else {?>
|
||||
En attente de traitement
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else:?>
|
||||
<p>Aucun enrichissement.<p>
|
||||
<?php endif;?>
|
||||
</div>
|
@ -0,0 +1 @@
|
||||
<?php
|
@ -0,0 +1,55 @@
|
||||
<div id="economique">
|
||||
<span style="color:red;text-align:right;padding:5px;margin-top:-5px;">
|
||||
*<sup>Il n'est pas nécessaire de remplire tous les champs.</sup>
|
||||
</span>
|
||||
<hr />
|
||||
<div id="s_economique">
|
||||
<ul id="fieldsblock">
|
||||
<li><?php echo $this->Field('capital', $this->fields->get('capital'));?></li>
|
||||
<li><?php echo $this->Field('ape_etab', $this->fields->get('ape_etab'));?></li>
|
||||
<li class="ape_etab" style="display:none;background-image:none;height:100px;">
|
||||
<div id="ape_etab_ex" class="exclusion" style="display:none">
|
||||
<?php echo $this->Field('ape_etab_ex', $this->fields->get('ape_etab_ex'), 'text');?>
|
||||
</div>
|
||||
<div id="ape_etab_in" class="inclusion">
|
||||
<?php echo $this->Field('ape_etab', $this->fields->get('ape_etab'), 'text');?>
|
||||
</div>
|
||||
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="ape_etab" />
|
||||
</li>
|
||||
<li class="ape_etab" style="display:none;background-image:none;height:100px;">
|
||||
<div id="ape_entrep_ex" class="exclusion" style="display:none">
|
||||
<?php echo $this->Field('ape_entrep_ex', $this->fields->get('ape_entrep_ex'), 'text');?>
|
||||
</div>
|
||||
<div id="ape_entrep_in" class="inclusion">
|
||||
<?php echo $this->Field('ape_entrep', $this->fields->get('ape_entrep'), 'text');?>
|
||||
</div>
|
||||
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="ape_entrep" />
|
||||
</li>
|
||||
<li><?php echo $this->Field('age_etab', $this->fields->get('age_etab'));?></li>
|
||||
<li><?php echo $this->Field('teff_etab', $this->fields->get('teff_etab'));?></li>
|
||||
<li><?php echo $this->Field('teff_etabM', $this->fields->get('teff_etabM'));?></li>
|
||||
<li><?php echo $this->Field('eff_etab', $this->fields->get('eff_etab'));?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="a_economique" style="display:none">
|
||||
<fieldset style="border:1px solid silver;padding:2px;">
|
||||
<legend>Critères Avancés</legend>
|
||||
<ul id="fieldsblock">
|
||||
<li><?php echo $this->Field('age_entrep', $this->fields->get('age_entrep'));?></li>
|
||||
<li><?php echo $this->Field('teff_entrep', $this->fields->get('teff_entrep'));?></li>
|
||||
<li><?php echo $this->Field('teff_entrepM', $this->fields->get('teff_entrepM'));?></li>
|
||||
<li><?php echo $this->Field('eff_entrep', $this->fields->get('eff_entrep'));?></li>
|
||||
<li><?php echo $this->Field('nbEtab', $this->fields->get('nbEtab'));?></li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
</div>
|
||||
<hr style="margin-top:5px;" />
|
||||
<p>
|
||||
<a class="mode" id="a_economique" style="cursor:pointer;margin-left:50%">
|
||||
<img src="/themes/default/images/fleche-bas.gif" />
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div style="text-align:right;margin-top:20px;">
|
||||
<a class="resetFamille" id="economique">Réinitialiser les critères economiques</a>
|
||||
</div>
|
@ -0,0 +1,9 @@
|
||||
Votre commande a bien été prise en compte sous la référence
|
||||
|
||||
|
||||
<script>
|
||||
$('#dialog').dialog({ buttons: [ {
|
||||
text: "Quitter",
|
||||
click: function() { $(this).dialog('close'); }
|
||||
} ] });
|
||||
</script>
|
@ -0,0 +1,100 @@
|
||||
<?php if ( !$this->profil ) {?>
|
||||
Aucun profil d'enrichissement, Merci de prendre contact avec le service commercial.
|
||||
<?php }elseif ( empty($this->id) ) {?>
|
||||
Erreur
|
||||
<?php } elseif ($this->resultat>50000) {?>
|
||||
<p>Le nombre de lignes à enrichir est trop important.
|
||||
Vous pouvez prendre contact avec le service commercial en cliquant ici.
|
||||
Vos critères seront enregistrées et une référence vous sera fourni.</p>
|
||||
<?php } else {?>
|
||||
<div id="update">
|
||||
<style>
|
||||
#enrichissement
|
||||
{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
#enrichissement th
|
||||
{
|
||||
font-weight:800;
|
||||
}
|
||||
|
||||
#enrichissement td, th
|
||||
{
|
||||
padding:5px;
|
||||
border-left:1px solid black;
|
||||
}
|
||||
#enrichissement tr
|
||||
{
|
||||
font-size:10px;
|
||||
border:1px solid silver;
|
||||
}
|
||||
</style>
|
||||
<p style="text-align:center;color:green">Votre ciblage a été actualisé</p>
|
||||
<div style="font-size:10px;padding:5px; border:1px dashed green">
|
||||
Les tarifs sont données à titre indicatif et peuvent variées suivant les spécificités de votre compte.
|
||||
</div>
|
||||
<br/>
|
||||
<div style="font-size:10px;padding:5px; border:1px dashed green">
|
||||
Les informations permettant l'enrichissement seront enregistrées, après la saisie de votre référence.
|
||||
</div>
|
||||
<br />
|
||||
<table id="enrichissement">
|
||||
<tr>
|
||||
<th>Libellé</th>
|
||||
<th><?php echo date('Y-m-d');?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nombre d'unités</td>
|
||||
<td><?php echo $this->resultat;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nombre d'unités Insee</td>
|
||||
<td><?php echo $this->uniteInsee;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prix du fichier</td>
|
||||
<td><?php echo $this->prix;?> €</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Redevance Insee</td>
|
||||
<td><?php echo $this->prixInsee;?> €</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Tapez votre référence</b></td>
|
||||
<td colspan="2">
|
||||
<form name="commande" method="post" action="<?=$this->url(array('controller'=>'enrichissement', 'action'=>'commande'))?>">
|
||||
<input type="hidden" name="id" value="<?=$this->id?>" />
|
||||
<input id="cache" type="text" value="<?php echo 'enr_'.date('Y-m-d_').uniqid();?>" name="ref">
|
||||
<div id="progress"></div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php if (!empty($this->infoInsee)) {?>
|
||||
<br/>
|
||||
<p><?=$this->infoInsee?></p>
|
||||
<?php }?>
|
||||
<br/>
|
||||
<script>
|
||||
$('#dialog').dialog({ buttons: [ {
|
||||
text: "Valider",
|
||||
click: function() {
|
||||
$('div#progress').html('<br /><center><img src="/themes/default/images/ajax_loader.gif" /></center>');
|
||||
$('#cache').css('display', 'none');
|
||||
$.post(
|
||||
$('form[name=commande]').attr('action'),
|
||||
$('form[name=commande]').serialize(),
|
||||
function(data){
|
||||
$('div#update').html(data);
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "Quitter",
|
||||
click: function() { $(this).dialog("close"); }
|
||||
}
|
||||
] });
|
||||
</script>
|
||||
</div>
|
||||
<?php }?>
|
@ -0,0 +1,45 @@
|
||||
<!-- <div class="erreur" id="entreprise">
|
||||
|
||||
</div> -->
|
||||
<div id="entreprise">
|
||||
<span style="color:red;text-align:right;padding:5px;margin-top:-5px;">
|
||||
*<sup>Il n'est pas nécessaire de remplire tous les champs.</sup>
|
||||
</span>
|
||||
<hr />
|
||||
<div id="s_entreprise">
|
||||
<ul id="fieldsblock">
|
||||
<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('present cs', $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="li_dateCrea_etab" ><?php echo $this->Field('dateCrea_etab', $this->fields->get('dateCrea_etab'));?></li>
|
||||
<li id="part" ><?php echo $this->Field('part', $this->fields->get('part'));?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="a_entreprise" style="display:none">
|
||||
<fieldset style="border:1px solid silver;padding:5px;">
|
||||
<legend>Critères Avancés</legend>
|
||||
<ul id="fieldsblock">
|
||||
<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="action" ><?php echo $this->Field('action', $this->fields->get('action'));?></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>
|
||||
</fieldset>
|
||||
</div>
|
||||
<hr style="margin-top:5px;" />
|
||||
<p>
|
||||
<a class="mode" id="a_entreprise" style="cursor:pointer;margin-left:50%">
|
||||
<img src="/themes/default/images/fleche-bas.gif" />
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div id="link">
|
||||
<a class="resetFamille" id="entreprise">Réinitialiser les critères entreprises</a>
|
||||
</div>
|
12
application/modules/frontend/views/scripts/error/get.phtml
Normal file
12
application/modules/frontend/views/scripts/error/get.phtml
Normal 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>
|
@ -0,0 +1,69 @@
|
||||
<div id="financiere">
|
||||
<span style="color:red;text-align:right;padding:5px;margin-top:-5px;">
|
||||
*<sup>Il n'est pas nécessaire de remplire tous les champs.</sup>
|
||||
</span>
|
||||
<hr />
|
||||
<div id="s_financier">
|
||||
<ul id="fieldsblock" style="width:100%;height:100%;">
|
||||
<li style="background: none; height:80px;">
|
||||
<div id="bilType_ex" class="exclusion" style="display:none">
|
||||
<?php echo $this->Field('bilType_ex', $this->fields->get('bilType_ex'));?>
|
||||
</div>
|
||||
<div id="bilType_in" class="inclusion">
|
||||
<?php echo $this->Field('bilType', $this->fields->get('bilType'));?>
|
||||
</div>
|
||||
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="bilType" />
|
||||
</li>
|
||||
<li style="background: none; height:150px;">
|
||||
<div id="avisCs_ex" class="exclusion" style="display:none">
|
||||
<?php echo $this->Field('avisCs_ex', $this->fields->get('avisCs_ex'));?>
|
||||
</div>
|
||||
<div id="avisCs_in" class="inclusion">
|
||||
<?php echo $this->Field('avisCs', $this->fields->get('avisCs'));?>
|
||||
</div>
|
||||
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="avisCs" />
|
||||
</li>
|
||||
<li><?php echo $this->Field('bilAnnee', $this->fields->get('bilAnnee'));?></li>
|
||||
<li><?php echo $this->Field('bilCloture', $this->fields->get('bilCloture'));?></li>
|
||||
<li><?php echo $this->Field('bilDuree', $this->fields->get('bilDuree'));?></li>
|
||||
<li style="background: none; height:190px;">
|
||||
<div id="bilTca_ex" class="exclusion" style="display:none">
|
||||
<?php echo $this->Field('bilTca_ex', $this->fields->get('bilTca_ex'));?>
|
||||
</div>
|
||||
<div id="bilTca_in" class="inclusion">
|
||||
<?php echo $this->Field('bilTca', $this->fields->get('bilTca'));?>
|
||||
</div>
|
||||
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="bilTca" />
|
||||
</li>
|
||||
<li><?php echo $this->Field('bilFL', $this->fields->get('bilFL'));?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="a_financiere" style="display:none">
|
||||
<fieldset style="border:1px solid silver;padding:2px;">
|
||||
<legend>Critères Avancés</legend>
|
||||
<ul id="fieldsblock">
|
||||
<li><?php echo $this->Field('bilEE', $this->fields->get('bilEE'));?></li>
|
||||
<li><?php echo $this->Field('bilFK', $this->fields->get('bilFK'));?></li>
|
||||
<li><?php echo $this->Field('bilFR', $this->fields->get('bilFR'));?></li>
|
||||
<li><?php echo $this->Field('bilGF', $this->fields->get('bilGF'));?></li>
|
||||
<li><?php echo $this->Field('bilGP', $this->fields->get('bilGP'));?></li>
|
||||
<li><?php echo $this->Field('bilGW', $this->fields->get('bilGW'));?></li>
|
||||
<li><?php echo $this->Field('bilHD', $this->fields->get('bilHD'));?></li>
|
||||
<li><?php echo $this->Field('bilHH', $this->fields->get('bilHH'));?></li>
|
||||
<li><?php echo $this->Field('bilHL', $this->fields->get('bilHL'));?></li>
|
||||
<li><?php echo $this->Field('bilHM', $this->fields->get('bilHM'));?></li>
|
||||
<li><?php echo $this->Field('bilHN', $this->fields->get('bilHN'));?></li>
|
||||
<li><?php echo $this->Field('bilYP', $this->fields->get('bilYP'));?></li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
</div>
|
||||
<hr style="margin-top:5px;" />
|
||||
<p>
|
||||
<a class="mode" id="a_financiere" style="cursor:pointer;margin-left:50%">
|
||||
<img src="/themes/default/images/fleche-bas.gif" />
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div style="text-align:right;margin-top:20px;">
|
||||
<a class="resetFamille" id="financier">Réinitialiser les critères financiers</a>
|
||||
</div>
|
@ -0,0 +1,42 @@
|
||||
<div id="geographique">
|
||||
<span style="color:red;text-align:right;padding:5px;margin-top:-5px;">
|
||||
*<sup>Il n'est pas nécessaire de remplire tous les champs.</sup>
|
||||
</span>
|
||||
<hr />
|
||||
<ul id="fieldsblock">
|
||||
<li><?php echo $this->Field('adr_com', $this->fields->get('adr_com'));?></li>
|
||||
<li class="adr_com" style="display:none;background-image:none;height:100px;">
|
||||
<div id="adr_com_ex" class="exclusion" style="display:none">
|
||||
<?php echo $this->Field('adr_com_ex', $this->fields->get('adr_com_ex'), 'text');?>
|
||||
</div>
|
||||
<div id="adr_com_in" class="inclusion">
|
||||
<?php echo $this->Field('adr_com', $this->fields->get('adr_com'), 'text');?>
|
||||
</div>
|
||||
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="adr_com" />
|
||||
</li>
|
||||
<li class="adr_com" style="display:none;background-image:none;height:150px;">
|
||||
<div id="adr_dept_ex" class="exclusion" style="display:none">
|
||||
<?php echo $this->Field('adr_dept_ex', $this->fields->get('adr_dept_ex'), 'text');?>
|
||||
</div>
|
||||
<div id="adr_dept_in" class="inclusion">
|
||||
<?php echo $this->Field('adr_dept', $this->fields->get('adr_dept'), 'text');?>
|
||||
</div><br />
|
||||
Recherche régions : <input type="text" name="" id="textarea_adr_reg" /><br />
|
||||
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="adr_dept" />
|
||||
</li>
|
||||
<li style="height:50px;background-image:none">
|
||||
Exclure DOM-TOM <input style="float:right" value="1" type="checkbox" class="ex_prede" name="ex_domtom" /><br />
|
||||
Exclure Etranger <input style="float:right" value="1" type="checkbox" class="ex_prede" name="ex_entr" /><br />
|
||||
Exclure Corse <input style="float:right" value="1" type="checkbox" class="ex_prede" name="ex_corse" /><br />
|
||||
</li>
|
||||
<li><?php echo $this->Field('zus', $this->fields->get('zus'), 'select');?></li>
|
||||
<li><?php echo $this->Field('zru', $this->fields->get('zru'), 'select');?></li>
|
||||
<li><?php echo $this->Field('zfu', $this->fields->get('zfu'), 'select');?></li>
|
||||
<li><?php echo $this->Field('cucs', $this->fields->get('cucs'), 'select');?></li>
|
||||
<li><?php echo $this->Field('zrr', $this->fields->get('zrr'), 'select');?></li>
|
||||
<li><?php echo $this->Field('zafr', $this->fields->get('zafr'), 'select');?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="text-align:right;margin-top:20px;">
|
||||
<a class="resetFamille" id="econmique">Réinitialiser les critères geographiques</a>
|
||||
</div>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user