Passage de la version 2 sur le lan

This commit is contained in:
Damien LASSERRE 2012-02-03 08:33:13 +00:00
commit d0b4043cd0
180 changed files with 12967 additions and 24 deletions

203
.zfproject.xml Normal file
View File

@ -0,0 +1,203 @@
<?xml version="1.0"?>
<projectProfile type="default" version="1.11.11">
<projectDirectory>
<projectProfileFile filesystemName=".zfproject.xml"/>
<applicationDirectory classNamePrefix="Application_">
<apisDirectory enabled="false"/>
<configsDirectory>
<applicationConfigFile type="ini"/>
</configsDirectory>
<controllersDirectory>
<controllerFile controllerName="Index">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="Error"/>
</controllersDirectory>
<formsDirectory enabled="false"/>
<layoutsDirectory enabled="false"/>
<modelsDirectory/>
<modulesDirectory>
<moduleDirectory moduleName="frontend">
<apisDirectory enabled="false"/>
<configsDirectory enabled="false"/>
<controllersDirectory>
<controllerFile controllerName="Index">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="Login">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="Entreprise">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="Economique">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="Financier">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="Geographique">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="Juridique">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="User">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="Comptage">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="Arborescence">
<actionMethod actionName="index"/>
<actionMethod actionName="naf"/>
<actionMethod actionName="nafajax"/>
</controllerFile>
<controllerFile controllerName="Dashboard">
<actionMethod actionName="index"/>
<actionMethod actionName="menu"/>
<actionMethod actionName="ciblages"/>
<actionMethod actionName="ciblagedetail"/>
<actionMethod actionName="rcomptage"/>
<actionMethod actionName="configuration"/>
<actionMethod actionName="exports"/>
</controllerFile>
</controllersDirectory>
<formsDirectory enabled="false"/>
<layoutsDirectory enabled="false"/>
<modelsDirectory/>
<viewsDirectory>
<viewScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Index">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Login">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Entreprise">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Economique">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Financier">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Geographique">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Juridique">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="User">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Comptage">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Arborescence">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Dashboard">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
</viewScriptsDirectory>
<viewHelpersDirectory/>
<viewFiltersDirectory/>
</viewsDirectory>
</moduleDirectory>
<moduleDirectory moduleName="backend">
<apisDirectory enabled="false"/>
<configsDirectory enabled="false"/>
<controllersDirectory>
<controllerFile controllerName="Index">
<actionMethod actionName="index"/>
</controllerFile>
</controllersDirectory>
<formsDirectory enabled="false"/>
<layoutsDirectory enabled="false"/>
<modelsDirectory/>
<viewsDirectory>
<viewScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Index">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
</viewScriptsDirectory>
<viewHelpersDirectory/>
<viewFiltersDirectory/>
</viewsDirectory>
</moduleDirectory>
</modulesDirectory>
<viewsDirectory>
<viewScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Index">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Error">
<viewScriptFile forActionName="error"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Arborescence">
<viewScriptFile forActionName="naf"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Arborescence">
<viewScriptFile forActionName="nafajax"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Dashboard">
<viewScriptFile forActionName="menu"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Dashboard">
<viewScriptFile forActionName="ciblages"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Dashboard">
<viewScriptFile forActionName="ciblagedetail"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Dashboard">
<viewScriptFile forActionName="rcomptage"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Dashboard">
<viewScriptFile forActionName="configuration"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Dashboard">
<viewScriptFile forActionName="exports"/>
</viewControllerScriptsDirectory>
</viewScriptsDirectory>
<viewHelpersDirectory/>
<viewFiltersDirectory enabled="false"/>
</viewsDirectory>
<bootstrapFile filesystemName="Bootstrap.php"/>
</applicationDirectory>
<dataDirectory enabled="false">
<cacheDirectory enabled="false"/>
<searchIndexesDirectory enabled="false"/>
<localesDirectory enabled="false"/>
<logsDirectory enabled="false"/>
<sessionsDirectory enabled="false"/>
<uploadsDirectory enabled="false"/>
</dataDirectory>
<docsDirectory>
<file filesystemName="README.txt"/>
</docsDirectory>
<libraryDirectory>
<zfStandardLibraryDirectory enabled="false"/>
</libraryDirectory>
<publicDirectory>
<publicStylesheetsDirectory enabled="false"/>
<publicScriptsDirectory enabled="false"/>
<publicImagesDirectory enabled="false"/>
<publicIndexFile filesystemName="index.php"/>
<htaccessFile filesystemName=".htaccess"/>
</publicDirectory>
<projectProvidersDirectory enabled="false"/>
<temporaryDirectory enabled="false"/>
<testsDirectory>
<testPHPUnitConfigFile filesystemName="phpunit.xml"/>
<testPHPUnitBootstrapFile filesystemName="bootstrap.php"/>
<testApplicationDirectory>
<testApplicationControllerDirectory>
<testApplicationControllerFile forControllerName="Index"/>
</testApplicationControllerDirectory>
</testApplicationDirectory>
<testLibraryDirectory/>
</testsDirectory>
</projectDirectory>
</projectProfile>

View File

@ -1,3 +1,4 @@
<<<<<<< .working
<?php <?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{ {
@ -62,4 +63,95 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
} }
Zend_Registry::set('db', $db); Zend_Registry::set('db', $db);
} }
}=======
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initViewSettings()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$pathStyle = '/styles';
$pathScript = '/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()
->appendStylesheet($pathStyle.'/reset.css', 'all')
->appendStylesheet($pathStyle.'/jquery.qtip.css', 'all')
->appendStylesheet($pathScript.'/jstree/default/style.css')
->appendStylesheet($pathScript.'/jqueryui/jquery-ui.css', 'all')
->appendStylesheet($pathStyle.'/main.css', 'all');
$view->headScript()
->appendFile($pathScript.'/jquery.js', 'text/javascript')
->appendFile($pathScript.'/jquery.bgiframe.js', 'text/javascript')
->appendFile($pathScript.'/jquery.cookie.js', 'text/javascript')
->appendFile($pathScript.'/jquery-ui.js', 'text/javascript')
->appendFile($pathScript.'/jquery.qtip.js', 'text/javascript')
->appendFile($pathScript.'/jquery.qtip.js', 'text/javascript')
->appendFile($pathScript.'/scripts.js', 'text/javascript')
->appendFile($pathScript.'/jquery.jstree.js', 'text/javascript')
->appendFile($pathScript.'/fields.js', 'text/javascript');
$view->headTitle('Odea');
}
protected function _initLogging()
{
//Logger de développement
$writer = new Zend_Log_Writer_Firebug();
if(APPLICATION_ENV=='production') $writer->setEnabled(false);
$logger = new Zend_Log($writer);
Zend_Registry::set('firebug', $logger);
}
protected function _initDb()
{
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
try {
$db = Zend_Db::factory($dbConfig->db);
Zend_Db_Table::setDefaultAdapter ($db);
} catch ( Exception $e ) {
exit ( $e->getMessage() );
}
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;
}
} }
>>>>>>> .merge-right.r288

View File

