erreur de syntaxe

This commit is contained in:
Damien LASSERRE 2011-12-22 15:34:40 +00:00
parent 893c79a2ca
commit 34c6644970

View File

@ -72,17 +72,19 @@ class CriteresController extends Zend_Controller_Action
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(); $this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest(); $request = $this->getRequest();
$niveau = $request->getParam('niveau', 1); $niveau = $request->getParam('niveau', 1);
$parent = $request->getParam('parent', '');
$nafM = new Application_Model_Naf();
$sql = $nafM->select();
$niveau++; $niveau++;
$parent = $request->getParam('parent', '');
$nafM = new Application_Model_Naf();
$sql = $nafM->select();
if (!empty($parent) && $niveau==2) { if (!empty($parent) && $niveau==2) {
$sql->where('parent = ?', $parent); $sql->where('parent = ?', $parent);
} elseif (!empty($parent) && $niveau>2) { } elseif (!empty($parent) && $niveau>2) {
$sql->where("code LIKE '".$parent."%'"); $sql->where("code LIKE '".$parent."%'");
} }
$sql->where('niveau = ?', $niveau)->order('code ASC'); $sql->where('niveau = ?', $niveau)->order('code ASC');
$result = $nafM->fetchAll($sql)->toArray(); $result = $nafM->fetchAll($sql)->toArray();