Change adapter déclaration

This commit is contained in:
Michael RICOIS 2013-05-23 06:49:29 +00:00
parent 4ba0a041bb
commit 81a4e690fa

View File

@ -234,19 +234,7 @@ class ComptageController extends Zend_Controller_Action
//Comptage
require_once 'Scores/Ciblage.php';
$ciblage = new Ciblage($fields->getValues(), $user->globalRNCS);
$sirets = $ciblage->execute(true, 10);
$c = Zend_Registry::get('config');
try {
$dbMetier = Zend_Db::factory($c->profil->db->jo);
} catch ( Exception $e ) {
if ( $user->idClient ) {
exit ( $e->getMessage() );
} else {
echo "Prévisualisation indisponible";
exit;
}
}
$sirets = $ciblage->execute(true, 10);
/**
* Make SQL request with the client profil for columns
@ -283,7 +271,8 @@ class ComptageController extends Zend_Controller_Action
}
}
$sql = $dbMetier->select()->from('etablissements_act', $extractSql);
$db = Zend_Db_Table::getDefaultAdapter();
$sql = $db->select()->from('jo.etablissements_act', $extractSql);
$i = 0;
$where = '';
@ -296,7 +285,7 @@ class ComptageController extends Zend_Controller_Action
}
$sql->where($where);
$result = $dbMetier->fetchAll($sql);
$result = $db->fetchAll($sql);
$liste = array();
foreach ($result as $l => $line) {
$tmp = array();