issue #0001456 : Forme juridique, Naf5
This commit is contained in:
parent
57f7d02c5e
commit
f535161d62
5
application/models/JoTabFJur.php
Normal file
5
application/models/JoTabFJur.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
class Application_Model_JoTabFJur extends Zend_Db_Table_Abstract
|
||||||
|
{
|
||||||
|
protected $_name = 'tabFJur';
|
||||||
|
}
|
5
application/models/JoTabNaf5.php
Normal file
5
application/models/JoTabNaf5.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
class Application_Model_JoTabNaf5 extends Zend_Db_Table_Abstract
|
||||||
|
{
|
||||||
|
protected $_name = 'tabNaf5';
|
||||||
|
}
|
@ -5,16 +5,95 @@ require_once realpath(dirname(__FILE__)).'/Types.php';
|
|||||||
class Catalog extends WsScore
|
class Catalog extends WsScore
|
||||||
{
|
{
|
||||||
|
|
||||||
protected function getNaf5()
|
protected function getNaf5($id)
|
||||||
{
|
{
|
||||||
$this->authenticate();
|
$this->authenticate();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$db = Zend_Db::factory($this->dbConfig->db->jo);
|
||||||
|
$db->getConnection();
|
||||||
|
} catch (Zend_Db_Adapter_Exception $e) {
|
||||||
|
if ($this->tabInfoUser['idClient']==1) {
|
||||||
|
throw new SoapFault('ERR', $e->getMessage());
|
||||||
|
} else {
|
||||||
|
throw new SoapFault('ERR', "Application error");
|
||||||
|
}
|
||||||
|
} catch (Zend_Exception $e) {
|
||||||
|
throw new SoapFault('ERR', "Application error");
|
||||||
|
}
|
||||||
|
|
||||||
|
$columnsDisplay = array('codNaf5', 'libNaf5', 'codNaf4', 'codNaf3', 'codNaf2', 'codNaf1');
|
||||||
|
try {
|
||||||
|
$model = new Application_Model_JoTabNaf5($db);
|
||||||
|
$sql = $model->select()->from($model, $columnsDisplay);
|
||||||
|
if ( $id!==null ) {
|
||||||
|
$sql->where('codNaf5=?', $id);
|
||||||
|
}
|
||||||
|
$result = $model->fetchAll($sql);
|
||||||
|
} catch (Zend_Db_Adapter_Exception $e) {
|
||||||
|
if ($this->tabInfoUser['idClient']==1) {
|
||||||
|
throw new SoapFault('ERR', $e->getMessage());
|
||||||
|
} else {
|
||||||
|
throw new SoapFault('ERR', "Application error");
|
||||||
|
}
|
||||||
|
} catch (Zend_Exception $e) {
|
||||||
|
throw new SoapFault('ERR', $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$tab = array();
|
||||||
|
if ( $result->count()>0 ) {
|
||||||
|
foreach ( $result as $item ) {
|
||||||
|
$tab[$item->codEven] = $item->toArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return json_encode($tab);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getLegalForm()
|
protected function getLegalForm($id)
|
||||||
{
|
{
|
||||||
$this->authenticate();
|
$this->authenticate();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$db = Zend_Db::factory($this->dbConfig->db->jo);
|
||||||
|
$db->getConnection();
|
||||||
|
} catch (Zend_Db_Adapter_Exception $e) {
|
||||||
|
if ($this->tabInfoUser['idClient']==1) {
|
||||||
|
throw new SoapFault('ERR', $e->getMessage());
|
||||||
|
} else {
|
||||||
|
throw new SoapFault('ERR', "Application error");
|
||||||
|
}
|
||||||
|
} catch (Zend_Exception $e) {
|
||||||
|
throw new SoapFault('ERR', "Application error");
|
||||||
|
}
|
||||||
|
|
||||||
|
$columnsDisplay = array('code', 'libelle');
|
||||||
|
try {
|
||||||
|
$model = new Application_Model_JoTabNaf5($db);
|
||||||
|
$sql = $model->select()->from($model, $columnsDisplay);
|
||||||
|
if ( $id!==null ) {
|
||||||
|
$sql->where('code=?', $id);
|
||||||
|
}
|
||||||
|
$result = $model->fetchAll($sql);
|
||||||
|
} catch (Zend_Db_Adapter_Exception $e) {
|
||||||
|
if ($this->tabInfoUser['idClient']==1) {
|
||||||
|
throw new SoapFault('ERR', $e->getMessage());
|
||||||
|
} else {
|
||||||
|
throw new SoapFault('ERR', "Application error");
|
||||||
|
}
|
||||||
|
} catch (Zend_Exception $e) {
|
||||||
|
throw new SoapFault('ERR', $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$tab = array();
|
||||||
|
if ( $result->count()>0 ) {
|
||||||
|
foreach ( $result as $item ) {
|
||||||
|
$tab[$item->code] = $item->toArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return json_encode($tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getEvent($id=null)
|
protected function getEvent($id=null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user