remise à jours des fichiers

This commit is contained in:
Damien LASSERRE 2012-02-15 09:25:21 +00:00
parent 68126b1576
commit 8f72a9e539
33 changed files with 491 additions and 346 deletions

View File

@ -6,8 +6,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
$this->bootstrap('view');
$view = $this->getResource('view');
$pathStyle = '/styles';
$pathScript = '/scripts';
$pathStyle = '/themes/default/styles';
$pathScript = '/themes/default/scripts';
$view->setEncoding('UTF-8');
$view->doctype('XHTML1_STRICT');
@ -19,8 +19,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view->headLink()
->appendStylesheet($pathStyle.'/reset.css', 'all')
->appendStylesheet($pathStyle.'/jquery.qtip.css', 'all')
->appendStylesheet($pathScript.'/jstree/default/style.css')
->appendStylesheet($pathScript.'/jqueryui/jquery-ui.css', 'all')
->appendStylesheet('/themes/jstree/default/style.css')
->appendStylesheet('/themes/jqueryui/jquery-ui.css', 'all')
->appendStylesheet($pathStyle.'/main.css', 'all');
$view->headScript()
@ -29,6 +29,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
->appendFile($pathScript.'/jquery.cookie.js', 'text/javascript')
->appendFile($pathScript.'/jquery-ui.js', 'text/javascript')
->appendFile($pathScript.'/jquery.qtip.js', 'text/javascript')
->appendFile($pathScript.'/jquery.qtip.js', 'text/javascript')
->appendFile($pathScript.'/scripts.js', 'text/javascript')
->appendFile($pathScript.'/jquery.jstree.js', 'text/javascript')
->appendFile($pathScript.'/fields.js', 'text/javascript');
@ -47,9 +48,9 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
protected function _initDb()
{
$configuration = Zend_Registry::get('configuration');
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
try {
$db = Zend_Db::factory($configuration->databases->db);
$db = Zend_Db::factory($dbConfig->db);
Zend_Db_Table::setDefaultAdapter ($db);
} catch ( Exception $e ) {
exit ( $e->getMessage() );

View File

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

View File

@ -2,16 +2,7 @@
class ArborescenceController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
// action body
}
/* Nafs */
public function nafAction()
{
$this->_helper->layout()->disableLayout();
@ -40,130 +31,57 @@ class ArborescenceController extends Libs_Controller
);
}
/* Geographiques */
public function geographiqueAction()
{
$this->_helper->layout()->disableLayout();
$object = new Object_Codepostaux();
$key = $this->getRequest()->getParam('key');
$this->view->assign('key', $key);
$this->view->regions = $object->geographique();
$object = new Object_Codepostaux();
$key = $this->getRequest()->getParam('key');
$this->view->key = $key;
$this->view->regions = $object->_getRegions();
}
public function geographiqueajaxAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest();
$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);
$niveau = $request->getParam('niveau');
$object = new Object_Codepostaux();
if($niveau == 0) {
echo ($object->_getDepartements($id));
} else if ($niveau == 1) {
echo ($object->_getCommunes($id));
}
}
/* Forme Juridique */
public function juridiqueAction()
{
$this->_helper->layout()->disableLayout();
$object = new Object_Formejuridique();
$key = $this->getRequest()->getParam('key');
$this->view->key = $key;
$this->view->formejuridiques = $object->_getParents();
}
public function juridiqueajaxAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$object = new Object_Formejuridique();
$request = $this->getRequest();
$id = $request->getParam('id');
echo ($object->_getFils($id));
}
}

View File

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

View File

@ -5,7 +5,8 @@ class DashboardController extends Libs_Controller
public function init()
{
/* Initialize action controller here */
$this->view->headLink()->appendStylesheet('/themes/default/styles/pages/'.$this->getRequest()->getControllerName().'.css', 'all');
$this->view->headScript()->appendFile('/themes/default/scripts/pages/'.$this->getRequest()->getControllerName().'.js', 'text/javascript');
}
public function indexAction()
@ -32,10 +33,13 @@ class DashboardController extends Libs_Controller
public function ciblagedetailAction()
{
$object = new Object_Dashboard();
$request = $this->getRequest();
$this->view->assign('comptages', $object->ciblagedetail($request->getParam('id')));
$comptage = $object->ciblagedetail($request->getParam('id'));
$this->view->criteres = $comptage['criteres'];
$this->view->comptages = $comptage['comptages'];
}
public function rcomptageAction()

