Remove dataInsee, change sql request

This commit is contained in:
Michael RICOIS 2012-10-25 15:25:53 +00:00
parent 9de2875931
commit 5ab102b6cf

View File

@ -71,25 +71,12 @@ class GestionController extends Zend_Controller_Action
$params['criteres'] = json_decode($profilClient->current()->criteres,true);
}
$dataInsee = 0;
// Est ce qu'il existe une donnée insee
require_once 'Scores/Enrichissement.php';
$fieldsM = new Enrichissement();
$fields = $fieldsM->getFields();
foreach ( $fields as $key => $val) {
if ( array_key_exists('insee', $val) && $val['insee']===true) {
$dateInsee = 1;
break;
}
}
$data = array(
'idClient' => $params['idClient'],
'service' => $params['service'],
'login' => $params['login'],
'reference' => $params['reference'],
'criteres' => json_encode($params['criteres']),
'dataInsee' => $dataInsee,
'dateAjout' => date('Y-m-d H:i:s'),
'actif' => 1,
);
@ -278,12 +265,13 @@ class GestionController extends Zend_Controller_Action
if ($idClient !== null) {
$paramsM = new Application_Model_CustomerParams();
$params = $paramsM->find($idClient);
$sql = $paramsM->select()->where('idClient = ?', $idClient);
$params = $paramsM->fetchRow($sql);
$infos = null;
if ($params->count()>0){
if ($params!==null){
$infos = $params->toArray();
}
$this->view->assign('infos',$infos[0]);
$this->view->assign('infos',$infos);
$loginsM = new Application_Model_EnrichissementProfils();
$sql = $loginsM->select()->where('idClient = ?', $idClient);