@ -1,30 +1,37 @@
[production] [production]
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" phpSettings.date.timezone = "Europe/Paris"
includePaths.library = LIBRARY_PATH
bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap" bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
autoloaderNamespaces[] = "Application_"
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
resources.frontController.plugins.Comptage = "Application_Controller_Plugin_Comptage"
resources.layout.layout = "main"
resources.layout.layoutPath = APPLICATION_PATH "/views/default"
resources.view.basePath = APPLICATION_PATH "/views/default"
[staging : production] ; so auto-loading will find our classes in library/App
resources.frontController.params.displayExceptions = 0 autoloaderNamespaces[] = "Structure_" ;Les structures de données
phpSettings.soap.wsdl_cache_enabled = 0 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"
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"
[development : production] [development : production]
phpSettings.display_startup_errors = 1 phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1 phpSettings.display_errors = 1
phpSettings.soap.wsdl_cache_enabled = 0
resources.frontController.params.displayExceptions = 1 resources.frontController.params.displayExceptions = 1
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

View File

View File

@ -0,0 +1 @@
<?php

View File

@ -0,0 +1,32 @@
<div id="primaryNavigation" class="clearfix">
<ul>
<li><a href="<?=$this->url(array('controller'=>'index', 'action'=>'index'), null, true)?>">Accueil</a></li>
<li><a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'index'), null, true)?>">Tableau de bord</a></li>
<li><a href="<?=$this->url(array('controller'=>'aide', 'action'=>'index'), null, true)?>">Aide</a></li>
<li><a href="<?=$this->url(array('controller'=>'aide', 'action'=>'aproposde'), null, true)?>">A propos de</a></li>
<li><a href="<?=$this->url(array('controller'=>'user', 'action'=>'logout'), null, true)?>">Déconnexion</a></li>
</ul>
</div>
<div id="logo">
<h1>Odea</h1>
</div>
<div id="message">
<?php if ($this->msgComptage){?>
<div id="comptage" >
<?php if (!empty($this->total)) {?>
Nombre sélectionnées :
<span class="valeur"><?=$this->total?></span>
(dont <span class="valeur"><?=$this->insee?></span> unité(s) insee)
<?php } else {?>
Aucune sélection.
<?php }?>
</div>
<div id="attente" style="display:none;">
<img src="/images/ajax.gif" />
</div>
<div id="control">
[<a href="<?=$this->url(array('controller'=>'comptage', 'action'=> 'reset'))?>">Initialiser les critères</a>],
[<a id="saveciblage" href="<?=$this->url(array('controller'=>'comptage', 'action'=>'savedialog'))?>">Sauvegarder le profil du ciblage</a>]
</div>
<?php }?>
</div>

View File

@ -0,0 +1,23 @@
<?php echo $this->doctype(); ?>
<html>
<head>
<?php echo $this->headMeta(); ?>
<?php echo $this->headTitle(); ?>
<?php echo $this->headStyle(); ?>
<?php echo $this->headLink(); ?>
<?php echo $this->headScript(); ?>
</head>
<body>
<div id="global">
<div id="header" class="clearfix">
<?php echo $this->render('header.phtml') ?>
</div>
<div id="content" class="clearfix">
<?php echo $this->layout()->content; ?>
</div>
<div id="footer">
<?php echo $this->render('footer.phtml'); ?>
</div>
</div>
</body>
</html>

View File

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

View File

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

View File

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

View File

@ -0,0 +1,52 @@
<?php
class ComptageController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$object = new Object_Comptage();
echo $object->count($request->getParam('cle'), $request->getParam('valeur'));
}
public function resetAction()
{
require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage();
$session->clearCiblage();
$this->_redirect('./');
}
public function savedialogAction()
{
$this->_helper->layout()->disableLayout();
//Récupération de la session pour le profil et les valeurs du comptage
require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage();
$criteres = $session->getCriteres();
$this->view->criteres = $criteres;
if (count($criteres) == 0) {
$this->view->noSelection = true;
}
}
public function saveAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$object = new Object_Comptage();
$object->saveComptage($request->getParam('ref', ''));
}
}

View File

@ -0,0 +1,76 @@
<?php
class DashboardController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$object = new Object_Dashboard();
$this->view->comptages = $object->index();
}
public function menuAction()
{
// action body
}
public function ciblagesAction()
{
$object = new Object_Dashboard();
$request = $this->getRequest();
$assigns = $object->ciblage($request->getParam('page', 1));
$this->view->ciblages = $assigns['ciblages'];
$this->view->nbCiblage = $assigns['nbCiblage'];
}
public function ciblagedetailAction()
{
$object = new Object_Dashboard();
$request = $this->getRequest();
$this->view->assign('comptages', $object->ciblagedetail($request->getParam('id')));
}
public function rcomptageAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$object = new Object_Dashboard();
echo $object->rcomptage(strtolower($this->getRequest()->getParam('q', '')));
}
public function configurationAction()
{
// action body
}
public function exportsAction()
{
// action body
}
}

View File

@ -0,0 +1,23 @@
<?php
class EconomiqueController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/styles/pages/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$field = new Fields($user->username);
$this->view->fields = $field;
}
}

View File

@ -0,0 +1,21 @@
<?php
class EntrepriseController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/styles/pages/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$field = new Fields($user->username);
$this->view->fields = $field;
}
}

View File

@ -0,0 +1,47 @@
<?php
class ErrorController extends Libs_Controller
{
public function errorAction()
{
$errors = $this->_getParam('error_handler');
switch ($errors->type) {
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
// 404 error -- controller or action not found
$this->getResponse()->setHttpResponseCode(404);
$this->view->message = 'Page not found';
break;
default:
// application error
$this->getResponse()->setHttpResponseCode(500);
$this->view->message = 'Application error';
break;
}
// Log exception, if logger available
if ($log = $this->getLog()) {
$log->crit($this->view->message, $errors->exception);
}
// conditionally display exceptions
if ($this->getInvokeArg('displayExceptions') == true) {
$this->view->exception = $errors->exception;
}
$this->view->request = $errors->request;
}
public function getLog()
{
$bootstrap = $this->getInvokeArg('bootstrap');
if (!$bootstrap->hasPluginResource('Log')) {
return false;
}
$log = $bootstrap->getResource('Log');
return $log;
}
}

View File

@ -0,0 +1,23 @@
<?php
class FinancierController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/styles/pages/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$field = new Fields($user->username);
$this->view->fields = $field;
}
}

View File

@ -0,0 +1,23 @@
<?php
class GeographiqueController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/styles/pages/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$field = new Fields($user->username);
$this->view->fields = $field;
}
}

View File

@ -0,0 +1,22 @@
<?php
Class IndexController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
if ($user->customisation) {
$this->view->assign('preferences', $user->customisation);
}
}
}

View File

@ -0,0 +1,23 @@
<?php
class JuridiqueController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/styles/pages/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$field = new Fields($user->username);
$this->view->fields = $field;
}
}

View File

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

View File

@ -0,0 +1,91 @@
<?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!='/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

@ -0,0 +1,28 @@
<?php
class Form_Login extends Zend_Form {
public function init()
{
$this->setName('login');
$this->setAction('/user/login');
$this->setMethod('post');
$this->addElement('text', 'login', array(
'filters' => array('StringTrim'),
'label' => 'Identifiant : ',
'required' => 'true',
)
);
$this->addElement('password', 'pass',
array(
'label' => 'Mot de passe : ',
'required' => 'true',
)
);
$this->addElement('submit', 'submit',
array(
'label' => 'Identification',
'ignore' => true,
));
}
}

View File

