Redesign
This commit is contained in:
commit
a11b00afd5
@ -55,4 +55,19 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
Zend_Registry::set('db', $db);
|
||||
}
|
||||
|
||||
|
||||
protected function _initCache()
|
||||
{
|
||||
//MetadataCache pour la base de données
|
||||
$frontendOptions = array(
|
||||
'lifetime' => 14400,
|
||||
'automatic_serialization' => true
|
||||
);
|
||||
$backendOptions = array();
|
||||
$cache = Zend_Cache::factory('Core','Apc', $frontendOptions, $backendOptions);
|
||||
Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
|
||||
|
||||
//Cache pour les données de la base à stocker
|
||||
}
|
||||
|
||||
}
|
@ -157,11 +157,15 @@ class DashboardController extends Zend_Controller_Action
|
||||
|
||||
//Construction affichage des critères
|
||||
foreach ( $decodeCriteres as $key => $item ) {
|
||||
|
||||
$inValue = $fields->getValueLabel($key, $item['in']);
|
||||
$exValue = $fields->getValueLabel($key, $item['ex']);
|
||||
|
||||
//Add label to struct for display
|
||||
$infosCriteres[] = array(
|
||||
'label' => $fields->getLabel($key),
|
||||
'in' => $item['in'],
|
||||
'ex' => $item['ex'],
|
||||
'in' => $inValue,
|
||||
'ex' => $exValue,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,6 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
);
|
||||
$identifiantsM = new Application_Model_EnrichissementIdentifiants();
|
||||
$idIdentifiant = $identifiantsM->insert($data);
|
||||
//exec('php '.APPLICATION_PATH.'/../batch/enrichissement.php --id '.$idIdentifiant);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -169,9 +168,7 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
->order('dateAjout DESC')
|
||||
->limit(1);
|
||||
$comptages = $comptagesM->fetchAll($sql);
|
||||
$old = $comptages;
|
||||
$oldResultat = $old[0]->resultat;
|
||||
$oldResultatInsee = $old[0]->uniteInsee;
|
||||
|
||||
if ( $comptages->count()>0 ) {
|
||||
$item = $comptages[0];
|
||||
$date = explode(' ', $item->dateAjout);
|
||||
@ -208,12 +205,6 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
$this->view->infoInsee = $infoInsee;
|
||||
$this->view->id = $item['id'];
|
||||
|
||||
/*$this->view->oldDate = $date;
|
||||
$this->view->oldResult = $oldResultat;
|
||||
$this->view->oldResultInsee = $oldResultatInsee;
|
||||
$this->view->oldPrice = round(($oldResultat* $profil->tarifLigne)+ $oldResultatInsee);
|
||||
$this->view->oldPriceInsee = round($oldResultatInsee*$redevanceInsee, 2);*/
|
||||
|
||||
$this->view->criteres = $criteres;
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
Class ExtractController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
require_once 'Scores/Ciblage.php';
|
||||
require_once 'Scores/Field.php';
|
||||
|
||||
$field = new Fields();
|
||||
$ciblage = new Ciblage($field->getValues());
|
||||
|
||||
$ciblage->extract();
|
||||
}
|
||||
|
||||
public function batchAction()
|
||||
{
|
||||
$action = $this->getRequest();
|
||||
$request = $action->getParam('reference');
|
||||
}
|
||||
}
|
@ -12,6 +12,9 @@ class GestionController extends Zend_Controller_Action
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display all links
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
|
||||
@ -47,8 +50,9 @@ class GestionController extends Zend_Controller_Action
|
||||
$this->view->assign('profils', $profils);
|
||||
}
|
||||
|
||||
public function profilAction(){}
|
||||
|
||||
/**
|
||||
* Define fields for extraction to user
|
||||
*/
|
||||
public function profiladdAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
@ -116,7 +120,97 @@ class GestionController extends Zend_Controller_Action
|
||||
|
||||
}
|
||||
|
||||
public function comptagesAction()
|
||||
/**
|
||||
* List commands which must be done
|
||||
*/
|
||||
public function commandesAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
|
||||
$commandesM = new Application_Model_EnrichissementIdentifiants();
|
||||
$sql = $commandesM->select()->setIntegrityCheck(false)
|
||||
->from('enrichissement_identifiants AS e', array(
|
||||
'e.id',
|
||||
'e.reference AS commandeReference',
|
||||
'e.nbLigneTotales',
|
||||
'e.uniteInsee',
|
||||
"DATE_FORMAT(e.dateAdded, '%Y/%m/%d %H:%i:%s') AS dateAdded"
|
||||
))
|
||||
->join('criteres', 'idCriteres = criteres.id', array(
|
||||
'criteres.reference AS critereReference',
|
||||
'criteres.login',
|
||||
))
|
||||
->where('e.dateStart = ?', "0000-00-00 00:00:00")
|
||||
->where('fichier = ""')
|
||||
->order('e.dateAdded DESC');
|
||||
|
||||
$this->view->commandes = $commandesM->fetchAll($sql)->toArray();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* List commands with a file
|
||||
*/
|
||||
public function enrichissementsAction()
|
||||
{
|
||||
$commandesM = new Application_Model_EnrichissementIdentifiants();
|
||||
$sql = $commandesM->select()->setIntegrityCheck(false)
|
||||
->from('enrichissement_identifiants AS e', array(
|
||||
'e.id',
|
||||
'e.reference AS commandeReference',
|
||||
'e.nbLigneTotales',
|
||||
'e.uniteInsee',
|
||||
"DATE_FORMAT(e.dateAdded, '%Y/%m/%d %H:%i:%s') AS dateAdded"
|
||||
))
|
||||
->join('criteres', 'idCriteres = criteres.id', array(
|
||||
'criteres.reference AS critereReference',
|
||||
'criteres.login',
|
||||
))
|
||||
->where('fichier != ""')
|
||||
->order('e.dateAdded DESC');
|
||||
|
||||
$this->view->commandes = $commandesM->fetchAll($sql)->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load enrichissement batch to complete data
|
||||
*/
|
||||
public function enrichitAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$id = $request->getParam('id');
|
||||
exec('php '.APPLICATION_PATH.'/../batch/enrichissement.php --id '.$id.' &');
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract sirets from database
|
||||
* @todo : To csv file
|
||||
*/
|
||||
public function siretscsvAction()
|
||||
{
|
||||
$id = $this->getRequest()->getParam('id');
|
||||
$table = new Application_Model_EnrichissementIdentifiants();
|
||||
$sql = $table->select()
|
||||
->where('idComptage = ?', $id);
|
||||
$result = $table->fetchRow($sql);
|
||||
if(!empty($result)) {
|
||||
$result = $result->toArray();
|
||||
$sirets = json_decode($result['identifiants'], true);
|
||||
foreach($sirets as $siret) {
|
||||
echo $siret."\n";
|
||||
}
|
||||
}else {
|
||||
echo 'Aucune commande d\'enrichissement sur ce comptage';
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* List criteres and the last count
|
||||
*/
|
||||
public function ciblagesAction()
|
||||
{
|
||||
$comptagesM = new Application_Model_Comptages();
|
||||
|
||||
@ -137,30 +231,4 @@ class GestionController extends Zend_Controller_Action
|
||||
$this->view->comptages = $comptages;
|
||||
}
|
||||
|
||||
public function enrichissementsAction()
|
||||
{
|
||||
$table = new Application_Model_EnrichissementIdentifiants();
|
||||
$sql = $table->select()
|
||||
->order('dateAdded DESC');
|
||||
$this->view->enrichissements = $table->fetchAll($sql)->toArray();
|
||||
}
|
||||
|
||||
public function extractAction()
|
||||
{
|
||||
$id = $this->getRequest()->getParam('id');
|
||||
$table = new Application_Model_EnrichissementIdentifiants();
|
||||
$sql = $table->select()
|
||||
->where('idComptage = ?', $id);
|
||||
$result = $table->fetchRow($sql);
|
||||
if(!empty($result)) {
|
||||
$result = $result->toArray();
|
||||
$sirets = json_decode($result['identifiants'], true);
|
||||
foreach($sirets as $siret) {
|
||||
echo $siret."\n";
|
||||
}
|
||||
}else {
|
||||
echo 'Aucune commande d\'enrichissement sur ce comptage';
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
@ -24,12 +24,56 @@ class IndexController extends Zend_Controller_Action
|
||||
if($ajax)
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$session = new Scores_Fields();
|
||||
$fields = new Scores_Fields();
|
||||
|
||||
$this->view->field = $session;
|
||||
$this->view->criteres = $session->getCriteres();
|
||||
$infosCriteres = array();
|
||||
|
||||
$decodeCriteres = $fields->getCriteres();
|
||||
|
||||
//Construction affichage des critères
|
||||
foreach ( $decodeCriteres as $key => $item ) {
|
||||
|
||||
$inValue = $fields->getValueLabel($key, $item['in']);
|
||||
$exValue = $fields->getValueLabel($key, $item['ex']);
|
||||
|
||||
$infosCriteres[$key] = array(
|
||||
'label' => $fields->getLabel($key),
|
||||
'in' => $inValue,
|
||||
'ex' => $exValue,
|
||||
);
|
||||
}
|
||||
|
||||
$this->view->infos = $infosCriteres;
|
||||
}
|
||||
|
||||
public function criterelistAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$critere = $request->getParam('key');
|
||||
|
||||
$fields = new Scores_Fields();
|
||||
$values = $fields->getCritere($critere);
|
||||
|
||||
//Inclusion
|
||||
if (count($values['in'])>0) {
|
||||
$inLabels = $fields->getValueLabel($critere, $values['in']);
|
||||
$inValues = array_values($values['in']);
|
||||
$this->view->assign('inLabels', $inLabels);
|
||||
$this->view->assign('inValues', $inValues);
|
||||
}
|
||||
|
||||
//Exclusion
|
||||
if (count($values['ex'])>0) {
|
||||
$exLabels = $fields->getValueLabel($critere, $values['ex']);
|
||||
$exValues = array_values($values['ex']);
|
||||
$this->view->assign('exLabels', $exLabels);
|
||||
$this->view->assign('exValues', $exValues);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function removeAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
@ -12,9 +12,35 @@
|
||||
|
||||
<fieldset>
|
||||
<legend>Critères</legend>
|
||||
<pre>
|
||||
<?php print_r($this->criteres)?>
|
||||
</pre>
|
||||
|
||||
<?php foreach ( $this->criteres as $criteres ) { ?>
|
||||
<div>
|
||||
<h3><?=$criteres['label']?></h3>
|
||||
<?php if (is_string($criteres['in'])) {?>
|
||||
<div><?=$criteres['in']?></div>
|
||||
<?php } else {?>
|
||||
|
||||
<?php if ( is_array($criteres['in']) && count($criteres['in'])>0 ) { ?>
|
||||
<div>
|
||||
<p>Inclu :</p>
|
||||
<?php foreach( $criteres['in'] as $item ) {?>
|
||||
<p><?=$item?></p>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php if ( is_array($criteres['ex']) && count($criteres['ex'])>0 ) { ?>
|
||||
<div>
|
||||
<p>Exclu :</p>
|
||||
<?php foreach( $criteres['ex'] as $item ) {?>
|
||||
<p><?=$item?></p>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<div id="dashboard">
|
||||
<h2>Liste des comptages</h2>
|
||||
<h2>Liste des ciblages</h2>
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
@ -19,9 +19,6 @@
|
||||
<td><?=$comptage['uniteInsee']?></td>
|
||||
<td>
|
||||
<a href="">Actualiser</a>
|
||||
<a class="enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement','action'=>'reference', 'id'=>$comptage['idDefinition']))?>">Enrichissement</a>
|
||||
<a href="<?=$this->url(array('controller'=> 'gestion','action'=>'extract', 'id'=>$comptage['idDefinition']))?>">Extraire les sirets</a>
|
||||
<a href="">Supprimer</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
30
application/views/default/scripts/gestion/commandes.phtml
Normal file
30
application/views/default/scripts/gestion/commandes.phtml
Normal file
@ -0,0 +1,30 @@
|
||||
<div id="dashboard">
|
||||
<h2>Liste des commandes</h2>
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<th><b>Date de création</b></th>
|
||||
<th><b>Référence</b></th>
|
||||
<th><b>Résultat</b></th>
|
||||
<th><b>Insee</b></th>
|
||||
<th><b>login</b></th>
|
||||
<th><b>Reférence ciblage</b></th>
|
||||
<th><b>Actions</b></th>
|
||||
</tr>
|
||||
<?php foreach($this->commandes as $item): ?>
|
||||
<tr>
|
||||
<td><?=$item['dateAdded']?></td>
|
||||
<td><?=$item['commandeReference']?></td>
|
||||
<td><?=$item['nbLigneTotales']?></td>
|
||||
<td><?=$item['uniteInsee']?></td>
|
||||
<td><?=$item['login']?></td>
|
||||
<td><?=$item['critereReference']?></td>
|
||||
<td>
|
||||
<a class="enrichissementref" href="<?=$this->url(array('controller'=> 'gestion','action'=>'enrichit', 'id'=>$item['id']))?>">Enrichissement</a>
|
||||
<a href="<?=$this->url(array('controller'=> 'gestion','action'=>'extract', 'id'=>$item['id']))?>">Extraire les sirets</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
@ -1,30 +1,30 @@
|
||||
<div id="dashboard">
|
||||
<h2>Liste des comptages</h2>
|
||||
<h2>Liste des commandes</h2>
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<th><b>Id comptage</b></th>
|
||||
<th><b>Reference</b></th>
|
||||
<th><b>NB Ligne Totales</b></th>
|
||||
<th><b>NB Ligne Traites</b></th>
|
||||
<th><b>Unitee INSEE</b></th>
|
||||
<th><b>Date création</b></th>
|
||||
<th><b>Date début</b></th>
|
||||
<th><b>Date d'arret</b></th>
|
||||
<th><b>Date de création</b></th>
|
||||
<th><b>Référence</b></th>
|
||||
<th><b>Résultat</b></th>
|
||||
<th><b>Insee</b></th>
|
||||
<th><b>login</b></th>
|
||||
<th><b>Reférence ciblage</b></th>
|
||||
<th><b>Fichier</b></th>
|
||||
<th><b>Actions</b></th>
|
||||
</tr>
|
||||
<?php foreach($this->enrichissements as $enrichissement): ?>
|
||||
<?php foreach($this->commandes as $item): ?>
|
||||
<tr>
|
||||
<td><?php echo $enrichissement['idComptage']; ?></td>
|
||||
<td><?php echo $enrichissement['reference']; ?></td>
|
||||
<td><?php echo $enrichissement['nbLigneTotales']; ?></td>
|
||||
<td><?php echo $enrichissement['nbLigneTraites']; ?></td>
|
||||
<td><?php echo $enrichissement['uniteInsee']; ?></td>
|
||||
<td><?php echo $enrichissement['dateAdded']; ?></td>
|
||||
<td><?php echo $enrichissement['dateStart']; ?></td>
|
||||
<td><?php echo $enrichissement['dateStop']; ?></td>
|
||||
<td><a href="/enrichissement/download/id/<?php echo $enrichissement['id'];?>"><?php echo $enrichissement['fichier']; ?></a></td>
|
||||
</tr>
|
||||
<td><?=$item['dateAdded']?></td>
|
||||
<td><?=$item['commandeReference']?></td>
|
||||
<td><?=$item['nbLigneTotales']?></td>
|
||||
<td><?=$item['uniteInsee']?></td>
|
||||
<td><?=$item['login']?></td>
|
||||
<td><?=$item['critereReference']?></td>
|
||||
<td>
|
||||
<a class="enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement','action'=>'reference', 'id'=>$comptage['idDefinition']))?>">Enrichissement</a>
|
||||
<a href="<?=$this->url(array('controller'=> 'gestion','action'=>'extract', 'id'=>$comptage['idDefinition']))?>">Extraire les sirets</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -5,8 +5,10 @@
|
||||
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'profiladd'))?>">Créer un profil d'enrichissement pour un client (idClient, login)</a>
|
||||
|
||||
<h2>Gestion des commandes</h2>
|
||||
<a href="<?php echo $this->url(array('controller' => 'gestion', 'action' => 'comptages'));?>">Liste des comptages</a><br />
|
||||
<a href="<?php echo $this->url(array('controller' => 'gestion', 'action' => 'enrichissements'));?>">Liste des enrichissements</a>
|
||||
<a href="<?=$this->url(array('controller' => 'gestion', 'action' => 'commandes'));?>">Liste des commandes</a><br />
|
||||
<a href="<?=$this->url(array('controller' => 'gestion', 'action' => 'enrichissements'));?>">Liste des commandes terminées</a><br/>
|
||||
<a href="<?=$this->url(array('controller' => 'gestion', 'action' => 'ciblages'));?>">Liste des ciblages</a><br />
|
||||
|
||||
<h2>Facturation</h2>
|
||||
|
||||
</div>
|
@ -1 +0,0 @@
|
||||
<?php
|
@ -1 +0,0 @@
|
||||
<?php
|
15
application/views/default/scripts/index/criterelist.phtml
Normal file
15
application/views/default/scripts/index/criterelist.phtml
Normal file
@ -0,0 +1,15 @@
|
||||
<?php if (count($this->inValues)>0) {?>
|
||||
<ul>
|
||||
<?php foreach ($this->inValues as $i => $item) {?>
|
||||
<li><?=$this->inLabels[$i]?></li>
|
||||
<?php }?>
|
||||
</ul>
|
||||
<?php }?>
|
||||
|
||||
<?php if (count($this->exValues)>0) {?>
|
||||
<ul>
|
||||
<?php foreach ($this->exValues as $i => $item) {?>
|
||||
<li><?=$this->exLabels[$i]?></li>
|
||||
<?php }?>
|
||||
</ul>
|
||||
<?php }?>
|
@ -5,6 +5,7 @@
|
||||
#criteres {
|
||||
border: 1px solid;
|
||||
padding:10px 0;
|
||||
margin: 0 1px;
|
||||
}
|
||||
|
||||
#criteres tr td {
|
||||
@ -17,49 +18,30 @@
|
||||
|
||||
<div id="criteres">
|
||||
|
||||
<?php $color = 0;foreach($this->criteres as $critere => $valeur):?>
|
||||
<?php $label = $this->field->get($critere); ?>
|
||||
<?php if($valeur != 'tous' and $valeur != null and $valeur != 'null' and $valeur != ',' and !empty($valeur)):?>
|
||||
<?php if(!is_array($valeur)) {$valeur = explode(',', $valeur);} ?>
|
||||
<?php if ( count($this->infos)>0 ) {?>
|
||||
<?php $color = 0;?>
|
||||
<?php foreach($this->infos as $critere => $item) {?>
|
||||
|
||||
<div style="width:100%;" class="clearfix<?php echo ((($color%2) == 0) ? ' color' : ''); $color++; ?>">
|
||||
|
||||
<div style="float:left; margin:2px 0;">
|
||||
<?=$label['label'];?>
|
||||
|
||||
<?php if(is_array($valeur)):?>
|
||||
<?php $i=0; foreach ($valeur as $val):?>
|
||||
<?php if($i>5)break; ?>
|
||||
<?php if($label['type'] != 'textarea' and $label['type'] != 'interval' and $label['type'] != 'intervalSelect') :?>
|
||||
<?php echo $label['fields'][$label['type']]['value'][$val];?> <?php (($i%3 == 0)?'<br />':''); $i++;?>
|
||||
<?php else :?>
|
||||
<?php
|
||||
if($label['type'] == 'interval') {
|
||||
if(empty($val)) {
|
||||
echo '-';
|
||||
} else
|
||||
echo $val;
|
||||
} else
|
||||
echo $val.', ';
|
||||
?>
|
||||
<?php $i++; endif;?>
|
||||
<?php endforeach;?>
|
||||
<?php else: ?>
|
||||
<?php echo $val;?>
|
||||
<?php endif; ?>
|
||||
<?=$item['label']?>
|
||||
<?php if ( is_string($item['in']) && !empty($item['in']) ) { ?>
|
||||
<br/> <?=$item['in']?>
|
||||
<?php } elseif ( is_array($item['in']) || is_array($item['ex']) ) {?>
|
||||
<br/> <a class="criterelist" href="<?=$this->url(array('controller'=>'index', 'action'=>'criterelist', 'key'=>$critere), null, true)?>">Liste</a>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
<div style="height:16px; width:16px; float:right;">
|
||||
<a class="remove" href="index/remove/critere/<?=$critere;?>">
|
||||
<a class="remove" href="<?=$this->url(array('controller'=>'index', 'action'=>'remove', 'critere'=>$critere), null, true)?>">
|
||||
<img src="/themes/default/images/cross.png" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
<div id="panel"><?=$this->action('criteres', 'index');?></div>
|
||||
<div id="panel"><?=$this->action('criteres', 'index')?></div>
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li div="_entreprise"><a href="#tabs-1">Critères Entreprise</a></li>
|
||||
<li div="_economique"><a href="#tabs-2">Situation économique</a></li>
|
||||
<li div="_geographique"><a href="#tabs-3">Secteur géographique</a></li>
|
||||
<li div="_juridique"><a href="#tabs-4">Situation juridique</a></li>
|
||||
<li div="_financiere"><a href="#tabs-5">Situation financière</a></li>
|
||||
<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"><?=$this->action('index', 'entreprise')?></div>
|
||||
<div id="tabs-2"><?=$this->action('index', 'economique')?></div>
|
||||
|
@ -45,7 +45,7 @@ if(isset($opts->help) || !isset($opts->id) && !isset($opts->file) )
|
||||
exit;
|
||||
}
|
||||
|
||||
//Définition bdd
|
||||
//Définition bdd
|
||||
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
|
||||
try {
|
||||
$db = Zend_Db::factory($dbConfig->db);
|
||||
@ -74,7 +74,8 @@ if ($opts->id)
|
||||
->where('id = ?', $commande['idProfil']);
|
||||
$profil = $db->fetchRow($sql);
|
||||
$dataProfil = json_decode($profil['criteres'], true);
|
||||
} else if ($opts->file)
|
||||
}
|
||||
else if ($opts->file)
|
||||
{
|
||||
|
||||
}
|
||||
@ -90,7 +91,7 @@ if ( count($identifiants)>0 && count($dataProfil)>0 )
|
||||
require_once 'Scores/Enrichissement.php';
|
||||
$dico = new Enrichissement();
|
||||
$fields = $dico->getFields();
|
||||
|
||||
|
||||
//Entete, Valeur de remplacement et Requete SQL
|
||||
$tabEntete = array('siren', 'nic');
|
||||
$tabEnteteLabel = array('SIREN', 'NIC');
|
||||
@ -99,14 +100,14 @@ if ( count($identifiants)>0 && count($dataProfil)>0 )
|
||||
//Définition de l'entete
|
||||
$tabEnteteLabel[] = $fields[$item]['label'];
|
||||
$tabEntete[] = $item;
|
||||
|
||||
|
||||
//Construction de la requete SQL
|
||||
if ( array_key_exists('sql', $fields[$item]) ) {
|
||||
$sql.= ' '.$fields[$item]['sql'].', ';
|
||||
$sql.= ' '.$fields[$item]['sql'].', ';
|
||||
} else {
|
||||
$sql.= ' '.$fields[$item]['column'].' AS '.$item.',';
|
||||
$sql.= ' '.$fields[$item]['column'].' AS '.$item.',';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//Ajouter le champ presentRcs
|
||||
$tabEntete[] = 'presentRcs';
|
||||
@ -124,8 +125,8 @@ if ( count($identifiants)>0 && count($dataProfil)>0 )
|
||||
$traite = 0;
|
||||
//Date de debut de traitement.
|
||||
$dateStart = date('YmdHms');
|
||||
foreach ($identifiants as $siret )
|
||||
{
|
||||
foreach ($identifiants as $siret )
|
||||
{
|
||||
$sql = $model.' FROM etablissements_act WHERE siren='.substr($siret,0,9).' AND nic='.substr($siret,9,5);
|
||||
try {
|
||||
$result = $dbMetier->fetchAll($sql);
|
||||
@ -140,7 +141,7 @@ if ( count($identifiants)>0 && count($dataProfil)>0 )
|
||||
$tabSortie[] = isset($tabData[$key]) ? $tabData[$key] : '';
|
||||
}
|
||||
fputcsv($fp, $tabSortie, ',', '"');
|
||||
|
||||
|
||||
$row++;
|
||||
}
|
||||
//Gestion de l'erreur
|
||||
|
@ -17,6 +17,7 @@ jo.params.host=192.168.78.230
|
||||
jo.params.username=ciblage
|
||||
jo.params.password=z7jq8AhvrwqQJ4Yb
|
||||
jo.params.dbname=jo
|
||||
jo.params.persistent = true
|
||||
jo.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
|
||||
|
||||
[sphinx]
|
||||
|
@ -17,6 +17,7 @@ jo.params.host=192.168.78.230
|
||||
jo.params.username=ciblage
|
||||
jo.params.password=z7jq8AhvrwqQJ4Yb
|
||||
jo.params.dbname=jo
|
||||
jo.params.persistent = true
|
||||
jo.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
|
||||
|
||||
[sphinx]
|
||||
|
@ -737,7 +737,8 @@ class Scores_Fields
|
||||
switch ( $types[0] ) {
|
||||
case 'interval':
|
||||
//@todo : Check Min Max
|
||||
|
||||
//@todo : Check Number => A préciser dans Fields
|
||||
//@todo : Check Date => A préciser dans Fields
|
||||
break;
|
||||
case 'checkbox':
|
||||
if ( $value==0 ) {
|
||||
@ -745,6 +746,9 @@ class Scores_Fields
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 'tree':
|
||||
//Check values
|
||||
break;
|
||||
}
|
||||
|
||||
//Save the value
|
||||
@ -923,6 +927,61 @@ class Scores_Fields
|
||||
return $this->fields[$name]['label'];
|
||||
}
|
||||
|
||||
public function getValueLabelNaf($values)
|
||||
{
|
||||
$values = array_map(function($value){ return '"'.$value.'"'; }, $values);
|
||||
|
||||
$out = array();
|
||||
$nafM = new Application_Model_Naf();
|
||||
$sql = $nafM->select()->from($nafM, array('lib'))->where('code IN ('.join(',',$values).')');
|
||||
$result = $nafM->fetchAll($sql)->toArray();
|
||||
foreach ( $result as $elem ) {
|
||||
$out[] = $elem['lib'];
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
public function getValueLabel($name, $values)
|
||||
{
|
||||
if (count($values)>0 && array_key_exists($name, $this->fields)) {
|
||||
$fieldsType = array_keys($this->fields[$name]['fields']);
|
||||
$firstType = $fieldsType[0];
|
||||
$fieldsValues = $this->fields[$name]['fields'][$firstType]['value'];
|
||||
switch($firstType) {
|
||||
case 'select':
|
||||
case 'selectMultiple':
|
||||
if (is_array($values)) {
|
||||
$out = array();
|
||||
foreach ( $values as $item ){
|
||||
if (array_key_exists($item, $fieldsValues)) {
|
||||
$out[] = $fieldsValues[$item];
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
} else {
|
||||
if (array_key_exists($values, $fieldsValues)) {
|
||||
return $fieldsValues[$values];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'interval':
|
||||
// de X à X [unités]
|
||||
|
||||
break;
|
||||
case 'tree':
|
||||
$action = ucfirst($this->fields[$name]['fields'][$firstType]['action']);
|
||||
|
||||
return $this->{'getValueLabel'.$action}($values);
|
||||
|
||||
//Recherche des valeurs
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getInfoCritere()
|
||||
{
|
||||
|
||||
|
@ -19,6 +19,31 @@ $(document).ready(function()
|
||||
}
|
||||
});
|
||||
|
||||
$("div#criteres a.criterelist").on('click', function(e){
|
||||
e.preventDefault();
|
||||
e.preventDefault();
|
||||
var title = $(this).attr('title');
|
||||
var href = $(this).attr('href');
|
||||
var dialogOpts = {
|
||||
bgiframe: true,
|
||||
title: title,
|
||||
width: 500,
|
||||
height: 300,
|
||||
modal: true,
|
||||
open: function(event, ui) {
|
||||
$(this).html('Chargement...');
|
||||
$(this).load(href);
|
||||
},
|
||||
buttons: {
|
||||
Fermer: function() { $(this).dialog('close'); }
|
||||
},
|
||||
close: function() { $('#dialogtree').remove(); }
|
||||
};
|
||||
$('<div id="dialogcritere"></div>').dialog(dialogOpts);
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$('#tabs').delegate('select.criteres', 'change', function(e){
|
||||
e.stopPropagation();
|
||||
if ( !$(this).attr('size') ){
|
||||
@ -193,6 +218,10 @@ $(document).ready(function()
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
function set(key, value, ex)
|
||||
|
@ -19,7 +19,7 @@ a img { border:none } /* Gets rid of IE's blue borders */
|
||||
body {
|
||||
background: url("/themes/default/images/bg-home-tile.jpg") repeat-x scroll 50% 0 #bebebe;
|
||||
color: #000000;
|
||||
font: 0.8em "Trebuchet MS",Verdana,Helvetica,Arial,sans-serif;
|
||||
font: 0.8em Verdana,Helvetica,Arial,sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user