View File

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

View File

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

View File

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

View File

@ -1,12 +1,12 @@
<?php
class ErrorController extends Libs_Controller
class ErrorController extends Zend_Controller_Action
{
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_ROUTE:
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
@ -14,13 +14,14 @@ class ErrorController extends Libs_Controller
$this->getResponse()->setHttpResponseCode(404);
$this->view->message = 'Page not found';
break;
default:
// application error
$this->getResponse()->setHttpResponseCode(500);
$this->view->message = 'Application error';
break;
}
// Log exception, if logger available
if ($log = $this->getLog()) {
$log->crit($this->view->message, $errors->exception);
@ -33,7 +34,7 @@ class ErrorController extends Libs_Controller
$this->view->request = $errors->request;
}
public function getLog()
{
$bootstrap = $this->getInvokeArg('bootstrap');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -67,7 +67,6 @@ class Object_Comptage extends Libs_Row
$sessionValeur = $session->getCritere($key);
$session->setCritere($key, $valeur);
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();

View File

@ -61,20 +61,20 @@ Class Object_Dashboard
//Compter le nombre de page
$sql = $criteresM->select()
->from($criteresM, array('nb' => 'COUNT(*)'))
->where("idClient = ?", $user->idClient)
->where("login = ?", $user->username);
->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);
->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();
@ -107,25 +107,22 @@ Class Object_Dashboard
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());
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$table = new Table_Criteres();
$sql = $table->select()
->where('idClient = ?', $user->idClient)
->where('login = ?', $user->username)
->where('id = ?', $id);
$criteres = $table->fetchRow($sql)->toArray();
if ($criteres != null){
$comptagesM = new Table_Comptages();
$sql = $comptagesM->select()
$comptage = new Table_Comptages();
$sql = $comptage->select()
->where('idDefinition = ?', $id);
$comptages = $comptagesM->fetchAll($sql);
return ($comptages->toArray());
$comptages = $comptage->fetchAll($sql)->toArray();
}
return (array_merge(array('comptages' => $comptages), array('criteres' => $criteres)));
}
public function rcomptage($q)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,56 +1,11 @@
<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 class="dashboard">
<div id="menu">
<a href="">Tableau de bord</a> |
<a href="">Historique de vos ciblages</a> |
<a href="">Préférences de l'application</a> |
<a href="">Enrichissement fichier</a>
</div>
<div id="lastCiblage" style="">
<?php echo $this->partial('dashboard/partials/tableau_bord.phtml', array('comptages' => $this->comptages));?>
</div>
</div>

View File

@ -0,0 +1,37 @@
<fieldset>
<legend>Vos derniers ciblages</legend>
<div id="rechercheCiblage">
<h2>Rechercher dans vos ciblages</h2>
<input type="text" name="searchCiblage" class="searchCiblage" />
<input type="submit" value="Rechercher" class="submit"/>
</div>
<?php if(count($this->comptages) > 0):?>
<table>
<thead>
<tr>
<th>Référence</th>
<th>Nombre d'entité</th>
<th>Unité Insee</th>
<th colspan="4">actions sur vos comptages</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<?php foreach($this->comptages as $name => $item):?>
<tr class="tooltip" id="<?php echo $item['id'];?>">
<td class="reference"><?=$item['reference']?></td>
<td class="resultat"><?=number_format($item['resultat'], 0, ',', ' ')?></td>
<td class="insee"><?=number_format($item['uniteInsee'], 0, ',', ' ')?></td>
<td><a class="chargement" href="/dashboard/ciblagedetail/id/<?php echo $item['id'];?>">Detail</a></td>
<td><a href="<?//=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$item['id']))?>">Recharger les critères de ciblage</a></td>
<td><a href="<?//=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Actualiser le comptage</a></td>
<td><a href="<?//=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Enrichissement</a></td>
<td id="ch_<?php echo $item['id'];?>" class="date"><?=$item['dateComptage']?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php else:?>
<p>Aucun ciblage.<p>
<?php endif;?>
</fieldset>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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