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

@ -8,20 +8,21 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$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');
$view->headLink()
$view->headLink()
->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')
@ -30,11 +31,12 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
->appendFile($pathScript.'/jquery.qtip.js', 'text/javascript')
->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
@ -43,10 +45,10 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$logger = new Zend_Log($writer);
Zend_Registry::set('firebug', $logger);
}
protected function _initDb()
{
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
$dbConfig = Zend_Registry::get('configuration')->databases;
try {
$db = Zend_Db::factory($dbConfig->db);
Zend_Db_Table::setDefaultAdapter ($db);
@ -55,34 +57,5 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
}
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]
;phpSettings.session.gc_maxlifetime = 86400
;phpSettings.session.cookie_lifetime = 86400
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"
; 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[] = "Application_"
resources.frontController.plugins.Comptage = "Application_Controller_Plugin_Comptage"
appnamespace = "Application"
resources.session.save_path = APPLICATION_PATH "/../cache/sessions"
resources.session.gc_maxlifetime = 86400
resources.session.cookie_lifetime = 86400
resources.session.remember_me_seconds = 86400
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
;Resource router Backend
;resources.router.routes.admin.type = Zend_Controller_Router_Route
;resources.router.routes.admin.route = "/backend/*"
;resources.router.routes.admin.defaults.module = backend
;resources.router.routes.admin.defaults.controller = index
;resources.router.routes.admin.defaults.action = index
; initialize layout resource
resources.layout.layoutPath = APPLICATION_PATH "/layouts"
resources.frontController.plugins.Comptage = "Application_Controller_Plugin_Comptage"
resources.frontController.params.displayExceptions = 0
resources.layout.layout = "main"
resources.layout.layoutPath = APPLICATION_PATH "/views/default"
resources.view.basePath = APPLICATION_PATH "/views/default"
autoloaderNamespaces[] = "Application_"
autoloaderNamespaces[] = "Scores_"
autoloaderNamespaces[] = "Form_"
autoloaderNamespaces[] = "Object_"
[staging : production]
phpSettings.display_startup_errors = 1

View File

@ -1,6 +1,5 @@
<?php
class ArborescenceController extends Libs_Controller
class ArborescenceController extends Zend_Controller_Action
{
/* Nafs */
public function nafAction()
@ -9,9 +8,7 @@ class ArborescenceController extends Libs_Controller
$request = $this->getRequest();
$key = $request->getParam('key');
$object = new Object_Naf();
//Récupération des valeurs enregistrées en session
$this->view->key = $key;
$this->view->naf = $object->naf($request->getParam('niveau', 1), $key);
}
@ -20,13 +17,13 @@ class ArborescenceController extends Libs_Controller
{
$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),
echo $object->ajax($request->getParam('parent', ''),
$request->getParam('niveau', 1),
$request->getParam('key')
);
}
@ -35,24 +32,24 @@ class ArborescenceController extends Libs_Controller
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) {
@ -64,14 +61,14 @@ class ArborescenceController extends Libs_Controller
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();
@ -79,7 +76,7 @@ class ArborescenceController extends Libs_Controller
$object = new Object_Formejuridique();
$request = $this->getRequest();
$id = $request->getParam('id');
echo ($object->_getFils($id));
}
}

View File

