This commit is contained in:
Michael RICOIS 2012-06-01 13:01:56 +00:00
commit 65447d43b8
4 changed files with 28 additions and 14 deletions

View File

@ -185,26 +185,27 @@ class GestionController extends Zend_Controller_Action
}
/**
* Extract sirets from database
* Extract only SIRETs from database
* @todo : To csv file
*/
public function siretscsvAction()
public function extractAction()
{
$id = $this->getRequest()->getParam('id');
$table = new Application_Model_EnrichissementIdentifiants();
$sql = $table->select()
->where('idComptage = ?', $id);
$sql = $table->select()->where('idComptage = ?', $id);
$result = $table->fetchRow($sql);
if(!empty($result)) {
$result = $result->toArray();
$sirets = json_decode($result['identifiants'], true);
$content = '';
foreach($sirets as $siret) {
echo $siret."\n";
$content.= $siret.",";
}
$this->view->assign('content', $content);
}else {
echo 'Aucune commande d\'enrichissement sur ce comptage';
$this->view->assign('message', 'Aucune commande d\'enrichissement sur ce comptage');
}
exit;
}
/**

View File

@ -0,0 +1,12 @@
<?php
if ($this->content) {
$content_type = 'application/csv-tab-delimited-table';
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo $this->content;
} else {
echo $this->message;
}

View File

@ -137,9 +137,10 @@ if (count($tabEnteteLabel)>0){
}
//Mise à jour des éléments
if ($opts->id) {
$commandesM->update('enrichissement_identifiants', array(
$commandesM->update(array(
'dateStart'=>date('Y-m-d H:i:s'),
'fichier' => basename($outFile)),
'fichier' => basename($outFile)
),
"id = ".$commande->id);
}

View File

@ -503,9 +503,9 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
'label' => 'Derniers éléments financiers',
'fields' => array(
'selectMultiple' => array('value' => array(
'I' => 'Inconnus',
'R' => 'Réels',
'E' => 'Estimés')
'1' => 'Inconnus', // I
'2' => 'Réels', // R
'3' => 'Estimés') //E
),
),
'famille' => 'financier',