@ -0,0 +1,65 @@
<?php
class Object_Codepostaux extends Libs_Row
{
public function geographique()
{
require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage();
$val = $session->getCritere('adr_cp');
$valuesCheckeds = explode(',', $val);
if(count($valuesCheckeds) > 0) {
for($i=0;count($valuesCheckeds) > $i;$i++) {
$valuesCheckeds[$i] = substr($valuesCheckeds[$i], 1);
}
}
$valuesUndetermined = array();
if($val != null)
{
$values = explode(',', $val);
foreach($values as $valuesChecked) {
if(strlen($valuesChecked) == 5) {
$dept = substr($valuesChecked, 0, 2);
$table = new Table_Departements();
$sql = $table->select()->from('departements', array('codeRegionInsee'))->where('numdep = ?',$dept);
$results = $table->fetchAll($sql)->toArray();
foreach($results as $result) {
$valuesUndetermined[] = $result['codeRegionInsee'];
}
}
if(substr($valuesChecked, 0, 1) == 'R') {
$valuesCheckeds[] = substr($valuesChecked, 1);
} else if (substr($valuesChecked, 0, 1) == 'D') {
$table = new Table_Departements();
$sql = $table->select()->from('departements', array('codeRegionInsee'))->where('numdep = ?', substr($valuesChecked, 1));
$result = $table->fetchAll($sql)->toArray();
foreach($result as $item) {
$valuesUndetermined[] = $item['codeRegionInsee'];
}
}
}
}
$regionsM = new Table_Regions();
$sql = $regionsM->select()->from('regions');
$regions = $regionsM->fetchAll()->toArray();
$structure = array();
foreach($regions as $region) {
$structure = array(
'data' => $region['NCCENR'],
'attr' => array('id' => 'R'.$region['REGION'], 'niveau' => 0),
'state' => 'closed',
'children' => array()
);
if(in_array($region['REGION'], $valuesCheckeds)) {
$structure['attr']['class'] = 'jstree-checked';
}
if(in_array($region['REGION'], $valuesUndetermined)) {
$structure['attr']['class'] = 'jstree-undetermined';
}
$tabAdrDep[] = $structure;
}
return (json_encode($tabAdrDep));
}
}

View File

@ -0,0 +1,93 @@
<?php
class Object_Comptage extends Libs_Row
{
public function saveComptage($ref)
{
if (empty($ref)) {
echo json_encode(array(
'error'=>1,
'msg'=> "Référence non définie !"));
} else {
//Session
require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage();
$criteres = $session->getCriteres();
$resultat = $session->getNb('total');
$nbInsee = $session->getNb('insee');
//Informations utilisateur
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$db = Zend_Registry::get('db');
//Enregistrement des critères
$criteresM = new Table_Criteres();
$data = array(
'idClient' => $user->idClient,
'login' => $user->username,
'reference' => $ref,
'criteres' => json_encode($criteres),
'parent' => 0,
'dateAjout' => date('Y-m-d H:i:s'),
);
$id = $criteresM->insert($data);
if ($id){
//Enregistrement des valeurs du comptage
$comptageM = new Table_Comptages();
$data = array(
'idDefinition' => $id,
'resultat' => $resultat,
'uniteInsee' => $nbInsee,
'tarif' => '',
'dateAjout' => date('Y-m-d H:i:s'),
);
if ($comptageM->insert($data)) {
echo json_encode(array(
'error'=>0,
'msg'=> "Vos critères ont été sauvegardés sous la référence $ref"));
} else {
echo json_encode(array(
'error'=>1,
'msg'=> "Erreur lors de l'enregistrement"));
}
} else {
echo json_encode(array(
'error'=>1,
'msg'=> "Erreur lors de l'enregistrement"));
}
}
}
public function count($key, $valeur)
{
require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage();
$sessionValeur = $session->getCritere($key);
$session->setCritere($key, $valeur);
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
require_once 'Scores/Field.php';
$field = new Fields($user->username);
//Comptage
require_once 'Scores/Ciblage.php';
$ciblage = new Ciblage($field->getValues());
$total = $ciblage->execute();
$insee = $ciblage->calculRedevanceInsee();
$session->setNb('total', $total);
$session->setNb('insee', $insee);
//Retour comptage, unité Insee
$result = array(
'count' => number_format($total, 0, '', ' '),
'insee' => number_format($insee, 0, '', ' ')
);
return (json_encode($result));
}
}

View File

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

View File

@ -0,0 +1,155 @@
<?php
Class Object_Dashboard
{
public function index()
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$criteresM = new Table_Criteres();
$sql = $criteresM->select(true)
->columns(array('id', 'reference', 'dateAjout'))
->where("idClient = ?", $user->idClient)
->where("login = ?", $user->username)
->order('dateAjout DESC')
->limit(5);
$rows = $criteresM->fetchAll($sql);
$results = array();
$comptagesM = new Table_Comptages();
foreach($rows->toArray() as $item)
{
$info = array(
'id' => $item['id'],
'reference' => $item['reference'],
'dateCriteres' => $item['dateAjout'],
);
//Recherche des comptages
$sql = $comptagesM->select(true)
->columns(array('resultat', 'uniteInsee', 'dateAjout'))
->where('idDefinition = ?', $item['id'])
->order('dateAjout DESC')->limit(1);
$comptage = $comptagesM->fetchAll($sql)->toArray();
if (count($comptage)>0){
$info['resultat'] = $comptage[0]['resultat'];
$info['uniteInsee'] = $comptage[0]['uniteInsee'];
$info['dateComptage'] = $comptage[0]['dateAjout'];
}
$results[] = $info;
}
return ($results);
}
public function menu()
{
}
public function ciblage($page)
{
$offset = 20;
//Liste des ciblages par paquet de n
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$db = Zend_Registry::get('db');
$criteresM = new Table_Criteres($db);
//Compter le nombre de page
$sql = $criteresM->select()
->from($criteresM, array('nb' => 'COUNT(*)'))
->where("idClient = ?", $user->idClient)
->where("login = ?", $user->username);
$count = $criteresM->fetchRow($sql);
$nbCiblage = $count->nb;
//Récupérer les informations
$position = ($page-1)*$offset+1;
$sql = $criteresM->select()
->from($criteresM, array('id', 'reference', 'dateAjout'))
->where("idClient = ?", $user->idClient)
->where("login = ?", $user->username)
->order('dateAjout DESC')
->limitPage($position, $offset);
$rows = $criteresM->fetchAll($sql);
$results = array();
$comptagesM = new Table_Comptages($db);
foreach($rows->toArray() as $item)
{
$info = array(
'id' => $item['id'],
'reference' => $item['reference'],
'dateCriteres' => $item['dateAjout'],
);
//Recherche des comptages
$sql = $comptagesM->select(true)
->columns(array('resultat', 'uniteInsee', 'dateAjout'))
->where('idDefinition = ?', $item['id'])
->order('dateAjout DESC')->limit(1);
$comptage = $comptagesM->fetchAll($sql)->toArray();
if (count($comptage)>0){
$info['resultat'] = $comptage[0]['resultat'];
$info['uniteInsee'] = $comptage[0]['uniteInsee'];
$info['dateComptage'] = $comptage[0]['dateAjout'];
}
$results[] = $info;
}
return (array('ciblages' => $results, 'nbCiblage' => $nbCiblage));
}
public function ciblagedetail($id)
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$criteresM = new Table_Criteres();
$sql = $criteresM->select()
->where("idClient = ?", $user->idClient)
->where("login = ?", $user->username)
->where("id = ?", $id);
$criteres = $criteresM->fetchRow($sql);
$this->view->assign('criteres', $criteres->toArray());
if ($criteres != null){
$comptagesM = new Table_Comptages();
$sql = $comptagesM->select()
->where('idDefinition = ?', $id);
$comptages = $comptagesM->fetchAll($sql);
return ($comptages->toArray());
}
}
public function rcomptage($q)
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$criteresM = new Table_Criteres($db);
$sql = $criteresM->select()
->from($criteresM, array('id', 'reference', "DATE_FORMAT(dateAjout, '%d/%m/%Y') as date"))
->where("idClient = ?", $user->idClient)
->where("login = ?", $user->username)
->where("reference LIKE ?", $q.'%');
$rows = $criteresM->fetchAll($sql);
if (count($rows)>0){
$separator = " , ";
foreach ($rows as $item) {
$output[] = array(
'label' => $item->reference . $separator . $item->date,
'value' => $item->reference,
'url' => $this->view->url(array('controller'=>'dashboard', 'action'=>'ciblagedetail', 'id'=>$item->id)),
);
}
}
return (json_encode($output));
}
}