@ -10,11 +10,14 @@ class ComptageController extends Zend_Controller_Action
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$cle = $request->getParam('cle');
$valeur = $request->getParam('valeur');
$object = new Object_Comptage();
echo $object->count($request->getParam('cle'), $request->getParam('valeur'));
echo $object->count($cle, $valeur);
}
public function resetAction()
@ -26,7 +29,7 @@ class ComptageController extends Zend_Controller_Action
unset($erreurs->erreurs);
$this->_redirect('./');
}
public function savedialogAction()
{
$this->_helper->layout()->disableLayout();
@ -35,7 +38,7 @@ class ComptageController extends Zend_Controller_Action
$session = new SessionCiblage();
$criteres = $session->getCriteres();
$this->view->criteres = $criteres;
if (count($criteres) == 0) {
$this->view->noSelection = true;
}
@ -45,31 +48,31 @@ class ComptageController extends Zend_Controller_Action
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$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();
$criteresM = new Application_Model_Criteres();
$criteresRow = $criteresM->find($idCriteres);
$criteres = $criteresRow->current();
$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(),
@ -77,17 +80,62 @@ class ComptageController extends Zend_Controller_Action
'dateAjout' => date('YmdHis'),
);
//Enregistrement
$comptageM = new Table_Comptages();
$comptageM = new Application_Model_Comptages();
$comptageM->insert($data);
//Retour comptage, unité Insee
$result = array(
'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)
.' '.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
class DashboardController extends Libs_Controller
class DashboardController extends Zend_Controller_Action
{
public function init()
{
@ -9,12 +9,12 @@ class DashboardController extends Libs_Controller
public function indexAction()
{
$object = new Object_Dashboard();
$object = new Object_Dashboard();
$this->view->comptages = $object->index();
$this->view->enrichissements = $object->enrichissements();
}
public function ciblagesAction()
@ -33,24 +33,27 @@ class DashboardController extends Libs_Controller
$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();
$criteresM = new Application_Model_Criteres();
$sql = $criteresM->select()
->from($criteresM, array('id', 'reference', "DATE_FORMAT(dateAjout, '%d/%m/%Y') as date"))
->where("idClient = ?", $user->idClient)
@ -77,9 +80,8 @@ class DashboardController extends Libs_Controller
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
//Criteres => Comptages (last) => enrichissement_identifiants => enrichissement_commandes
$enrichissementsM = new Table_EnrichissementIdentifiants();
$enrichissementsM = new Application_Model_EnrichissementIdentifiants();
$sql = $enrichissementsM->select()
->setIntegrityCheck(false)
@ -87,27 +89,42 @@ class DashboardController extends Libs_Controller
array('i' => 'enrichissement_identifiants'),
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
)
->join(
array('c' => 'comptages'), 'i.idComptage = c.id',
->join(
array('c' => 'comptages'), 'i.idComptage = c.id',
array('')
)
->join(
->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->assign('encours', $encours);
$sql->where('i.dateStop != ?', 0)
->where('criteres.idClient = ?', $user->idClient)
->where('criteres.login = ?', $user->username);
$fini = $enrichissementsM->fetchAll($sql);
$this->view->assign('fini', $fini);
$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;
}
/**
@ -115,8 +132,8 @@ class DashboardController extends Libs_Controller
*/
public function enrichissementAction()
{
}
}
}

View File

@ -1,6 +1,5 @@
<?php
class EconomiqueController extends Libs_Controller
class EconomiqueController extends Zend_Controller_Action
{
public function init()
{
@ -10,7 +9,6 @@ class EconomiqueController extends Libs_Controller
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;
}
@ -29,8 +27,8 @@ class EconomiqueController extends Libs_Controller
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest();
$table = new Table_Nafs();
$table = new Application_Model_Naf();
$sql = $table->select()
->where('lib LIKE "%'.$this->getRequest()->getParam('q').'%"');
$result = $table->fetchAll($sql);

View File

@ -6,47 +6,47 @@ class EnrichissementController extends Zend_Controller_Action
$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'));
$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');
$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
*/
@ -54,8 +54,8 @@ class EnrichissementController extends Zend_Controller_Action
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$request = $this->getRequest();
$key = $request->getParam('key', '');
if ( !empty($key) ) {
//$rep sera égal à false si la clef n'existe pas dans le cache apc
@ -63,51 +63,51 @@ class EnrichissementController extends Zend_Controller_Action
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);
$idCriteres = $request->getParam('id', 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
if ( $idProfil===null ){
//Selection du profil du client
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$profilsM = new Table_EnrichissementProfils();
$profilsM = new Application_Model_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;
}
$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
$criteresM = new Table_Criteres();
$criteresM = new Application_Model_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);
$values = $field->getValues($structure);
//Récupération des SIRET
require_once 'Scores/Ciblage.php';
$ciblage = new Ciblage($values, true);
@ -124,72 +124,129 @@ class EnrichissementController extends Zend_Controller_Action
'idProfil' => $idProfil,
'fichier' => '',
'nbLigneTotales' => count($infosExtraction),
'nbLigneTraites' => count($infosExtraction),
'nbLigneTraites' => 0,
'uniteInsee' => $ciblage->calculRedevanceInsee(),
'error' => '',
'dateAdded' => date('YmdHis'),
'dateAdded' => date('YmdHms'),
);
$identifiantsM = new Table_EnrichissementIdentifiants();
$identifiantsM = new Application_Model_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();
$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();
$profilsM = new Application_Model_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);
$profil = $profilsM->fetchRow($sql);
//
if ($profil!==null)
{
$this->view->assign('profil', true);
$idCritere = $request->getParam('id', null);
$comptagesM = new Table_Comptages();
$idCritere = $request->getParam('id', null);
$comptagesM = new Application_Model_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];
//@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('uniteInsee', $item['uniteInsee']);
//Calcul du prix
$redevanceInsee = 3.295/100; //Seuil de facturation 52 734 euros
$prixInsee = $item['uniteInsee']*$redevanceInsee;
$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.";
$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->assign('prix', $prix);
$this->view->assign('prixInsee', $prixInsee);
$this->view->assign('infoInsee', $infoInsee);
$this->view->assign('id', $item['id']);
}
$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 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
class EntrepriseController extends Libs_Controller
class EntrepriseController extends Zend_Controller_Action
{
public function init()
{
@ -10,7 +9,6 @@ class EntrepriseController extends Libs_Controller
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;
}

View File

@ -1,33 +1,32 @@
<?php
class ErreurController extends Libs_Controller
class ErreurController extends Zend_Controller_Action
{
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)
foreach($session->erreurs as $erreur => $valeurs)
{
if(in_array($erreur, $this->correlation[$key]))
if(in_array($erreur, $this->correlation[$key]))
{
if($session->erreurs[$key]['valeur'] != 'tous')
$session->erreurs[$key]['erreur'] = true;
@ -35,7 +34,7 @@ class ErreurController extends Libs_Controller
unset($session->erreurs[$key]);
}
}
}

