odea/application/controllers/ArborescenceController.php

89 lines
2.2 KiB
PHP
Raw Normal View History

2012-02-02 17:29:14 +00:00
<?php
class ArborescenceController extends Libs_Controller
{
2012-02-15 09:25:21 +00:00
/* Nafs */
2012-02-02 17:29:14 +00:00
public function nafAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$key = $request->getParam('key');
$object = new Object_Naf();
2012-04-12 08:07:35 +00:00
2012-02-02 17:29:14 +00:00
$this->view->key = $key;
$this->view->naf = $object->naf($request->getParam('niveau', 1), $key);
}
public function nafajaxAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest();
$key = $request->getParam('key');
$object = new Object_Naf();
echo $object->ajax($request->getParam('parent', ''),
$request->getParam('niveau', 1),
$request->getParam('key')
);
}
2012-02-15 09:25:21 +00:00
/* Geographiques */
2012-02-02 17:29:14 +00:00
public function geographiqueAction()
{
$this->_helper->layout()->disableLayout();
2012-02-15 09:25:21 +00:00
$object = new Object_Codepostaux();
$key = $this->getRequest()->getParam('key');
$this->view->key = $key;
$this->view->regions = $object->_getRegions();
2012-02-02 17:29:14 +00:00
}
public function geographiqueajaxAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
2012-02-15 09:25:21 +00:00
2012-02-02 17:29:14 +00:00
$request = $this->getRequest();
$id = $request->getParam('id');
2012-02-15 09:25:21 +00:00
$niveau = $request->getParam('niveau');
$object = new Object_Codepostaux();
if($niveau == 0) {
echo ($object->_getDepartements($id));
} else if ($niveau == 1) {
echo ($object->_getCommunes($id));
2012-02-02 17:29:14 +00:00
}
}
2012-02-15 09:25:21 +00:00
/* Forme Juridique */
public function juridiqueAction()
{
$this->_helper->layout()->disableLayout();
$object = new Object_Formejuridique();
$key = $this->getRequest()->getParam('key');
$this->view->key = $key;
$this->view->formejuridiques = $object->_getParents();
}
public function juridiqueajaxAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$object = new Object_Formejuridique();
$request = $this->getRequest();
$id = $request->getParam('id');
echo ($object->_getFils($id));
}
2012-02-02 17:29:14 +00:00
}