View File

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

View File

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

View File

@ -0,0 +1,107 @@
<?php
class Object_Naf extends Libs_Row
{
public function naf($niveau, $key)
{
require_once 'Scores/SessionCiblage.php';
$sessionCiblage = new SessionCiblage();
$val = $sessionCiblage->getCritere($key);
$valuesChecked = array();
$valuesUndetermined = array();
if ($val != null){
$valuesChecked = explode(',',$val);
foreach($valuesChecked as $value){
$valuesUndetermined = array_merge($valuesUndetermined, $this->getNafParent($value, true));
}
}
$nafM = new Table_Nafs();
$sql = $nafM->select()->where('niveau = ?', $niveau)->order('code ASC');
$result = $nafM->fetchAll($sql)->toArray();
$tabNaf = array();
foreach($result as $item)
{
$structure = array(
'data' => $item['code'].' - '.$item['lib'],
'attr' => array('id' => $item['code'], 'niveau' => $item['niveau']),
'state' => 'closed',
'children' => array(),
);
if (in_array($item['code'], $valuesChecked)){
$structure['attr']['class'] = 'jstree-checked';
}
if (in_array($item['code'], $valuesUndetermined)){
$structure['attr']['class'] = 'jstree-undetermined';
}
$tabNaf[] = $structure;
}
return (json_encode($tabNaf));
}
protected function getNafParent($value, $niveau1 = false)
{
$out = array();
if (strlen($value)>2) {
$niveau = strlen($value)-1;
$new = substr($value,0,$niveau);
$out = array_merge($out, array($new), $this->getNafParent($new, $niveau1));
} elseif (strlen($value)==2 && $niveau1 === true) {
$nafM = new Application_Model_Naf();
$sql = $nafM->select()
->from($nafM, array('parent'))
->where('code = ?', $value);
$result = $nafM->fetchRow($sql);
$out[] = $result->parent;
}
return $out;
}
public function ajax($parent, $niveau, $key)
{
//Récupération des valeurs enregistrées en session
require_once 'Scores/SessionCiblage.php';
$sessionCiblage = new SessionCiblage();
$val = $sessionCiblage->getCritere($key);
$valuesChecked = array();
$valuesUndetermined = array();
if ($val != null){
$valuesChecked = explode(',',$val);
foreach($valuesChecked as $value){
$valuesUndetermined = array_merge($valuesUndetermined, $this->getNafParent($value));
}
}
$niveau++;
$nafM = new Table_Nafs();
$sql = $nafM->select();
if (!empty($parent) && $niveau==2) {
$sql->where('parent = ?', $parent);
} elseif (!empty($parent) && $niveau>2) {
$sql->where("code LIKE '".$parent."%'");
}
$sql->where('niveau = ?', $niveau)->order('code ASC');
$result = $nafM->fetchAll($sql)->toArray();
$tabNaf = array();
foreach($result as $item){
$structure = array(
'data' => $item['code'].' - '.$item['lib'],
'attr' => array('id' => $item['code'], 'niveau' => $item['niveau']),
);
if (in_array($item['code'], $valuesChecked)){
$structure['attr']['class'] = 'jstree-checked';
}
if (in_array($item['code'], $valuesUndetermined)){
$structure['attr']['class'] = 'jstree-undetermined';
}
if ($niveau<5){
$structure['state'] = 'closed';
$structure['children'] = array();
}
$tabNaf[] = $structure;
}
echo 'cool';exit;
return (json_encode($tabNaf));
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,202 @@
<?php
Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
{
public function Field($name, $field)
{
$html = '';
if($field != null) {
$html.= '<div class="fieldgrp">';
$type = $field['type'];
switch($type)
{
case 'select':
$html.= $this->structureHTML(
$field['label'],
$this->selectHTML($name, $field));
break;
case 'selectMultiple':
$html.= $this->structureHTML(
$field['label'],
$this->selectMultipleHTML($name, $field));
break;
case 'intervalSelect':
$html.= $this->structureHTML(
$field['label'],
$this->intervalSelectHTML($name, $field));
break;
case 'interval':
$html.= $this->structureHTML(
$field['label'],
$this->intervalHTML($name, $field));
break;
case 'date':
$html.= $this->structureHTML(
$field['label'],
$this->dateHTML($name, $field));
break;
case 'text':
$html.= $this->structureHTML(
$field['label'],
$this->textHTML($name, $field));
break;
case 'textarea':
$html.= $this->structureHTML(
$field['label'],
$this->textareaHTML($name, $field));
break;
case 'radio':
$html.= $this->structureHTML(
$field['label'],
$this->radioHTML($name, $field));
break;
}
$html.= '</div>';
}
return $html;
}
private function structureHTML($label, $html, $liens = array())
{
$out = '';
$out.= $this->structureLabel($label);
$out.= '<div class="field">'.$html.$this->structureLink($liens).'</div>';
return $out;
}
/**
* Définition du label
* @param unknown_type $label
*/
private function structureLabel($label)
{
return '<label>'.$label.'</label>';
}
/**
* Définition des liens
*/
private function structureLink($liens = array())
{
$html = '';
if (count($liens)>0) {
foreach($liens as $lien){
$html.= '<a href="'.$lien['url'].'">'.$lien['lib'].'</a>';
}
}
if (!empty($html)) {
return '<span>'.$html.'</span>';
}
return '';
}
private function intervalSelectHTML($name, $field)
{
$session = new SessionCiblage();
$return = '<select class="intervalSelect" name="'.$name.'1" id="'.$name.'" number="1">';
foreach($field['fields'][$field['type']]['value'] as $elements) {
$return .= '<option value="'. $elements[0].'">'.number_format($elements[0], 0,'', ' ').'</option>';
}
$return .= '</select> à ';
$return .= '<select class="intervalSelect" name="'.$name.'2" id="'.$name.'" number="2">';
foreach($field['fields'][$field['type']]['value'] as $elements) {
$return .= '<option value="'. $elements[1].'">'.number_format($elements[1], 0,'', ' ').'</option>';
}
$return .= '</select>';
$return .= ' <span id="'.$name.'"><a href="" class="intervalSelect" id="'.$name.'">Valider</a></span>';
return ($return);
}
/* Select */
private function selectMultipleHTML($name, $field)
{
$session = new SessionCiblage();
$return = '<select class="criteres" name="'.$name.'">';
$return .= '<option value="tous">Tous</option>';
foreach($field['fields'][$field['type']]['value'] as $value => $label) {
$selected = "";
if(($session->getCritere($name) != null) and $session->getCritere($name) == $value)
$selected = " selected";
$return .= '<option'.((!empty($selected))?$selected:null).' value="'.$value.'">'.$label.'</option>';
}
$return .= '</select>';
return ($return);
}
/* Select Multiple */
private function selectHTML($name, $field)
{
$session = new SessionCiblage();
$sessionValeur = $session->getCritere($name);
if(is_array($sessionValeur))
$sessionValeur = implode(',', $sessionValeur);
$return = '<select class="criteres '.$field['type']['class'].'" name="'.$name.'">';
$return .= '<option value="tous">Tous</option>';
foreach($field['fields'][$field['type']]['value'] as $value => $label) {
$selected = "";
if(($sessionValeur != null) and $sessionValeur == $value)
$selected = " selected";
$return .= '<option'.((!empty($selected))?$selected:null).' value="'.$value.'">'.$label.'</option>';
}
$return .= '</select>';
return ($return);
}
/* Interval */
private function intervalHTML($name, $field)
{
$session = new SessionCiblage();
$valeur = $session->getCritere($name);
$return = '<div class="interval" >';
$return .= '<input class="'.$field['class'].'" type="text" name="'.$name.'1" value="'.$valeur[0].'" /> à ';
$return .= '<input class="'.$field['class'].'" type="text" name="'.$name.'2" value="'.$valeur[1].'" />';
$return .= ' <a href="" class="interval" id="'.$name.'">Valider</a>';
$return .= '</div>';
return ($return);
}
/* Dates */
private function dateHTML($name, $field)
{
$session = new SessionCiblage();
$return = '<div class="date" >';
$return .= '<input value="'.$session->getCritere($name).'" type="text" class="datepicker" name="'.$name.'1" /> a ';
$return .= '<input type="text" class="datepicker" name="'.$name.'2" />';
$return .= '</div>';
return ($return);
}
/* Textes */
private function textHTML($name, $field)
{
$session = new SessionCiblage();
$return = '<input style="border:1px inset silver;width:60%" class="criteres" type="text" name="'.$name.'" value="'.$session->getCritere($name).'" />';
return ($return);
}
/* Textarea */
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>';
return ($return);
}
/* Radios */
private function radioHTML($name, $field, $item)
{
$return = '<input type="radio" name="'.$name.'" />';
return ($return);
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,37 @@
<?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="/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;?>
<pre>
<?php print_r($this->criteres)?>
</pre>

View File

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

View File

@ -0,0 +1,47 @@
<div id="dashboard">
<div class="chemin">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
Liste de vos ciblages
</div>
<div style="margin:5px 0;">
<h2>Liste de vos ciblages</h2>
<?php if(count($this->ciblages)>0):?>
<table class="ciblage">
<thead>
<tr>
<th>Référence</th>
<th>Nombre d'entité</th>
<th>Unité Insee</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach($this->ciblages as $item):?>
<tr>
<td><?=$item['reference']?></td>
<td><?=number_format($item['resultat'], 0, ',', ' ')?></td>
<td><?=number_format($item['uniteInsee'], 0, ',', ' ')?></td>
<td><?=$item['dateComptage']?></td>
<td>
[<a href="<?=$this->url(array('controller'=> 'dashboard','action'=>'ciblagedetail', 'id'=>$item['id']))?>">Détails</a>] -
[<a href="<?=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$item['id']))?>">Recharger les critères de ciblage</a>] -
[<a href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Actualiser le comptage</a>] -
[<a href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Enrichissement</a>]
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php else:?>
<p>Aucun ciblage.<p>
<?php endif;?>
</div>
</div>

View File

@ -0,0 +1,47 @@
<div id="dashboard">
<div class="chemin">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
Préférences
</div>
<h2>Gestion des profils d'enrichissement</h2>
<p>
Afin de vous permettre un enrichissement de données à partir d'une liste de SIREN/SIRET,
Suivant la configuration de votre compte, vous avez la possibilité de sélectionner les données
disponible.
</p>
<br/>
<p>Cas profil défini pas S&D</p>
<p>- Aucun profil d'enrichissement (Contacter le support)</p>
<p>- Liste des profils avec référence, tarifs à la ligne</p>
<p>Si droits création profil d'enrichissement</p>
<p>- Aucun profil d'enrichissement (Sans profil d'enrichissement, vous ne pourrez pas extraire de données)</p>
<p>- Liste des profils avec référence, tarifs à la ligne</p>
<p> - Créer un profil d'enrichissement (avoir donc un tarifs à la colonne, pour créer le tarif à la ligne)</p>
<p>Lister les colonnes disponibles (Association SQL/Libellé) pour la configuration<p>
<h2>Gestion des préférences d'affichage</h2>
<p>
L'application permet la modification de l'affichage des critères de ciblage afin de permettre une
utilisation correspondant à vos besoins.
</p>
<br/>
<p>Vous n'avez pas les droits nécessaires pour créer/modifier les préférences d'affichage.</p>
<p>Des préférences d'affichage ont été définies pour votre profil client.</p>
<br/>
<p>Aucune préférences d'affichage définies pour votre profil utilisateur.</p>
<p>Des préférences d'affichage ont été définies pour votre profil utilisateur.</p>
<br/>
<p>
<a href="<?=$this->url(array('controller'=>'preferences', 'action'=>'active'))?>"
title="Activer le mode personnalisation afin de créer/modifier les préférences d'affichage">
Activer le mode personnalisation
</a>
</p>
</div>

View File

@ -0,0 +1,17 @@
<div id="dashboard">
<div class="chemin">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
Enrichissement fichier
</div>
<a href="<?=$this->url(array('controller'=>'enrichissement', 'action'=>'fileform'))?>">Envoyer votre fichier pour enrichissement</a>
<h2>Fichiers en cours d'enrichissement</h2>
<h2>Fichiers enrichis</h2>
</div>

View File

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

View File

@ -0,0 +1 @@
<?php

View File

@ -0,0 +1,20 @@
<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><?php echo $this->Field('ape_entrep', $this->fields->get('ape_entrep'));?></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 href="">Réinitialiser les critères entreprises</a>
</div>

View File

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

View File

@ -0,0 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zend Framework Default Application</title>
</head>
<body>
<h1>An error occurred</h1>
<h2><?php echo $this->message ?></h2>
<?php if (isset($this->exception)): ?>
<h3>Exception information:</h3>
<p>
<b>Message:</b> <?php echo $this->exception->getMessage() ?>
</p>
<h3>Stack trace:</h3>
<pre><?php echo $this->exception->getTraceAsString() ?>
</pre>
<h3>Request Parameters:</h3>
<pre><?php echo var_export($this->request->getParams(), true) ?>
</pre>
<?php endif ?>
</body>
</html>

View File

@ -0,0 +1,23 @@
<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>

View File

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

View File

@ -0,0 +1,27 @@
<div id="panel">
<?php //echo $this->action('index', 'comptage', 'frontend');?>
</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

@ -0,0 +1,12 @@
<div id="juridique">
<ul id="fieldsblock">
<li><?php echo $this->Field('cj', $this->fields->get('cj'));?></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 href="">Réinitialiser les critères entreprises</a>
</div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

30
docs/README.txt Normal file
View File

@ -0,0 +1,30 @@
README
======
This directory should be used to place project specfic documentation including
but not limited to project notes, generated API/phpdoc documentation, or
manual files generated or hand written. Ideally, this directory would remain
in your development environment only and should not be deployed with your
application to it's final production location.
Setting Up Your VHOST
=====================
The following is a sample VHOST you might want to consider for your project.
<VirtualHost *:80>
DocumentRoot "C:/workspace/sdciblage2/public"
ServerName .local
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "C:/workspace/sdciblage2/public">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

View File

@ -1,3 +1,4 @@
<<<<<<< .working
<?php <?php
class Application_Controller_Plugin_Comptage extends Zend_Controller_Plugin_Abstract class Application_Controller_Plugin_Comptage extends Zend_Controller_Plugin_Abstract
{ {
@ -44,4 +45,51 @@ class Application_Controller_Plugin_Comptage extends Zend_Controller_Plugin_Abst
} }
} }
} }
} }=======
<?php
class Application_Controller_Plugin_Comptage extends Zend_Controller_Plugin_Abstract
{
public function preDispatch($request)
{
$layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled()) {
$controller = $request->getControllerName();
$action = $request->getActionName();
if ($controller == 'index' && $action == 'index') {
require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage();
$view = $layout->getView();
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
// Chargement des critères de ciblage à partir de l'enregistrement en bdd
$id = $request->getParam('id', 0);
if (!empty($id)) {
$db = Zend_Registry::get('db');
$criteresM = new Table_Criteres();
$sql = $criteresM->select()
->from($criteresM, array('criteres'))
->where('login = ?', $user->username)
->where('id = ?', $id);
$row = $criteresM->fetchRow($sql);
if ($row != null) {
//On charge les critères
$session->setCriteres(json_decode($row->criteres, 'true'));
//Réalise le comptage
require_once 'Scores/Ciblage.php';
$ciblage = new Ciblage($session->getCriteres());
$total = $ciblage->execute();
$insee = $ciblage->calculRedevanceInsee();
$session->setNb('total', $total);
$session->setNb('insee', $insee);
}
}
$view->total = number_format($session->getNb('total'), 0, '', ' ');
$view->insee = number_format($session->getNb('insee'), 0, '', ' ');
$view->msgComptage = true;
}
}
}
}>>>>>>> .merge-right.r288