View File

@ -1,6 +1,5 @@
<?php
class FinancierController extends Libs_Controller
class FinancierController extends Zend_Controller_Action
{
public function init()
@ -11,7 +10,6 @@ class FinancierController extends Libs_Controller
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();

View File

@ -1,6 +1,5 @@
<?php
class GeographiqueController extends Libs_Controller
class GeographiqueController extends Zend_Controller_Action
{
public function init()
@ -11,7 +10,6 @@ class GeographiqueController extends Libs_Controller
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();
@ -32,23 +30,26 @@ class GeographiqueController extends Libs_Controller
$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()
$table = new Application_Model_Departements();
$sql = $table->select()
->where('libdep LIKE "'.$q.'%"');
$result = $table->fetchAll($sql);
foreach ($result as $item) {
@ -59,12 +60,12 @@ class GeographiqueController extends Libs_Controller
}
return ($output);
}
protected function completedVil($q)
{
$table = new Table_Codepostauxs();
$table = new Application_Model_CodePostaux();
$separator = ' ';
$sql = $table->select()->where('Commune LIKE "'.$q.'%"');
$result = $table->fetchAll($sql);
foreach ($result as $item) {
@ -75,19 +76,33 @@ class GeographiqueController extends Libs_Controller
}
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)
{
$table = new Table_Regions();
$table = new Application_Model_Regions();
$separator = ' ';
$sql = $table->select()
->where('NCCENR LIKE "%'.$q.'%"');
->where('NCCENR LIKE "%'.$q.'%" OR REGION LIKE "%'.$q.'%"');
$result = $table->fetchAll($sql);
foreach ($result as $item) {
$output[] = array(
'label' => $item->NCCENR . $separator . $item->REGION,
'value' => $item->REGION
'label' => $item->REGION .' '.$item->NCCENR . $separator . $item->REGION,
'value' => $this->getDeptFromReg($item->REGION)
);
}
return ($output);

View File

@ -5,30 +5,31 @@ class GestionController extends Zend_Controller_Action
{
}
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 profilsAction()
{
$profilsM = new Table_EnrichissementProfils();
$profilsM = new Application_Model_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();
@ -36,7 +37,7 @@ class GestionController extends Zend_Controller_Action
//Sauvegarde du formulaire
if ( $request->isPost() && $request->getParam('submit')=='Enregistrer' ){
$params = $request->getParams();
//Vérifier le formulaire
$errForm = 0;
foreach ( $params as $key => $value ) {
@ -56,8 +57,8 @@ class GestionController extends Zend_Controller_Action
$dateInsee = 1;
break;
}
}
}
$data = array(
'idClient' => $params['idClient'],
'login' => $params['login'],
@ -68,25 +69,59 @@ class GestionController extends Zend_Controller_Action
'dateAjout' => date('Y-m-d H:i:s'),
'actif' => 1,
);
$profilM = new Table_EnrichissementProfils();
$profilM = new Application_Model_EnrichissementProfils();
if ( $profilM->insert($data) ){
$this->view->assign('message', "Profil enregistré");
$this->view->assign('message', "Profil enregistré");
} else {
$this->view->assign('message', "Erreur lors de la sauvegarde");
}
$this->view->assign('message', "Erreur lors de la sauvegarde");
}
} else {
$this->view->assign('message', "Erreur lors de la saisie");
}
$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);
$allFields = $fieldsM->getFields();
$this->view->assign('fields', $allFields);
}
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
Class IndexController extends Libs_Controller
Class IndexController extends Zend_Controller_Action
{
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 */
->appendFile('/themes/default/scripts/fields.js', 'text/javascript');
}
public function indexAction()
@ -25,20 +23,23 @@ Class IndexController extends Libs_Controller
$ajax = $this->getRequest()->getParam('ajax');
if($ajax)
$this->_helper->layout()->disableLayout();
require_once 'Scores/SessionCiblage.php';
require_once 'Scores/Field.php';
$session = new SessionCiblage();
require_once 'Scores/Field.php';
$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('/');
}
}

