78 lines
1.8 KiB
PHP
78 lines
1.8 KiB
PHP
<?php
|
|
class DirigeantController extends Zend_Controller_Action
|
|
{
|
|
protected $siret;
|
|
protected $id;
|
|
|
|
public function init()
|
|
{
|
|
$request = $this->getRequest();
|
|
$this->siret = $request->getParam('siret');
|
|
$this->id = $request->getParam('id', 0);
|
|
|
|
require_once 'Scores/WsScores.php';
|
|
require_once 'Scores/SessionEntreprise.php';
|
|
require_once 'common/dates.php';
|
|
}
|
|
|
|
/**
|
|
* Forward
|
|
*/
|
|
public function indexAction()
|
|
{
|
|
$this->_forward('index', 'index');
|
|
}
|
|
|
|
/**
|
|
* Affichage de la liste des dirigeants
|
|
*/
|
|
public function listeAction()
|
|
{
|
|
$siren = substr($this->siret, 0, 9);
|
|
$ws = new WsScores();
|
|
$infos = $ws->getDirigeants($siren);
|
|
|
|
if ($infos === false){
|
|
$this->_forward('soap', 'error');
|
|
}
|
|
|
|
$dirigeants = $infos->result->item;
|
|
|
|
$session = new SessionEntreprise($this->siret, $this->id);
|
|
|
|
$this->view->assign('siren', $siren);
|
|
$this->view->assign('siret', $this->siret);
|
|
$this->view->assign('raisonSociale', $session->getRaisonSociale());
|
|
$this->view->assign('dirigeants', $dirigeants);
|
|
$this->view->assign('exportObjet', $dirigeants);
|
|
|
|
$this->view->assign('AutrePage', $this->getRequest()->getParam('apage'));
|
|
}
|
|
|
|
/**
|
|
* Affichage de l'historiques des dirigeants
|
|
*/
|
|
public function histoAction()
|
|
{
|
|
$siren = substr($this->siret, 0, 9);
|
|
|
|
$ws = new WsScores();
|
|
$infos = $ws->getDirigeants($siren, true);
|
|
|
|
if ($infos === false){
|
|
$this->_forward('soap', 'error');
|
|
}
|
|
|
|
$dirigeants = $infos->result->item;
|
|
|
|
$session = new SessionEntreprise($this->siret, $this->id);
|
|
|
|
$this->view->assign('dirigeants', $dirigeants);
|
|
$this->view->assign('exportObjet', $dirigeants);
|
|
$this->view->assign('siren', $siren);
|
|
$this->view->assign('siret', $this->siret);
|
|
$this->view->assign('raisonSociale', $session->getRaisonSociale());
|
|
$this->view->assign('infos', $infos);
|
|
}
|
|
|
|
} |