View File

@ -0,0 +1,33 @@
<?php
abstract class Libs_Controller extends Zend_Controller_Action
{
protected static $_loadedTables = array();
public function __get($prop)
{
$class = false;
if (substr($prop, 0, 5) == 'table') {
$class = 'Table_' . substr($prop, 5);
}else if (substr($prop, 0, 6) == 'object') {
$class = 'Object_' . substr($prop, 6);
}
if (!$class) {
trigger_error("Access to undefined property $prop", E_USER_WARNING);
return;
}
return self::loadTable($class);
}
public static function loadTable($class)
{
if (array_key_exists($class, self::$_loadedTables)) {
return self::$_loadedTables[$class];
}
if (!class_exists($class)) {
throw new Libs_Exception("Class $class not found");
}
self::$_loadedTables[$class] = new $class;
return self::$_loadedTables[$class];
}
}

View File

@ -0,0 +1,5 @@
<?php
Class Libs_Exception extends Zend_Exception
{
}

33
library/Libs/Row.php Normal file
View File

@ -0,0 +1,33 @@
<?php
abstract class Libs_Row extends Zend_Db_Table_Row_Abstract
{
public function __construct(array $input = array())
{
$class = explode('_', get_class($this));
$this->_tableClass = 'Table_' . array_pop($class) . 's'; // le 's' final
parent::__construct($input);
$cols = $this->_table->info(Zend_Db_Table_Abstract::COLS);
if (!isset($input['data'])) {
$input['data'] = array_combine($cols, array_pad(array(),count($cols),null));
}
$this->_data = $input['data'];
}
public function getForm($form = null)
{
$formObject = $this->getTable()->getForm($form);
if ($this->_data[$this->_primary[1]] != null && $form == null) {
$formObject->populate($this->_data);
}
return $formObject;
}
public function save()
{
$form = $this->getForm();
if (!$form->isValid($this->_data)) {
return false;
}
return parent::save();
}
}