View File

@ -1,6 +1,5 @@
<?php
class JuridiqueController extends Libs_Controller
class JuridiqueController extends Zend_Controller_Action
{
public function init()
@ -11,7 +10,6 @@ class JuridiqueController extends Libs_Controller
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;
}
@ -27,11 +25,11 @@ class JuridiqueController extends Libs_Controller
public function completedAction()
{
$table = new Table_Formejuridiques();
$table = new Application_Model_FormJuridique();
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest();
$sql = $table->select()
->where('fjLibelle LIKE "'.$request->getParam('q').'%"');
$result = $table->fetchAll($sql);

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,7 +1,7 @@
<?php
class Table_Formejuridique extends Libs_Table
class Application_Model_FormJuridique extends Zend_Db_Table_Abstract
{
protected $_name = 'formejuridique';
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';
break;
case 'vil':
case 'adr_com':
$label = 'Localisation Villes';
break;
case 'dep':
@ -96,22 +97,38 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
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)
{
$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 '.(($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 class="intervalSelect" name="'.$name.'2" id="'.$name.'" number="2">';
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 .= ' <span id="'.$name.'"><a href="" class="intervalSelect" id="'.$name.'">Valider</a></span>';
return ($return);
@ -121,13 +138,17 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
private function selectMultipleHTML($name, $field)
{
$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);
@ -194,9 +215,20 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
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>';
@ -208,8 +240,10 @@ 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);
}

View File

@ -3,7 +3,7 @@
$("#<?=$this->key?>").jstree({
"themes" : {
"theme" : "default",
"url" : "/style.css",
"url" : "/themes/jstree/classic/style.css",
"dots" : true,
"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">
<a href="/dashboard/index">Tableau de bord</a> > Detail du ciblage
<h2></h2>
<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($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 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;?>
<?php endforeach;?>
</fieldset>
<fieldset>
@ -56,7 +63,13 @@
<th><?=$item['dateAdded']?></th>
<th><?=$item['reference']?></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>
<?php endforeach;?>
</tbody>

View File

@ -19,7 +19,7 @@ Enrichissement à partir d'un ciblage
</tr>
</thead>
<tbody>
<?php foreach($this->encours as $item):?>
<?php $i=0; foreach($this->encours as $item):?>
<tr>
<td><?=$item['reference']?></td>
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td>
@ -58,7 +58,7 @@ Enrichissement à partir d'un ciblage
<td><?=$item['reference']?></td>
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></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>
<?php endforeach;?>
</tbody>

View File

@ -64,14 +64,15 @@
</tr>
</thead>
<tbody>
<?php foreach($this->enrichissements as $item):?>
<?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' ) {?>
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' ) {?>
En cours de traitement
<?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>
<h2>Gestion des commandes</h2>
<a href="">Commande</a><br/>
<a href="">Lister les commandes</a>
<a href="<?php echo $this->url(array('controller' => 'gestion', 'action' => 'comptages'));?>">Liste des comptages</a><br />
<a href="<?php echo $this->url(array('controller' => 'gestion', 'action' => 'enrichissements'));?>">Liste des enrichissements</a>
<h2>Facturation</h2>
</div>

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