translate value database by their text

This commit is contained in:
Michael RICOIS 2012-05-25 12:21:49 +00:00
parent 934f1e621f
commit e079513039

View File

@ -207,7 +207,7 @@ class ComptageController extends Zend_Controller_Action
$extractSql[] = "CONCAT(LPAD(siren, 9, '000000000'), LPAD(nic, 5, '00000')) AS siret";
$extractLabel[] = 'SIRET';
require_once('Scores/Enrichissement.php');
require_once 'Scores/Enrichissement.php';
$enrichissement = new Enrichissement();
$data = $enrichissement->getFields();
foreach ( $data as $key => $item ) {
@ -221,8 +221,7 @@ class ComptageController extends Zend_Controller_Action
}
}
$sql = $dbMetier->select()
->from('etablissements_act', $extractSql);
$sql = $dbMetier->select()->from('etablissements_act', $extractSql);
$i = 0;
$where = '';
@ -240,7 +239,12 @@ class ComptageController extends Zend_Controller_Action
foreach ($result as $l => $line) {
$tmp = array();
foreach($line as $column => $data) {
$tmp[] = $data;
$valuesPredefine = $enrichissement->getColumnValue($column);
if ($valuesPredefine!==false) {
$tmp[] = $valuesPredefine[$data];
} else {
$tmp[] = $data;
}
}
$liste[] = $tmp;
}