Chargement des critères depuis la base de données
This commit is contained in:
parent
e0c2095539
commit
0c95160798
@ -11,17 +11,39 @@ class IndexController extends Zend_Controller_Action
|
||||
|
||||
public function init()
|
||||
{
|
||||
require_once('Scores/Field.php');
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$field = new Fields($user->username);
|
||||
$this->fields = $field;
|
||||
|
||||
}
|
||||
|
||||
public function criteresAction()
|
||||
{
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/fields.js', 'text/javascript');
|
||||
$this->view->fields = $this->fields;
|
||||
$request = $this->getRequest();
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$this->view->fields = $fields;
|
||||
|
||||
//Chargement de la structure des champs et des préférences utilisateurs
|
||||
require_once 'Scores/Field.php';
|
||||
$field = new Fields($user->username);
|
||||
|
||||
// Chargement des critères de ciblage à partir de l'enregistrement en bdd
|
||||
$id = $request->getParam('id', 0);
|
||||
if (!empty($id)) {
|
||||
$db = Zend_Registry::get('db');
|
||||
$criteresM = new Application_Model_Criteres();
|
||||
$sql = $criteresM->select()
|
||||
->columns($criteresM, array('criteres'))
|
||||
->where('login = ?', $user->username)
|
||||
->where('id = ?', $id);
|
||||
|
||||
$row = $criteresM->fetchRow($sql);
|
||||
if ($row != null) {
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$session->setCriteres(json_decode($row->criteres, 'true'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function resetAction()
|
||||
|
Loading…
Reference in New Issue
Block a user