48
library/Libs/Table.php Normal file
View File

@ -0,0 +1,48 @@
<?php
abstract class Libs_Table extends Zend_Db_Table_Abstract
{
protected static $_loadedForms = array();
const DEFAULT_FORM = 'Default';
public function __construct($config = array())
{
$class = explode('_', get_class($this));
$rowClass = 'Object_' . substr(array_pop($class), 0, -1);
if (!class_exists($rowClass)) {
throw new Libs_Exception("Class $rowClass not found");
}
$config = array_merge($config, array(self::ROW_CLASS => $rowClass));
parent::__construct($config);
}
public function getForm($form = null)
{
$form = ucfirst(strtolower($form));
if ($form == null) {
$form = self::DEFAULT_FORM;
}
$className = "Form_" . ucfirst($this->_name) . '_' . $form;
if (array_key_exists($className, self::$_loadedForms)) {
return self::$_loadedForms[$className];
}
if (class_exists($className, true)) {
self::$_loadedForms[$className] = new $className;
return self::$_loadedForms[$className];
} else {
throw new Libs_Exception("Class $className not found");
}
}
public function __call($meth, $args)
{
if (preg_match('|get(\w+)Form|', $meth, $matches)) {
return $this->getForm($matches[1]);
}
}
}
?>

View File

