extranet/application/controllers/DirigeantController.php

78 lines
1.8 KiB
PHP
Raw Normal View History

2011-02-21 08:45:13 +00:00
<?php
class DirigeantController extends Zend_Controller_Action
{
2011-04-19 06:23:20 +00:00
protected $siret;
protected $id;
public function init()
{
$request = $this->getRequest();
$this->siret = $request->getParam('siret');
$this->id = $request->getParam('id', 0);
2011-06-07 09:54:28 +00:00
require_once 'Scores/WsScores.php';
require_once 'Scores/SessionEntreprise.php';
require_once 'common/dates.php';
2011-04-19 06:23:20 +00:00
}
2011-02-21 08:45:13 +00:00
/**
* Forward
*/
2011-08-19 15:35:32 +00:00
public function indexAction()
{
$this->_forward('index', 'index');
}
2011-04-19 06:23:20 +00:00
2011-06-07 09:54:28 +00:00
/**
* Affichage de la liste des dirigeants
*/
2011-04-19 06:23:20 +00:00
public function listeAction()
{
$siren = substr($this->siret, 0, 9);
$ws = new WsScores();
$infos = $ws->getDirigeants($siren);
2011-08-19 12:31:51 +00:00
if ($infos === false){
$this->_forward('soap', 'error');
}
$dirigeants = $infos->result->item;
$session = new SessionEntreprise($this->siret, $this->id);
$this->view->assign('siren', $siren);
2011-04-20 13:41:43 +00:00
$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'));
2011-04-19 06:23:20 +00:00
}
2011-06-07 09:54:28 +00:00
/**
* Affichage de l'historiques des dirigeants
*/
2011-04-19 06:23:20 +00:00
public function histoAction()
{
$siren = substr($this->siret, 0, 9);
2011-04-19 06:23:20 +00:00
$ws = new WsScores();
$infos = $ws->getDirigeants($siren, true);
2011-08-19 12:31:51 +00:00
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);
2011-04-20 13:41:43 +00:00
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
2011-04-19 06:23:20 +00:00
$this->view->assign('infos', $infos);
}
2011-04-11 14:19:14 +00:00
2011-02-21 08:45:13 +00:00
}