Passage à la version 1.2

This commit is contained in:
Michael RICOIS 2012-05-10 09:44:20 +00:00
commit 51ba06b275
154 changed files with 4471 additions and 1889 deletions

View File

@ -21,6 +21,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
->appendStylesheet('/themes/jstree/default/style.css') ->appendStylesheet('/themes/jstree/default/style.css')
->appendStylesheet('/themes/jqueryui/jquery-ui.css', 'all') ->appendStylesheet('/themes/jqueryui/jquery-ui.css', 'all')
->appendStylesheet($pathStyle.'/main.css', 'all'); ->appendStylesheet($pathStyle.'/main.css', 'all');
//->appendStylesheet('/themes/multiselect/css/ui.multiselect.css', 'all');
$view->headScript() $view->headScript()
->appendFile($pathScript.'/jquery.js', 'text/javascript') ->appendFile($pathScript.'/jquery.js', 'text/javascript')
@ -30,6 +31,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
->appendFile($pathScript.'/jquery.qtip.js', 'text/javascript') ->appendFile($pathScript.'/jquery.qtip.js', 'text/javascript')
->appendFile($pathScript.'/upload.js', 'text/javascript') ->appendFile($pathScript.'/upload.js', 'text/javascript')
->appendFile($pathScript.'/scripts.js', 'text/javascript'); ->appendFile($pathScript.'/scripts.js', 'text/javascript');
//->appendFile($pathScript.'/ui.multiselect.js', 'text/javascript');
$view->headTitle()->setSeparator(' - '); $view->headTitle()->setSeparator(' - ');
$view->headTitle('Odea'); $view->headTitle('Odea');
@ -46,7 +48,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
protected function _initDb() protected function _initDb()
{ {
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases'); $dbConfig = Zend_Registry::get('configuration')->databases;
try { try {
$db = Zend_Db::factory($dbConfig->db); $db = Zend_Db::factory($dbConfig->db);
Zend_Db_Table::setDefaultAdapter ($db); Zend_Db_Table::setDefaultAdapter ($db);
@ -56,33 +58,4 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
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;
}
} }

View File

@ -1,35 +1,27 @@
[production] [production]
;phpSettings.session.gc_maxlifetime = 86400
;phpSettings.session.cookie_lifetime = 86400
phpSettings.date.timezone = "Europe/Paris" phpSettings.date.timezone = "Europe/Paris"
phpSettings.display_startup_errors = 0 phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0 phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap" bootstrap.class = "Bootstrap"
appnamespace = "Application"
; so auto-loading will find our classes in library/App resources.session.save_path = APPLICATION_PATH "/../cache/sessions"
autoloaderNamespaces[] = "Structure_" ;Les structures de données resources.session.gc_maxlifetime = 86400
autoloaderNamespaces[] = "Libs_" ;Librairies de l'application resources.session.cookie_lifetime = 86400
resources.view[] = "" resources.session.remember_me_seconds = 86400
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
; initialize front controller resource
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.defaultControllerName = "index"
resources.frontController.defaultAction = "index"
resources.frontController.defaultModule = "frontend"
autoloaderNamespaces[] = "Application_"
resources.frontController.plugins.Comptage = "Application_Controller_Plugin_Comptage"
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth" resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
resources.frontController.plugins.Comptage = "Application_Controller_Plugin_Comptage"
;Resource router Backend resources.frontController.params.displayExceptions = 0
;resources.router.routes.admin.type = Zend_Controller_Router_Route resources.layout.layout = "main"
;resources.router.routes.admin.route = "/backend/*" resources.layout.layoutPath = APPLICATION_PATH "/views/default"
;resources.router.routes.admin.defaults.module = backend resources.view.basePath = APPLICATION_PATH "/views/default"
;resources.router.routes.admin.defaults.controller = index autoloaderNamespaces[] = "Application_"
;resources.router.routes.admin.defaults.action = index autoloaderNamespaces[] = "Scores_"
autoloaderNamespaces[] = "Form_"
; initialize layout resource autoloaderNamespaces[] = "Object_"
resources.layout.layoutPath = APPLICATION_PATH "/layouts"
[staging : production] [staging : production]
phpSettings.display_startup_errors = 1 phpSettings.display_startup_errors = 1

View File

@ -1,6 +1,5 @@
<?php <?php
class ArborescenceController extends Zend_Controller_Action
class ArborescenceController extends Libs_Controller
{ {
/* Nafs */ /* Nafs */
public function nafAction() public function nafAction()
@ -10,8 +9,6 @@ class ArborescenceController extends Libs_Controller
$key = $request->getParam('key'); $key = $request->getParam('key');
$object = new Object_Naf(); $object = new Object_Naf();
//Récupération des valeurs enregistrées en session
$this->view->key = $key; $this->view->key = $key;
$this->view->naf = $object->naf($request->getParam('niveau', 1), $key); $this->view->naf = $object->naf($request->getParam('niveau', 1), $key);
} }

View File

@ -13,8 +13,11 @@ class ComptageController extends Zend_Controller_Action
$request = $this->getRequest(); $request = $this->getRequest();
$cle = $request->getParam('cle');
$valeur = $request->getParam('valeur');
$object = new Object_Comptage(); $object = new Object_Comptage();
echo $object->count($request->getParam('cle'), $request->getParam('valeur')); echo $object->count($cle, $valeur);
} }
public function resetAction() public function resetAction()
@ -57,7 +60,7 @@ class ComptageController extends Zend_Controller_Action
$idCriteres = $request->getParam('id'); $idCriteres = $request->getParam('id');
//Récupération des critères du ciblage //Récupération des critères du ciblage
$criteresM = new Table_Criteres(); $criteresM = new Application_Model_Criteres();
$criteresRow = $criteresM->find($idCriteres); $criteresRow = $criteresM->find($idCriteres);
$criteres = $criteresRow->current(); $criteres = $criteresRow->current();
$structure = json_decode($criteres->criteres, true); $structure = json_decode($criteres->criteres, true);
@ -77,17 +80,62 @@ class ComptageController extends Zend_Controller_Action
'dateAjout' => date('YmdHis'), 'dateAjout' => date('YmdHis'),
); );
//Enregistrement //Enregistrement
$comptageM = new Table_Comptages(); $comptageM = new Application_Model_Comptages();
$comptageM->insert($data); $comptageM->insert($data);
//Retour comptage, unité Insee //Retour comptage, unité Insee
$result = array( $result = array(
'resultat' => number_format($data['resultat'], 0, '', ' '), 'resultat' => number_format($data['resultat'], 0, '', ' '),
'uniteInsee' => number_format($data['dateAjout'], 0, '', ' '), 'uniteInsee' => number_format($data['uniteInsee'], 0, '', ' '),
'dateAjout' => substr($data['dateAjout'],6,2).'/'.substr($data['dateAjout'],4,2).'/'.substr($data['dateAjout'],6,2) '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), .' '.substr($data['dateAjout'],8,2).':'.substr($data['dateAjout'],10,2).':'.substr($data['dateAjout'],12,2),
); );
$this->view->assign('result', $result); $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 = Zend_Registry::get('configuration')->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);
$profilsM = new Application_Model_EnrichissementProfils();
$sql = $profilsM->select()
->where('login = ?', $user->username)
->where('idClient = ?', $user->idClient);
$result = $profilsM->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;
}
} }

