odea/application/controllers/EconomiqueController.php

47 lines
1.2 KiB
PHP
Raw Normal View History

2012-02-02 17:29:14 +00:00
<?php
class EconomiqueController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
require_once('Scores/Field.php');
2012-02-15 10:35:07 +00:00
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
2012-02-22 15:28:19 +00:00
$field = new Fields();
2012-02-02 17:29:14 +00:00
$this->view->fields = $field;
}
2012-02-15 09:25:21 +00:00
public function resetAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$session->resetFamille('economique');
}
public function completedAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest();
$table = new Table_Nafs();
$sql = $table->select()
->where('lib LIKE "%'.$this->getRequest()->getParam('q').'%"');
$result = $table->fetchAll($sql);
foreach ($result as $item) {
$output[] = array(
'label' => $item->lib . $separator . $item->code,
'value' => $item->code
);
}
echo json_encode($output);
}
2012-02-02 17:29:14 +00:00
}