@ -1,3 +1,4 @@
<<<<<<< .working
<?php <?php
Class Fields Class Fields
{ {
@ -781,4 +782,788 @@ Class Fields
{ {
return ($this->fields[$name]['label']); return ($this->fields[$name]['label']);
} }
} }=======
<?php
Class Fields
{
protected $fields = array
(
'siege' => array(
'label' => 'Sociétés Sieges',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'select'
),
'sirenGrp' => array(
'label' => 'Société appartenant à un groupe',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'select'
),
'tel' => array(
'label' => 'Contenant un Telephone',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'select'
),
'fax' => array(
'label' => 'Contenant un Fax',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'select',
'class' => null
),
'web' => array(
'label' => 'Contenant un site internet',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'select',
'class' => null
),
'mail' => array(
'label' => 'Contenant une adresse email',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'select',
'class' => null
),
'presentRcs' => array(
'label' => 'Société présente au RNCS',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'select',
'class' => null
),
'adrDom' => array(
'label' => 'A une adresse de domiciliation',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'select',
'class' => null
),
'dirNom' => array(
'label' => 'Contenant le nom du principal dirigeant',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'select',
'class' => null
),
'lieuAct' => array(
'label' => 'Lieu d\'activté',
'fields' => array(
'interval' => array('value' => array('0', '1000')),
'textarea' => array('value' => null)
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'textarea',
'class' => null
),
'nbMPubli' => array(
'label' => 'Nombre de marches publiques remportes',
'fields' => array(
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'interval',
'class' => null
),
'dateCrea_ent' => array(
'label' => 'Date de création de l\'entreprise',
'fields' => array(
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'interval',
'class' => 'datepicker'
),
'dateCrea_etab' => array(
'label' => 'Date de création de l\'etablissement',
'fields' => array(
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'interval',
'class' => 'datepicker'
),
'nbActio' => array(
'label' => 'Nombre d\'actionnaires connus',
'fields' => array(
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'interval',
'class' => null
),
'nbPart' => array(
'label' => 'Nombre de participations connues',
'fields' => array(
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'entreprise',
'activated' => true,
'type' => 'interval',
'class' => null
),
// economique
'ape_etab' => array(
'label' => 'Codes NAF Etablissement',
'fields' => array(
'text' => array('value' => null),
'textarea' => array('value' => null)
),
'famille' => 'economique',
'activated' => true,
'type' => 'textarea',
'class' => null,
'action' => 'naf',
'title' => 'Selection des codes NAF etablissement'
),
'ape_entrep' => array(
'label' => 'Codes NAF Entreprise',
'fields' => array(
'text' => array('value' => null),
'textarea' => array('value' => null)
),
'famille' => 'economique',
'activated' => true,
'type' => 'textarea',
'class' => null,
'action' => 'naf',
'title' => 'Selection des codes NAF entreprise'
),
'NaceEtab' => array(
'label' => 'Code NACE de l\'établissement',
'fields' => array(
'text' => array('value' => null),
'textarea' => array('value' => null)
),
'famille' => 'economique',
'activated' => true,
'type' => 'textarea',
'class' => null
),
'NaceEntrep' => array(
'label' => 'Code NACE de l\'entreprise',
'fields' => array(
'text' => array('value' => null),
'textarea' => array('value' => null)
),
'famille' => 'economique',
'activated' => true,
'type' => 'textarea',
'class' => null
),
'age_etab' => array(
'label' => 'L\'age de l\'etablissement',
'fields' => array(
'interval' => array('value' => null)
),
'famille' => 'economique',
'activated' => true,
'type' => 'interval',
'class' => null
),
'age_entrep' => array(
'label' => 'L\'age de l\'entreprise',
'fields' => array(
'interval' => array('value' => null)
),
'famille' => 'economique',
'activated' => true,
'type' => 'interval',
'class' => null
),
'teff_entrep' => array(
'label' => 'Tranche d\'effectif de l\'Entreprise',
'fields' => array(
'intervalSelect' => array('value' => array(
array('0', '0'),
array('0', '1'),
array('1', '2'),
array('2', '3'),
array('3', '11'),
array('11', '12'),
array('12', '21'),
array('21', '22'),
array('22', '31'),
array('31', '32'),
array('32', '41'),
array('41', '42'),
array('42', '51'),
array('51', '52'),
array('52', '53')
))
),
'famille' => 'economique',
'activated' => true,
'type' => 'intervalSelect',
'class' => null,
),
'teff_etab' => array(
'label' => 'Tranche d\'effectif de l\'etablissement',
'fields' => array(
'intervalSelect' => array(
'value' => array(
array('0', '0'),
array('0', '1'),
array('1', '2'),
array('2', '3'),
array('3', '11'),
array('11', '12'),
array('12', '21'),
array('21', '22'),
array('22', '31'),
array('31', '32'),
array('32', '41'),
array('41', '42'),
array('42', '51'),
array('51', '52'),
array('52', '53')
)
)
),
'famille' => 'economique',
'activated' => true,
'type' => 'intervalSelect',
'class' => null
),
'nbEtab' => array(
'label' => 'Nombre d\'établassiment',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'economique',
'activated' => true,
'type' => 'interval',
'class' => null
),
'eff_entrep' => array(
'label' => 'Effectif réel de l\'entreprise',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'economique',
'activated' => true,
'type' => 'interval',
'class' => null
),
'eff_etab' => array(
'label' => 'Effectif réel de l\'établissement',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'economique',
'activated' => true,
'type' => 'interval',
'class' => null
),
'capital' => array(
'label' => 'Capital de l\'entreprise',
'fields' => array(
'intervalSelect' => array(
'value' => array(
array(0, 15000),
array(15000, 30000),
array(30000, 75000),
array(75000, 150000),
array(150000, 750000),
array(750000, 0),
)
)
),
'famille' => 'economique',
'activated' => true,
'type' => 'intervalSelect',
'class' => null
),
//geographique
'adr_cp' => array(
'label' => 'Codes postaux',
'fields' => array(
'text' => array('value' => null),
'textarea' => array('value' => null)
),
'famille' => 'geographique',
'activated' => true,
'type' => 'textarea',
'class' => null,
'action' => 'geographique',
'title' => 'Localisation'
),
'adr_com' => array(
'label' => 'Code commune Insee',
'fields' => array(
'text' => array('value' => null),
'textarea' => array('value' => null)
),
'famille' => 'geographique',
'activated' => true,
'type' => 'textarea',
'class' => null
),
//juridique
'cj' => array(
'label' => 'Forme Juridique',
'fields' => array(
'select' => array('value' => array('1' => '1', '2' => '2', '3' => '3')),
),
'famille' => 'juridique',
'activated' => true,
'type' => 'select',
'class' => null
),
'actifEco' => array(
'label' => 'Établissement économiquement actif',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
),
'famille' => 'juridique',
'activated' => true,
'type' => 'select',
'class' => null
),
'procolHisto' => array(
'label' => 'Procédure collective dans l\'historique.',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
),
'famille' => 'juridique',
'activated' => true,
'type' => 'select',
'class' => null
),
'tvaIntraValide' => array(
'label' => 'Numéro de TVA Valide',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
),
'famille' => 'juridique',
'activated' => true,
'type' => 'select',
'class' => null
),
'dateImmat' => array(
'label' => 'Date d\'immatriculation',
'fields' => array(
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'juridique',
'activated' => true,
'type' => 'interval',
'class' => 'datepicker'
),
//financier
'bilType' => array(
'label' => 'Type du dernier bilan',
'fields' => array(
'select' => array('value' => array('I' => 'Inconnue', 'E' => 'Estimé', 'R' => 'Réel')),
),
'famille' => 'financier',
'activated' => true,
'type' => 'select',
'class' => null
),
'avisCs' => array(
'label' => 'Informations de paiements',
'fields' => array(
'interval' => array('value' => null),
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilDuree' => array(
'label' => 'Durée du dernier bilan en mois',
'fields' => array(
'interval' => array('value'=> null),
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilTca' => array(
'label' => 'Tranche de CA issue du bilan',
'fields' => array(
'interval' => array('value' => null),
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilAnnee' => array(
'label' => 'Dernière année de bilan',
'fields' => array(
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilCloture' => array(
'label' => 'Dernière date de clôture du bilan',
'fields' => array(
'interval' => array('value' => array('0', '1000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => 'datepicker'
),
'bilEE' => array(
'label' => 'Total bilan',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilFL' => array(
'label' => 'CA total',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilFK' => array(
'label' => 'Chiffre d\'affaires Export',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilFR' => array(
'label' => 'Produits d\'Exploitation',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilGF' => array(
'label' => 'Charges d\'Exploitation',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilGP' => array(
'label' => 'Produits Financiers',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilGP' => array(
'label' => 'Charges Financières',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilGW' => array(
'label' => 'RCAI (résultat courant avant impôt)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilHD' => array(
'label' => 'Produits Exceptionnels',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilHH' => array(
'label' => 'Charges Exceptionnels',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilHL' => array(
'label' => 'Total des Produits',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilHM' => array(
'label' => 'Total des Charges',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilHN' => array(
'label' => 'Résultat',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
),
'bilYP' => array(
'label' => 'Effectif de l\'entreprise au dernier bilan (poste YP)',
'fields' => array(
'interval' => array('value' => array('0', '10000000'))
),
'famille' => 'financier',
'activated' => true,
'type' => 'interval',
'class' => null
)
);
protected $requeteSql = array('cj');
public function getValues()
{
require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage();
$values = array();
foreach($session->getCriteres() as $key => $item)
{
if($this->fields[$key]['type'] == 'interval' or
$this->fields[$key]['type'] == 'intervalSelect' or
$this->fields[$key]['type'] == 'textarea' and
empty($this->fields[$key]['action']))
{
$values[$key] = explode(',', $item);
} else if (!empty($this->fields[$key]['action'])) {
$values[$key] = $this->selectArbo($key, $item);
} else {
$values[$key] = $item;
}
}
return ($values);
}
public function selectArbo($name, $valeur)
{
$values = array();
switch($name)
{
case 'ape_etab' :
case 'ape_entrep' :
$nafs = explode(',', $valeur);
foreach($nafs as $naf)
$values = array_merge($values, $this->nafArbo($name, $naf));
break;
case 'adr_cp':
$valeurs = explode(',', $valeur);
foreach($valeurs as $element) {
$array = $this->deptArbo($name, $element);
if(!empty($array))
$values = array_merge($values, $array);
}
break;
}
return ($values);
}
protected function deptArbo($name, $valeur)
{
if(strlen($valeur) < 5){
if($valeur[0] == 'D') {
$codepostaux = new Table_Codepostauxs();
$sql = $codepostaux->select()->where('Codepos LIKE "'.substr($valeur, 1).'%"');
$codes = $codepostaux->fetchAll($sql)->toArray();
foreach($codes as $code) {
$values[] = $code['Codepos'];
}
} else if($valeur[0] == 'R') {
$departements = new Table_Departements();
$codepostaux = new Table_Codepostauxs();
$sql = $departements->select()->from('departements', array('numdep'))->where('codeRegionInsee = ?', substr($valeur, 1));
$results = $departements->fetchAll($sql)->toArray();
foreach($results as $result) {
$sql = $codepostaux->select()->from('codepostaux', array('Codepos'))->where('Codepos LIKE "'.$result['numdep'].'%"');
$codes = $codepostaux->fetchAll($sql)->toArray();
foreach($codes as $code) {
$values[] = $code['Codepos'];
}
}
}
return ($values);
}
return (array($valeur));
}
protected function nafArbo($key, $valeur)
{
$value = array();
$table = new Table_Nafs();
if(strlen($valeur) == 1)
{
$sql = $table->select()->where('parent = ?', $valeur);
$result =$table->fetchAll($sql)->toArray();
foreach($result as $code) $where .= " code LIKE '".$code['code']."%' and niveau = 5 or ";
$where = substr($where, 0, (strlen($where)) - 3);
$sql = $table->select()->where($where);
$result = $table->fetchAll($sql)->toArray();
foreach($result as $code) $value[] = $code['code'];
} else if(strlen($valeur) < 5){
$sql = $table->select()->where("code LIKE '".$valeur."%' and niveau = 5");
$result = $table->fetchAll($sql)->toArray();
foreach($result as $code) $value[] = $code['code'];
} else if(strlen($valeur) == 5) {
$value[] = $valeur;
}
return ($value);
}
public function __construct($login)
{
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$db = Zend_Registry::get('db');
/*$prefsModel = new Application_Model_Prefs($db);
$prefs = $prefsModel->find($login);
$json = $prefs->json;*/
foreach($this->fields as $name => $valeur) {
/*if(!empty($json))
{
$prefs = json_decode($json);
if(!empty($prefs)) {
if(array_key_exists($name, $prefs)) {
$this->fields[$name]['activated'] = false;
if(is_array($this->fields[$name]['type'])) {
$this->fields[$name]['type'] = $prefs[$name];
}
}
}
}*/
/*if(in_array($name, $this->requeteSql)) {
$formeJuridiques = new Application_Model_Formejuridique();
$sql = $formeJuridiques->select()->where('fjCode > 1000');
$formeJuridiques = $formeJuridiques->fetchAll($sql)->toArray();
$value = array();
foreach($formeJuridiques as $form) {
$value[$form['fjCode']] = $form['fjLibelle'].' ['.$form['fjCode'].']';
}
asort($value);
$this->fields[$name]['fields']['select']['value'] = $value;
}*/
}
}
public function getFields() {
return ($this->fields);
}
public function get($name) {
if($this->fields[$name]['activated'] == true)
return ($this->fields[$name]);
return (null);
}
public function getByFamille($famille)
{
$section = array();
foreach($this->fields as $name => $item) {
if($item['famille'] == $famille) {
$section[$name] = $item;
}
}
return ($section);
}
public function getNotActivated($fields)
{
foreach($fields as $name => $field)
{
if(!$field['activated']) {
$desactivated[$name] = "";
} else if ($field['activated']){
}
}
return (json_encode($desactivated));
}
public function getLibelle($name)
{
return ($this->fields[$name]['label']);
}
}>>>>>>> .merge-right.r288

View File

@ -1,3 +1,4 @@
<<<<<<< .working
<?php <?php
class WebAuthAdapter implements Zend_Auth_Adapter_Interface class WebAuthAdapter implements Zend_Auth_Adapter_Interface
{ {
@ -59,4 +60,66 @@ class WebAuthAdapter implements Zend_Auth_Adapter_Interface
} }
} }
} }=======
<?php
class WebAuthAdapter implements Zend_Auth_Adapter_Interface
{
protected $_username;
protected $_password;
protected $_timeout = 1800;
protected $_checkIp = false;
public function __construct($username, $password, $iponly = false)
{
$this->_username = $username;
$this->_password = $password;
if ($iponly){
$this->_password = 'iponly:'.$_SERVER['REMOTE_ADDR'];
}
$this->_checkIp = $iponly;
}
public function authenticate()
{
$adressIp = $_SERVER['REMOTE_ADDR'];
require_once 'Scores/WsScores.php';
$ws = new WsScores($this->_username, $this->_password);
$InfosLogin = $ws->getInfosLogin($this->_username, $adressIp);
$identity = new stdClass();
$identity->username = $this->_username;
$identity->password = $this->_password;
$identity->email = $InfosLogin->result->email;
$identity->profil = $InfosLogin->result->profil;
$identity->pref = $InfosLogin->result->pref;
$identity->droits = $InfosLogin->result->droits;
$identity->droitsClients = $InfosLogin->result->droitsClients;
$identity->nom = $InfosLogin->result->nom;
$identity->prenom = $InfosLogin->result->prenom;
$identity->tel = $InfosLogin->result->tel;
$identity->fax = $InfosLogin->result->fax;
$identity->mobile = $InfosLogin->result->mobile;
$identity->id = $InfosLogin->result->id;
$identity->idClient = $InfosLogin->result->idClient;
$identity->reference = $InfosLogin->result->reference;
$identity->nbReponses = $InfosLogin->result->nbReponses;
$identity->typeScore = $InfosLogin->result->typeScore;
$identity->timeout = (!empty($InfosLogin->result->timeout)) ?
$InfosLogin->result->timeout : $this->_timeout;
$identity->ip = $adressIp;
$identity->modeEdition = false;
if ( (is_string($InfosLogin) && !empty($InfosLogin)) || $InfosLogin->error->errnum!=0){
if (is_string($InfosLogin)){
$message = $InfosLogin;
} else {
$message = 'Erreur lors de la connexion';
}
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $identity, array($message));
} elseif ($this->_username == $InfosLogin->result->login) {
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $identity);
} else {
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity);
}
}
}>>>>>>> .merge-right.r288

7
public/.htaccess Normal file
View File

@ -0,0 +1,7 @@
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

BIN
public/images/ajax.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

BIN
public/images/ajouter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

BIN
public/images/bigajax.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
public/images/calendar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

BIN
public/images/cross.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

BIN
public/images/handle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
public/images/ligne.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

BIN
public/images/moins.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

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