View File

@ -1,5 +1,5 @@
<?php <?php
class DashboardController extends Libs_Controller class DashboardController extends Zend_Controller_Action
{ {
public function init() public function init()
{ {
@ -33,11 +33,14 @@ class DashboardController extends Libs_Controller
$object = new Object_Dashboard(); $object = new Object_Dashboard();
$request = $this->getRequest(); $request = $this->getRequest();
$comptage = $object->ciblagedetail($request->getParam('id')); $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->label = new Fields();
$this->view->criteres = $comptage['criteres']; $this->view->criteres = $comptage['criteres'];
$this->view->comptages = $comptage['comptages']; $this->view->comptages = $comptage['comptages'];
$this->view->enrichissements = $enrichissement;
$this->view->pathfile = $config->path->data;
} }
public function rcomptageAction() public function rcomptageAction()
@ -50,7 +53,7 @@ class DashboardController extends Libs_Controller
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
$user = $auth->getIdentity(); $user = $auth->getIdentity();
$criteresM = new Table_Criteres(); $criteresM = new Application_Model_Criteres();
$sql = $criteresM->select() $sql = $criteresM->select()
->from($criteresM, array('id', 'reference', "DATE_FORMAT(dateAjout, '%d/%m/%Y') as date")) ->from($criteresM, array('id', 'reference', "DATE_FORMAT(dateAjout, '%d/%m/%Y') as date"))
->where("idClient = ?", $user->idClient) ->where("idClient = ?", $user->idClient)
@ -77,9 +80,8 @@ class DashboardController extends Libs_Controller
{ {
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
$user = $auth->getIdentity(); $user = $auth->getIdentity();
//Criteres => Comptages (last) => enrichissement_identifiants => enrichissement_commandes //Criteres => Comptages (last) => enrichissement_identifiants => enrichissement_commandes
$enrichissementsM = new Table_EnrichissementIdentifiants(); $enrichissementsM = new Application_Model_EnrichissementIdentifiants();
$sql = $enrichissementsM->select() $sql = $enrichissementsM->select()
->setIntegrityCheck(false) ->setIntegrityCheck(false)
@ -95,19 +97,34 @@ class DashboardController extends Libs_Controller
array('criteres' => 'criteres'), 'i.idCriteres = criteres.id', array('criteres' => 'criteres'), 'i.idCriteres = criteres.id',
array('') array('')
); );
$sql->where('i.dateStop = ?', 0) $sql->where('i.dateStop = ?', 0)
->where('criteres.idClient = ?', $user->idClient) ->where('criteres.idClient = ?', $user->idClient)
->where('criteres.login = ?', $user->username); ->where('criteres.login = ?', $user->username);
$encours = $enrichissementsM->fetchAll($sql); $encours = $enrichissementsM->fetchAll($sql);
$this->view->assign('encours', $encours); $this->view->encours = $encours;
$sql->where('i.dateStop != ?', 0) // Impossible de copie la varible issu d'un select car sinon elle conserve les meme propriété que sont parent
->where('criteres.idClient = ?', $user->idClient) // donc les selects... donc obliger de faire deux requetes pour le moment.
->where('criteres.login = ?', $user->username); $sql = $enrichissementsM->select()
$fini = $enrichissementsM->fetchAll($sql); ->setIntegrityCheck(false)
$this->view->assign('fini', $fini); ->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;
} }
/** /**

View File

@ -1,6 +1,5 @@
<?php <?php
class EconomiqueController extends Zend_Controller_Action
class EconomiqueController extends Libs_Controller
{ {
public function init() public function init()
{ {
@ -10,7 +9,6 @@ class EconomiqueController extends Libs_Controller
public function indexAction() public function indexAction()
{ {
require_once('Scores/Field.php'); require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$field = new Fields(); $field = new Fields();
$this->view->fields = $field; $this->view->fields = $field;
} }
@ -29,7 +27,7 @@ class EconomiqueController extends Libs_Controller
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(); $this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest(); $request = $this->getRequest();
$table = new Table_Nafs(); $table = new Application_Model_Naf();
$sql = $table->select() $sql = $table->select()
->where('lib LIKE "%'.$this->getRequest()->getParam('q').'%"'); ->where('lib LIKE "%'.$this->getRequest()->getParam('q').'%"');

View File

@ -64,30 +64,26 @@ class EnrichissementController extends Zend_Controller_Action
} }
} }
/** /**
* Enregistrement de la commande pour l'ennrichissement * Enregistrement de la commande pour l'ennrichissement
*/ */
public function commandeAction() public function commandeAction()
{ {
set_time_limit(60);
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$request = $this->getRequest(); $request = $this->getRequest();
$idCriteres = $request->getParam('id', null); $idCriteres = $request->getParam('id', null);
$idProfil = $request->getParam('profil', null); $idProfil = $request->getParam('profil', null);
$comptage = new Table_Comptages();
$sql = $comptage->select()->where('idDefinition = ?', $idCriteres);
$result = $comptage->fetchRow($sql);
$idComptage = $result['idDefinition'];
//Vérifier les profils du client //Vérifier les profils du client
if ( $idProfil===null ){ if ( $idProfil===null ){
//Selection du profil du client //Selection du profil du client
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
$user = $auth->getIdentity(); $user = $auth->getIdentity();
$profilsM = new Table_EnrichissementProfils(); $profilsM = new Application_Model_EnrichissementProfils();
$sql = $profilsM->select() $sql = $profilsM->select()
->from($profilsM, array('id')) ->from($profilsM, array('id'))
->where('idClient=?', $user->idClient) ->where('idClient=?', $user->idClient)
@ -97,13 +93,17 @@ class EnrichissementController extends Zend_Controller_Action
$idProfil = $profil->id; $idProfil = $profil->id;
} }
$comptage = new Application_Model_Comptages();
$sql = $comptage->select()->where('idDefinition = ?', $idCriteres);
$result = $comptage->fetchRow($sql);
$idComptage = $result['id'];
//Récupération des critères du ciblage //Récupération des critères du ciblage
$criteresM = new Table_Criteres(); $criteresM = new Application_Model_Criteres();
$criteresRow = $criteresM->find($idCriteres); $criteresRow = $criteresM->find($idCriteres);
$criteres = $criteresRow->current(); $criteres = $criteresRow->current();
$structure = json_decode($criteres->criteres, true); $structure = json_decode($criteres->criteres, true);
require_once 'Scores/Field.php'; require_once 'Scores/Field.php';
$field = new Fields(); $field = new Fields();
$values = $field->getValues($structure); $values = $field->getValues($structure);
@ -124,13 +124,14 @@ class EnrichissementController extends Zend_Controller_Action
'idProfil' => $idProfil, 'idProfil' => $idProfil,
'fichier' => '', 'fichier' => '',
'nbLigneTotales' => count($infosExtraction), 'nbLigneTotales' => count($infosExtraction),
'nbLigneTraites' => count($infosExtraction), 'nbLigneTraites' => 0,
'uniteInsee' => $ciblage->calculRedevanceInsee(), 'uniteInsee' => $ciblage->calculRedevanceInsee(),
'error' => '', 'error' => '',
'dateAdded' => date('YmdHis'), 'dateAdded' => date('YmdHms'),
); );
$identifiantsM = new Table_EnrichissementIdentifiants(); $identifiantsM = new Application_Model_EnrichissementIdentifiants();
$idIdentifiant = $identifiantsM->insert($data); $idIdentifiant = $identifiantsM->insert($data);
exec('php '.APPLICATION_PATH.'/../batch/enrichissement.php --id '.$idIdentifiant);
} }
/** /**
@ -145,29 +146,45 @@ class EnrichissementController extends Zend_Controller_Action
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
$user = $auth->getIdentity(); $user = $auth->getIdentity();
$profilsM = new Table_EnrichissementProfils(); $profilsM = new Application_Model_EnrichissementProfils();
$sql = $profilsM->select() $sql = $profilsM->select()
->from($profilsM, array('id', 'reference', 'tarifLigne', 'dataInsee')) ->from($profilsM, array('id', 'reference', 'tarifLigne', 'dataInsee'))
->where('idClient=?', $user->idClient) ->where('idClient=?', $user->idClient)
->where('login=?', $user->username) ->where('login=?', $user->username)
->where('actif=?', 1); ->where('actif=?', 1);
$profil = $profilsM->fetchRow($sql); $profil = $profilsM->fetchRow($sql);
//
if ($profil!==null) if ($profil!==null)
{ {
$this->view->assign('profil', true); $this->view->assign('profil', true);
$idCritere = $request->getParam('id', null);
$idCritere = $request->getParam('id', null); $comptagesM = new Application_Model_Comptages();
$comptagesM = new Table_Comptages();
$sql = $comptagesM->select() $sql = $comptagesM->select()
->where('idDefinition = ?', $idCritere) ->where('idDefinition = ?', $idCritere)
->order('dateAjout DESC') ->order('dateAjout DESC')
->limit(1); ->limit(1);
$comptages = $comptagesM->fetchAll($sql); $comptages = $comptagesM->fetchAll($sql);
$old = $comptages;
$oldResultat = $old[0]->resultat;
$oldResultatInsee = $old[0]->uniteInsee;
if ( $comptages->count()>0 ) { if ( $comptages->count()>0 ) {
$item = $comptages[0]; $item = $comptages[0];
//@todo : Si le ciblage n'est pas du jour, refaire le comptage par rapport aux critères de ciblage $date = explode(' ', $item->dateAjout);
$date = $date[0];
if($date != '0000-00-00') {
if($date != date('Y-m-d')) {
$criteres = new Application_Model_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('resultat', $item['resultat']);
$this->view->assign('uniteInsee', $item['uniteInsee']); $this->view->assign('uniteInsee', $item['uniteInsee']);
@ -182,14 +199,54 @@ class EnrichissementController extends Zend_Controller_Action
} }
$prix = $item['resultat'] * $profil->tarifLigne + $prixInsee; $prix = $item['resultat'] * $profil->tarifLigne + $prixInsee;
$this->view->assign('prix', $prix); $this->view->prix = round($prix, 2);
$this->view->assign('prixInsee', $prixInsee); $this->view->prixInsee = round($prixInsee, 2);
$this->view->assign('infoInsee', $infoInsee); $this->view->infoInsee = $infoInsee;
$this->view->assign('id', $item['id']); $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 Application_Model_EnrichissementIdentifiants();
$sql = $table->select()
->where('id = ?', $id);
$result = $table->fetchRow($sql);
if(!empty($result)) {
$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.';
}
}
} }

View File

@ -1,6 +1,5 @@
<?php <?php
class EntrepriseController extends Zend_Controller_Action
class EntrepriseController extends Libs_Controller
{ {
public function init() public function init()
{ {
@ -10,7 +9,6 @@ class EntrepriseController extends Libs_Controller
public function indexAction() public function indexAction()
{ {
require_once('Scores/Field.php'); require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$field = new Fields(); $field = new Fields();
$this->view->fields = $field; $this->view->fields = $field;
} }

View File

@ -1,6 +1,5 @@
<?php <?php
class ErreurController extends Zend_Controller_Action
class ErreurController extends Libs_Controller
{ {
protected $correlation = array( protected $correlation = array(
'siege' => array('fax', 'tel'), 'siege' => array('fax', 'tel'),

View File

@ -1,6 +1,5 @@
<?php <?php
class FinancierController extends Zend_Controller_Action
class FinancierController extends Libs_Controller
{ {
public function init() public function init()
@ -11,7 +10,6 @@ class FinancierController extends Libs_Controller
public function indexAction() public function indexAction()
{ {
require_once('Scores/Field.php'); require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
$user = $auth->getIdentity(); $user = $auth->getIdentity();
$field = new Fields(); $field = new Fields();

View File

@ -1,6 +1,5 @@
<?php <?php
class GeographiqueController extends Zend_Controller_Action
class GeographiqueController extends Libs_Controller
{ {
public function init() public function init()
@ -11,7 +10,6 @@ class GeographiqueController extends Libs_Controller
public function indexAction() public function indexAction()
{ {
require_once('Scores/Field.php'); require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
$user = $auth->getIdentity(); $user = $auth->getIdentity();
$field = new Fields(); $field = new Fields();
@ -39,6 +37,10 @@ class GeographiqueController extends Libs_Controller
$output = $this->completedReg($request->getParam('q')); $output = $this->completedReg($request->getParam('q'));
} else if($request->getParam('vil')) { } else if($request->getParam('vil')) {
$output = $this->completedVil($request->getParam('q')); $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); echo json_encode($output);
@ -46,9 +48,8 @@ class GeographiqueController extends Libs_Controller
protected function completedDep($q) protected function completedDep($q)
{ {
$table = new Table_Departements(); $table = new Application_Model_Departements();
$sql = $table->select()
$sql = $table->select()
->where('libdep LIKE "'.$q.'%"'); ->where('libdep LIKE "'.$q.'%"');
$result = $table->fetchAll($sql); $result = $table->fetchAll($sql);
foreach ($result as $item) { foreach ($result as $item) {
@ -62,7 +63,7 @@ class GeographiqueController extends Libs_Controller
protected function completedVil($q) protected function completedVil($q)
{ {
$table = new Table_Codepostauxs(); $table = new Application_Model_CodePostaux();
$separator = ' '; $separator = ' ';
$sql = $table->select()->where('Commune LIKE "'.$q.'%"'); $sql = $table->select()->where('Commune LIKE "'.$q.'%"');
@ -76,18 +77,32 @@ class GeographiqueController extends Libs_Controller
return ($output); return ($output);
} }
protected function getDeptFromReg($dep)
{
$table = new Application_Model_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) protected function completedReg($q)
{ {
$table = new Table_Regions(); $table = new Application_Model_Regions();
$separator = ' '; $separator = ' ';
$sql = $table->select() $sql = $table->select()
->where('NCCENR LIKE "%'.$q.'%"'); ->where('NCCENR LIKE "%'.$q.'%" OR REGION LIKE "%'.$q.'%"');
$result = $table->fetchAll($sql); $result = $table->fetchAll($sql);
foreach ($result as $item) { foreach ($result as $item) {
$output[] = array( $output[] = array(
'label' => $item->NCCENR . $separator . $item->REGION, 'label' => $item->REGION .' '.$item->NCCENR . $separator . $item->REGION,
'value' => $item->REGION 'value' => $this->getDeptFromReg($item->REGION)
); );
} }
return ($output); return ($output);

View File

@ -9,6 +9,7 @@ class GestionController extends Zend_Controller_Action
public function init() public function init()
{ {
$this->view->headLink()->appendStylesheet('/themes/default/styles/dashboard.css', 'all'); $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 indexAction()
@ -19,7 +20,7 @@ class GestionController extends Zend_Controller_Action
public function profilsAction() public function profilsAction()
{ {
$profilsM = new Table_EnrichissementProfils(); $profilsM = new Application_Model_EnrichissementProfils();
$sql = $profilsM->select() $sql = $profilsM->select()
->from($profilsM, array('id', 'idClient', 'login', 'reference', 'tarifLigne', 'dateAjout', 'dateSuppr', 'actif')); ->from($profilsM, array('id', 'idClient', 'login', 'reference', 'tarifLigne', 'dateAjout', 'dateSuppr', 'actif'));
$profils = $profilsM->fetchAll($sql); $profils = $profilsM->fetchAll($sql);
@ -68,7 +69,7 @@ class GestionController extends Zend_Controller_Action
'dateAjout' => date('Y-m-d H:i:s'), 'dateAjout' => date('Y-m-d H:i:s'),
'actif' => 1, 'actif' => 1,
); );
$profilM = new Table_EnrichissementProfils(); $profilM = new Application_Model_EnrichissementProfils();
if ( $profilM->insert($data) ){ if ( $profilM->insert($data) ){
$this->view->assign('message', "Profil enregistré"); $this->view->assign('message', "Profil enregistré");
} else { } else {
@ -89,4 +90,38 @@ class GestionController extends Zend_Controller_Action
public function profildelAction(){} public function profildelAction(){}
public function comptagesAction()
{
$table = new Application_Model_Comptages();
$sql = $table->select()
->order('dateAjout DESC');
$this->view->comptages = $table->fetchAll($sql)->toArray();
}
public function enrichissementsAction()
{
$table = new Application_Model_EnrichissementIdentifiants();
$sql = $table->select()
->order('dateAdded DESC');
$this->view->enrichissements = $table->fetchAll($sql)->toArray();
}
public function extractAction()
{
$id = $this->getRequest()->getParam('id');
$table = new Application_Model_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;
}
} }

View File

@ -1,14 +1,12 @@
<?php <?php
Class IndexController extends Libs_Controller Class IndexController extends Zend_Controller_Action
{ {
public function init() public function init()
{ {
$this->view->headScript() $this->view->headScript()
->appendFile('/themes/default/scripts/jquery.jstree.js', 'text/javascript') ->appendFile('/themes/default/scripts/jquery.jstree.js', 'text/javascript')
->appendFile('/themes/default/scripts/fields.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() public function indexAction()
@ -25,10 +23,11 @@ Class IndexController extends Libs_Controller
$ajax = $this->getRequest()->getParam('ajax'); $ajax = $this->getRequest()->getParam('ajax');
if($ajax) if($ajax)
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
require_once 'Scores/SessionCiblage.php'; require_once 'Scores/SessionCiblage.php';
require_once 'Scores/Field.php';
$session = new SessionCiblage(); $session = new SessionCiblage();
require_once 'Scores/Field.php';
$this->view->field = new Fields(); $this->view->field = new Fields();
$this->view->criteres = $session->getCriteres(); $this->view->criteres = $session->getCriteres();
} }
@ -39,6 +38,8 @@ Class IndexController extends Libs_Controller
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$session = new SessionCiblage(); $session = new SessionCiblage();
$session->unsetCritere($this->getRequest()->getParam('critere')); $session->unsetCritere($this->getRequest()->getParam('critere'));
$objet = new Object_Comptage();
$objet->count(null, null);
$this->_redirect('/'); $this->_redirect('/');
} }
} }

View File

@ -1,6 +1,5 @@
<?php <?php
class JuridiqueController extends Zend_Controller_Action
class JuridiqueController extends Libs_Controller
{ {
public function init() public function init()
@ -11,7 +10,6 @@ class JuridiqueController extends Libs_Controller
public function indexAction() public function indexAction()
{ {
require_once('Scores/Field.php'); require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$field = new Fields(); $field = new Fields();
$this->view->fields = $field; $this->view->fields = $field;
} }
@ -27,7 +25,7 @@ class JuridiqueController extends Libs_Controller
public function completedAction() public function completedAction()
{ {
$table = new Table_Formejuridiques(); $table = new Application_Model_FormJuridique();
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(); $this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest(); $request = $this->getRequest();

View File

@ -0,0 +1,72 @@
<?php
class UserController extends Zend_Controller_Action
{
/**
* 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');
}
}

View File

@ -0,0 +1,5 @@
<?php
class Application_Model_CodePostaux extends Zend_Db_Table_Abstract
{
protected $_name = 'codepostaux';
}

View File

@ -0,0 +1,5 @@
<?php
class Application_Model_Comptages extends Zend_Db_Table_Abstract
{
protected $_name = 'comptages';
}

View File

@ -0,0 +1,5 @@
<?php
class Application_Model_Criteres extends Zend_Db_Table_Abstract
{
protected $_name = 'criteres';
}

View File

@ -0,0 +1,5 @@
<?php
class Application_Model_Departements extends Zend_Db_Table_Abstract
{
public $_name = 'departements';
}

View File

@ -0,0 +1,5 @@
<?php
class Application_Model_EnrichissementIdentifiants extends Zend_Db_Table_Abstract
{
public $_name = 'enrichissement_identifiants';
}

View File

@ -0,0 +1,5 @@
<?php
class Application_Model_EnrichissementProfils extends Zend_Db_Table_Abstract
{
public $_name = 'enrichissement_profils';
}

View File

@ -1,5 +1,5 @@
<?php <?php
class Table_Formejuridique extends Libs_Table class Application_Model_FormJuridique extends Zend_Db_Table_Abstract
{ {
protected $_name = 'formejuridique'; protected $_name = 'formejuridique';
protected $_primary = 'fjCode'; protected $_primary = 'fjCode';

View File

@ -0,0 +1,5 @@
<?php
class Application_Model_MinMax extends Zend_Db_Table_Abstract
{
protected $_name = 'minmax';
}

View File

@ -0,0 +1,5 @@
<?php
class Application_Model_Naf extends Zend_Db_Table_Abstract
{
protected $_name = 'naf';
}

View File

@ -0,0 +1,5 @@
<?php
class Application_Model_Prefs extends Zend_Db_Table_Abstract
{
protected $_name = 'prefs';
}

View File

@ -0,0 +1,5 @@
<?php
class Application_Model_ProfilExtraction extends Zend_Db_Table_Abstract
{
protected $_name = 'profilExtraction';
}

View File

@ -0,0 +1,5 @@
<?php
class Application_Model_RefExport extends Zend_Db_Table_Abstract
{
protected $_name = 'refexport';
}

View File

@ -0,0 +1,6 @@
<?php
class Application_Model_Regions extends Zend_Db_Table_Abstract
{
protected $_name = 'regions';
}

View File

@ -1,18 +0,0 @@
<?php
class LoginController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
// action body
}
}

View File

@ -1,96 +0,0 @@
<?php
class UserController extends Libs_Controller
{
public function init()
{
require_once APPLICATION_PATH.'/modules/frontend/models/Forms/Login.php';
require_once 'Scores/WebAuthAdapter.php';
require_once 'Scores/WsScores.php';
}
public function loginAction()
{
$this->view->headTitle()->append('Connexion');
$form = new Form_Login();
$this->view->form = $form;
$request = $this->getRequest();
//print_r($request->getParams());exit;
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' &&
$url != '/user/logout'
&& $url!='/favicon.ico')
{
$this->_redirect($url);
}
$this->_redirect('/');
}
}
}
$this->_helper->layout()->disableLayout();
$this->render('login');
}
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');
}
}

View File

@ -1,5 +0,0 @@
<?php
class Object_Critere extends Libs_Row
{
}

View File

@ -1,5 +0,0 @@
<?php
class Object_Departement extends Libs_Row
{
}

View File

@ -1,5 +0,0 @@
<?php
class Object_Minmax extends Libs_Row
{
}

View File

@ -1,5 +0,0 @@
<?php
class Object_Prefs extends Libs_Row
{
}

View File

@ -1,5 +0,0 @@
<?php
class Object_ProfilExtraction extends Libs_Row
{
}

View File

@ -1,5 +0,0 @@
<?php
class Object_RefExport extends Libs_Row
{
}

View File

@ -1,6 +0,0 @@
<?php
class Object_Region extends Libs_Row
{
}

View File

@ -1,5 +0,0 @@
<?php
class Table_Codepostauxs extends Libs_Table
{
protected $_name = 'codepostaux';
}

View File

@ -1,5 +0,0 @@
<?php
class Table_Comptages extends Libs_Table
{
protected $_name = 'comptages';
}

View File

@ -1,5 +0,0 @@
<?php
class Table_Criteres extends Libs_Table
{
protected $_name = 'criteres';
}

View File

@ -1,5 +0,0 @@
<?php
class Table_Departements extends Libs_Table
{
public $_name = 'departements';
}

View File

@ -1,5 +0,0 @@
<?php
class Table_EnrichissementIdentifiants extends Zend_Db_Table_Abstract
{
public $_name = 'enrichissement_identifiants';
}

View File

@ -1,5 +0,0 @@
<?php
class Table_EnrichissementProfils extends Zend_Db_Table_Abstract
{
public $_name = 'enrichissement_profils';
}

View File

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

View File

@ -1,5 +0,0 @@
<?php
class Table_Minmaxs extends Libs_Table
{
protected $_name = 'minmax';
}

View File

@ -1,5 +0,0 @@
<?php
class Table_Nafs extends Libs_Table
{
protected $_name = 'naf';
}

View File

@ -1,5 +0,0 @@
<?php
class Table_Prefs extends Libs_Table
{
protected $_name = 'prefs';
}

View File

@ -1,5 +0,0 @@
<?php
class Table_ProfilExtraction extends Libs_Table
{
protected $_name = 'profilExtraction';
}

View File

@ -1,5 +0,0 @@
<?php
class Table_RefExport extends Libs_Table
{
protected $_name = 'refexport';
}

View File

@ -1,6 +0,0 @@
<?php
class Table_Regions extends Libs_Table
{
protected $_name = 'regions';
}

View File

@ -1,34 +0,0 @@
<?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'))?>">
<label>Votre référence</label>
<input type="text" name="ref" value="" />
<input type="submit" name="submit" value="Enregistrer">
</form>
<span class="message" style="color:#ff0000;"></span>
</div>
<script type="text/javascript" src="/themes/default/scripts/jquery.form.js"></script>
<script>
$('form#save').bind('submit', function(){
var options = {
target: '#result',
dataType: 'json',
beforeSubmit: function(){},
success: function(data){
if (data.error == 0){
$('#result').html(data.msg);
} else {
$('#result span.message').html(data.msg);
}
}
};
$(this).ajaxSubmit(options);
return false;
});
</script>
<?php endif;?>

View File

@ -1,22 +0,0 @@
<div id="economique">
<div style="display:none" class="error">
<div>Erreur :</div>
</div>
<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 style="background-image:none;height:80px;"><?php echo $this->Field('ape_etab', $this->fields->get('ape_etab'), 'text');?></li>
<li><?php echo $this->Field('ape_entrep', $this->fields->get('ape_entrep'));?></li>
<li style="background-image:none;height:80px;"><?php echo $this->Field('ape_entrep', $this->fields->get('ape_entrep'), 'text');?></li>
<li><?php echo $this->Field('age_entrep', $this->fields->get('age_entrep'));?></li>
<li><?php echo $this->Field('age_etab', $this->fields->get('age_etab'));?></li>
<li><?php echo $this->Field('teff_entrep', $this->fields->get('teff_entrep'));?></li>
<li><?php echo $this->Field('teff_etab', $this->fields->get('teff_etab'));?></li>
<li><?php echo $this->Field('eff_entrep', $this->fields->get('eff_entrep'));?></li>
<li><?php echo $this->Field('eff_etab', $this->fields->get('eff_etab'));?></li>
<li><?php echo $this->Field('nbEtab', $this->fields->get('nbEtab'));?></li>
</ul>
</div>
<div style="text-align:right;margin-top:20px;">
<a class="resetFamille" id="economique">Réinitialiser les critères economiques</a>
</div>

View File

@ -1,51 +0,0 @@
<?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">
<p>Votre ciblage a été actualisé</p>
<p>
Nombre d'unités : <?=$this->resultat?><br/>
Nombre d'unités Insee : <?=$this->uniteInsee?><br/>
<strong>Prix du fichier : <?=$this->prix?></strong> € (dont <?=$this->prixInsee?> € de redevance Insee)
</p>
<?php if (!empty($this->infoInsee)) {?>
<br/>
<p><?=$this->infoInsee?></p>
<?php }?>
<br/>
<p>Les tarifs sont données à titre indicatif et peuvent variées suivant les spécificités de votre compte.</p>
<br/>
<p>
Les informations permettant l'enrichissement seront enregistrées, après la saisie de votre référence.
</p>
<br/>
<form name="commande" method="post" action="<?=$this->url(array('controller'=>'enrichissement', 'action'=>'commande'))?>">
<input type="hidden" name="id" value="<?=$this->id?>" />
<label>Référence : </label><input type="text" name="ref">
</form>
<script>
$('#dialog').dialog({ buttons: [ {
text: "Valider",
click: function() {
$.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 }?>

View File

@ -1,26 +0,0 @@
<!-- <div class="erreur" id="entreprise">
</div> -->
<div id="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('presentRcs', $this->fields->get('presentRcs'));?></li>
<li id="adrDom" ><?php echo $this->Field('adrDom', $this->fields->get('adrDom'));?></li>
<li id="dirNom" ><?php echo $this->Field('dirNom', $this->fields->get('dirNom'));?></li>
<li id="nbMPublic" ><?php echo $this->Field('nbMPubli', $this->fields->get('nbMPubli'));?></li>
<li id="li_dateCrea_etab" ><?php echo $this->Field('dateCrea_ent',$this->fields->get('dateCrea_ent'));?></li>
<li id="li_dateCrea_etab" ><?php echo $this->Field('dateCrea_etab', $this->fields->get('dateCrea_etab'));?></li>
<li id="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="part" ><?php echo $this->Field('part', $this->fields->get('part'));?></li>
<li id="nbPart" ><?php echo $this->Field('nbPart', $this->fields->get('nbPart'));?></li>
</ul>
</div>
<div id="link">
<a class="resetFamille" id="entreprise">Réinitialiser les critères entreprises</a>
</div>

View File

@ -1,26 +0,0 @@
<div id="financiere">
<ul id="fieldsblock">
<li><?php echo $this->Field('bilType', $this->fields->get('bilType'));?></li>
<li><?php echo $this->Field('avisCs', $this->fields->get('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><?php echo $this->Field('bilTca', $this->fields->get('bilTca'));?></li>
<li><?php echo $this->Field('bilEE', $this->fields->get('bilEE'));?></li>
<li><?php echo $this->Field('bilFL', $this->fields->get('bilFL'));?></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>
</div>
<div style="text-align:right;margin-top:20px;">
<a class="resetFamille" id="financier">Réinitialiser les critères financiers</a>
</div>

View File

@ -1,23 +0,0 @@
<div id="geographique">
<ul id="fieldsblock">
<li><?php echo $this->Field('adr_com', $this->fields->get('adr_com'));?></li>
<li style="background-image:none;height:80px;">
<?php echo $this->Field('vil', $this->fields->get('adr_com'), 'text');?>
</li>
<li style="background-image:none;height:80px;">
<?php echo $this->Field('adr_dept', $this->fields->get('adr_dept'), 'text');?>
</li>
<li style="background-image:none;height:80px;">
<?php echo $this->Field('adr_reg', $this->fields->get('adr_reg'), 'text');?>
</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>

View File

@ -1,55 +0,0 @@
<style>
.color {
background-color:#DEDEDE;
}
a
{
text-decoration: none;
}
#criteres_ra
{
width:93%;
font-size: 11px;
}
#criteres_ra tr td {
border-left: 1px solid black;
border-right: 1px solid black;
padding-left:5px;
}
</style>
<table id="criteres_ra" style="margin:10px">
<tr>
<td id="Valide" style="text-align: center" colspan="3"><a class="saveciblage" href="/comptage/savedialog">Valider mon comptage</a></td>
</tr>
<?php $color = 0;foreach($this->criteres as $critere => $valeur):?>
<?php $label = $this->field->get($critere); ?>
<?php if($valeur != 'tous' and $valeur != null and $valeur != 'null' and $valeur != ',' and $critere != 'adr_com'):?>
<?php $valeur = explode(',', $valeur); ?>
<tr <?php echo ((($color%2) == 0)?'class="color"':''); $color++;?>>
<td valign="top" style="padding:5px;width:150px">
<?php echo $label['label'];?>
</td>
<td>
<?php if(is_array($valeur)):?>
<?php $i=0; foreach ($valeur as $val):?>
<?php if($label['type'] != 'textarea' and $label['type'] != 'interval') :?>
<?php echo $label['fields'][$label['type']]['value'][$val];?> <?php (($i%3 == 0)?'<br />':''); $i++;?>
<?php else :?>
<?php echo $val;?>,
<?php endif;?>
<?php endforeach;?>
<?php else: ?>
<?php echo $val;?>
<?php endif; ?>
</td>
<td style="text-align: center">
<a class="remove" href="index/remove/critere/<?php echo $critere;?>">
<img width="14px;" src="/themes/default/images/cross.png" />
</a>
<img src="/themes/default/images/help.png" />
</td>
</tr>
<?php endif;?>
<?php endforeach;?>
</table>

View File

@ -1,27 +0,0 @@
<div id="panel">
<?php echo $this->action('criteres', 'index');?>
</div>
<div id="tabs">
<ul>
<li><a href="#tabs-1">Critères Entreprise</a></li>
<li><a href="#tabs-2">Situation économique</a></li>
<li><a href="#tabs-3">Secteur géographique</a></li>
<li><a href="#tabs-4">Situation juridique</a></li>
<li><a href="#tabs-5">Situation financière</a></li>
</ul>
<div id="tabs-1">
<?php echo $this->action('index', 'entreprise')?>
</div>
<div id="tabs-2">
<?php echo $this->action('index', 'economique')?>
</div>
<div id="tabs-3">
<?php echo $this->action('index', 'geographique')?>
</div>
<div id="tabs-4">
<?php echo $this->action('index', 'juridique')?>
</div>
<div id="tabs-5">
<?php echo $this->action('index', 'financier')?>
</div>
</div>

View File

@ -1,17 +0,0 @@
<div id="juridique">
<ul id="fieldsblock">
<li><?php echo $this->Field('cj', $this->fields->get('cj'));?></li>
<li style="background-image:none;height:80px;">
<i>Indiquez les formes juridiques ou les codes (insee) sur un deux ou quatres chiffres séparés par des virgules.
Si vous disposez d'une liste sous forme excel glissez le fichier dans l'encadré</i>
<?php echo $this->Field('cj', $this->fields->get('cj'), 'text');?>
</li>
<li><?php echo $this->Field('actifEco', $this->fields->get('actifEco'));?></li>
<li><?php echo $this->Field('procolHisto', $this->fields->get('procolHisto'));?></li>
<li><?php echo $this->Field('tvaIntraValide', $this->fields->get('tvaIntraValide'));?></li>
<li><?php echo $this->Field('dateImmat', $this->fields->get('dateImmat'));?></li>
</ul>
</div>
<div style="text-align:right;margin-top:20px;">
<a class="resetFamille" id="econmique">Réinitialiser les critères juridique</a>
</div>

View File

@ -1,3 +0,0 @@
<?php
echo $this->form;
?>

View File

@ -41,6 +41,7 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
$label = 'Localisation Régions'; $label = 'Localisation Régions';
break; break;
case 'vil': case 'vil':
case 'adr_com':
$label = 'Localisation Villes'; $label = 'Localisation Villes';
break; break;
case 'dep': case 'dep':
@ -96,20 +97,36 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
return ($return); return ($return);
} }
protected function getMinMax($name, $valeur)
{
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'];}
}
return ($valeur);
}
private function intervalSelectHTML($name, $field) private function intervalSelectHTML($name, $field)
{ {
$session = new SessionCiblage(); $session = new SessionCiblage();
$sessionValeur = explode(',', $session->getCritere($name)); $sessionValeur = explode(',', $session->getCritere($name));
$minMax = $this->getMinMax($name, array(0,0));
$return = '<select class="intervalSelect" name="'.$name.'1" id="'.$name.'" number="1">'; $return = '<select class="intervalSelect" name="'.$name.'1" id="'.$name.'" number="1">';
foreach($field['fields'][$field['type']]['value'] as $elements) { foreach($field['fields'][$field['type']]['value'] as $elements) {
$return .= '<option '.(($sessionValeur[0] == $elements[0])?'selected':'').' 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> à ';
$return .= '<select class="intervalSelect" name="'.$name.'2" id="'.$name.'" number="2">'; $return .= '<select class="intervalSelect" name="'.$name.'2" id="'.$name.'" number="2">';
foreach($field['fields'][$field['type']]['value'] as $elements) { foreach($field['fields'][$field['type']]['value'] as $elements) {
$return .= '<option '.(($sessionValeur[1] == $elements[1])?'selected':'').' 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 .= '</select>';
@ -121,13 +138,17 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
private function selectMultipleHTML($name, $field) private function selectMultipleHTML($name, $field)
{ {
$session = new SessionCiblage(); $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) { foreach($field['fields'][$field['type']]['value'] as $value => $label) {
$selected = ""; $selected = "";
if(($session->getCritere($name) != null) and $session->getCritere($name) == $value) if(($sessionValeur != null) and in_array($value, $sessionValeur) and $sessionValeur != "tous")
$selected = " selected"; $selected = " selected";
$return .= '<option'.((!empty($selected))?$selected:null).' value="'.$value.'">'.$label.'</option>'; $return .= '<option'.$selected.' value="'.$value.'">'.$label.'</option>';
} }
$return .= '</select>'; $return .= '</select>';
return ($return); return ($return);
@ -194,9 +215,20 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
case 'vil': case 'vil':
$type= 'Vil'; $type= 'Vil';
break; break;
case 'adr_com':
case 'adr_com_ex':
$type= $name;
break;
case 'cj': case 'cj':
$type = 'Cj'; $type = 'Cj';
break; break;
case 'cj_ex':
$type = 'Cj_ex';
break;
case 'adr_dept':
case 'adr_dept_ex':
$type= $name;
break;
} }
/* Modifier les données */ /* 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 = '<textarea rows="5" style="border:1px inset silver;width:60%" class="criteres complited'.$type.'" id="textarea_'.$name.'" name="'.$name.'">'.$session->getCritere($name).'</textarea>';
@ -208,8 +240,10 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
private function textareaHTML($name, $field) private function textareaHTML($name, $field)
{ {
$return = '<a class="arborescence" title="'.$field['title'].'" href="'.$this->view->url(array('controller' => 'arborescence', 'action' => $field['action'], 'key' => $name)).'"> $return = '<a class="arborescence" title="'.$field['title'].'" href="'.$this->view->url(array('controller' => 'arborescence', 'action' => $field['action'], 'key' => $name)).'">
Selection dans une arborescence <img src="/themes/default/images/arborescence.gif" />
</a>'; </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); return ($return);
} }

View File

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

View File

@ -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>

View File

@ -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;?>

View File

@ -1,18 +1,25 @@
<div id="dashboard" style="padding:10px"> <div id="dashboard" style="padding:10px">
<a href="/dashboard/index">Tableau de bord</a> > Detail du ciblage <a href="/dashboard/index">Tableau de bord</a> > Detail du ciblage<br /><br />
<h2></h2> <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> <fieldset>
<legend>Critères</legend> <legend>Critères</legend>
<?php foreach(json_decode($this->criteres['criteres'], true) as $critere => $valeur): ?> <?php foreach(json_decode($this->criteres['criteres'], true) as $critere => $valeur): ?>
<?php if(!empty($valeur) and $valeur != ',' and !empty($critere)): ?> <?php if(!empty($valeur) and $valeur != ',' and !empty($critere)): ?>
<?php $label = $this->label->get($critere); ?> <?php $label = $this->label->get($critere); ?>
<?php if($label['type'] != 'textarea' and $label['type'] != 'interval') :?> <?php if(!is_array($valeur)): ?>
<?php echo '<b>'.$label['label'] . '</b> : '.$label['fields'][$label['type']]['value'][$valeur];?><br /> <?php if($label['type'] != 'textarea' and $label['type'] != 'interval') :?>
<?php else: ?> <?php echo '<b>'.$label['label'] . '</b> : '.$label['fields'][$label['type']]['value'][$valeur];?><br />
<?php echo '<b>'.$label['label'] . '</b>:'.$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 endif; ?> <?php endif; ?>
<?php endforeach;?> <?php endforeach;?>
</fieldset> </fieldset>
<fieldset> <fieldset>
@ -56,7 +63,13 @@
<th><?=$item['dateAdded']?></th> <th><?=$item['dateAdded']?></th>
<th><?=$item['reference']?></th> <th><?=$item['reference']?></th>
<th><?=number_format($item['nbLigneTotales'], 0, '', ' ')?></th> <th><?=number_format($item['nbLigneTotales'], 0, '', ' ')?></th>
<th><?=$item['fichier']?></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> </tr>
<?php endforeach;?> <?php endforeach;?>
</tbody> </tbody>

View File

@ -19,7 +19,7 @@ Enrichissement à partir d'un ciblage
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach($this->encours as $item):?> <?php $i=0; foreach($this->encours as $item):?>
<tr> <tr>
<td><?=$item['reference']?></td> <td><?=$item['reference']?></td>
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td> <td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td>
@ -58,7 +58,7 @@ Enrichissement à partir d'un ciblage
<td><?=$item['reference']?></td> <td><?=$item['reference']?></td>
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td> <td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td>
<td><?=$item['dateAdded']?></td> <td><?=$item['dateAdded']?></td>
<td><?=$item['fichier']?></td> <td><a href="/enrichissement/download/id/<?php echo $item['id'];?>"><?php echo $item['fichier']; ?></a></td>
</tr> </tr>
<?php endforeach;?> <?php endforeach;?>
</tbody> </tbody>

View File

@ -64,14 +64,15 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach($this->enrichissements as $item):?> <?php $i=0;foreach($this->enrichissements as $item):?>
<?php if($i++ == 5)break;?>
<tr> <tr>
<td><?=$item['reference']?></td> <td><?=$item['reference']?></td>
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td> <td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td>
<td><?=$item['dateAdded']?></td> <td><?=$item['dateAdded']?></td>
<td> <td>
<?php if ( $item['dateStop']!='0000-00-00 00:00:00' ) {?> <?php if ( $item['dateStop']!='0000-00-00 00:00:00' ) {?>
Terminé <a href="/enrichissement/download/id/<?php echo $item['id'];?>"><?php echo $item['fichier']; ?></a>
<?php }elseif ( $item['dateStart']!='0000-00-00 00:00:00' ) {?> <?php }elseif ( $item['dateStart']!='0000-00-00 00:00:00' ) {?>
En cours de traitement En cours de traitement
<?php } else {?> <?php } else {?>

View File

@ -0,0 +1,47 @@
<div id="economique">
<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">
<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>
</div>
<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>

View File

@ -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 }?>

View File

@ -0,0 +1,37 @@
<!-- <div class="erreur" id="entreprise">
</div> -->
<div id="entreprise">
<div id="s_entreprise">
<ul id="fieldsblock">
<li id="siege"><?=$this->Field('siege', $this->fields->get('siege'));?></li>
<li id="sirenGrp"><?=$this->Field('sirenGrp', $this->fields->get('sirenGrp'));?></li>
<li id="tel"><?=$this->Field('tel', $this->fields->get('tel'));?></li>
<li id="fax"><?=$this->Field('fax', $this->fields->get('fax'));?></li>
<li id="web"><?=$this->Field('web', $this->fields->get('web'));?></li>
<li id="mail"><?=$this->Field('mail', $this->fields->get('mail'));?></li>
<li id="presentRcs"><?=$this->Field('present cs', $this->fields->get('presentRcs'));?></li>
<li id="adrDom"><?=$this->Field('adrDom', $this->fields->get('adrDom'));?></li>
<li id="dirNom"><?=$this->Field('dirNom', $this->fields->get('dirNom'));?></li>
<li id="li_dateCrea_etab"><?=$this->Field('dateCrea_etab', $this->fields->get('dateCrea_etab'));?></li>
<li id="part"><?=$this->Field('part', $this->fields->get('part'));?></li>
</ul>
</div>
<div id="a_entreprise" style="display:none">
<ul id="fieldsblock">
<li id="nbMPublic"><?=$this->Field('nbMPubli', $this->fields->get('nbMPubli'));?></li>
<li id="li_dateCrea_etab" ><?=$this->Field('dateCrea_ent',$this->fields->get('dateCrea_ent'));?></li>
<li id="action"><?=$this->Field('action', $this->fields->get('action'));?></li>
<li id="nbActio"><?=$this->Field('nbActio', $this->fields->get('nbActio'));?></li>
<li id="nbPart"><?=$this->Field('nbPart', $this->fields->get('nbPart'));?></li>
</ul>
</div>
<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>

View File

@ -0,0 +1,61 @@
<div id="financiere">
<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">
<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>
</div>
<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>

View File

@ -0,0 +1,38 @@
<div id="geographique">
<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>

View File

@ -0,0 +1,30 @@
<div id="dashboard">
<h2>Liste des comptages</h2>
<div>
<table>
<tr>
<th><b>Id</b></th>
<th><b>Date de création</b></th>
<th><b>Référence</b></th>
<th><b>Résultat</b></th>
<th><b>Insee</b></th>
<th><b>Actions</b></th>
</tr>
<?php foreach($this->comptages as $comptage): ?>
<tr>
<td><?php echo $comptage['id']; ?></td>
<td><?php echo $comptage['dateAjout']; ?></td>
<td></td>
<td><?php echo $comptage['resultat']; ?></td>
<td><?php echo $comptage['uniteInsee']; ?></td>
<td>
<a href="">Actualiser</a>
<a class="enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement','action'=>'reference', 'id'=>$comptage['idDefinition']))?>">Enrichissement</a>
<a href="<?=$this->url(array('controller'=> 'gestion','action'=>'extract', 'id'=>$comptage['idDefinition']))?>">Extraire les sirets</a>
<a href="">Supprimer</a>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
</div>

View File

@ -0,0 +1,31 @@
<div id="dashboard">
<h2>Liste des comptages</h2>
<div>
<table>
<tr>
<th><b>Id comptage</b></th>
<th><b>Reference</b></th>
<th><b>NB Ligne Totales</b></th>
<th><b>NB Ligne Traites</b></th>
<th><b>Unitee INSEE</b></th>
<th><b>Date création</b></th>
<th><b>Date début</b></th>
<th><b>Date d'arret</b></th>
<th><b>Fichier</b></th>
</tr>
<?php foreach($this->enrichissements as $enrichissement): ?>
<tr>
<td><?php echo $enrichissement['idComptage']; ?></td>
<td><?php echo $enrichissement['reference']; ?></td>
<td><?php echo $enrichissement['nbLigneTotales']; ?></td>
<td><?php echo $enrichissement['nbLigneTraites']; ?></td>
<td><?php echo $enrichissement['uniteInsee']; ?></td>
<td><?php echo $enrichissement['dateAdded']; ?></td>
<td><?php echo $enrichissement['dateStart']; ?></td>
<td><?php echo $enrichissement['dateStop']; ?></td>
<td><a href="/enrichissement/download/id/<?php echo $enrichissement['id'];?>"><?php echo $enrichissement['fichier']; ?></a></td>
</tr>
<?php endforeach; ?>
</table>
</div>
</div>

View File

@ -5,9 +5,8 @@
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'profiladd'))?>">Créer un profil d'enrichissement pour un client (idClient, login)</a> <a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'profiladd'))?>">Créer un profil d'enrichissement pour un client (idClient, login)</a>
<h2>Gestion des commandes</h2> <h2>Gestion des commandes</h2>
<a href="">Commande</a><br/> <a href="<?php echo $this->url(array('controller' => 'gestion', 'action' => 'comptages'));?>">Liste des comptages</a><br />
<a href="">Lister les commandes</a> <a href="<?php echo $this->url(array('controller' => 'gestion', 'action' => 'enrichissements'));?>">Liste des enrichissements</a>
<h2>Facturation</h2> <h2>Facturation</h2>
</div> </div>

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