extranet/application/controllers/GiantController.php
Damien LASSERRE c269262d5a Giant !
2011-06-27 16:34:26 +00:00

95 lines
3.0 KiB
PHP

<?php
require_once ('Giant/WSgiant.php');
require_once ('Giant/Search.lib.php');
require_once('Scores/RechercheHistorique.php');
require_once 'Giant/CreditData.lib.php';
require_once 'Giant/Controller/RechercheController.php';
/**
* Cette classe gere les méthodes de Giant le nom des méthode de cette classe
* doivent êtres en correlation avec les méthodes de giant.
*
*
* @author Lasserre Damien
*
*/
class GiantController extends Zend_Controller_Action
{
protected $soapClient;
protected $Provider;
protected $TestIndication;
protected $user;
protected $language;
protected $labelResults;
public function init()
{
/** @todo provisoir **/
$auth = Zend_Auth::getInstance();
$entreprise = new RechercheHistorique();
$this->user = $auth->getIdentity();
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all');
if($this->getRequest()->getActionName() != 'search' and isset($_SESSION['recherche']['giant']['page']))
unset($_SESSION['recherche']['giant']['page']);
}
public function indexAction()
{
$rechercheParams = new RechercheHistorique();
if (count($rechercheParams->liste()) > 0)
{
$recherche = $rechercheParams->item(0);
$type = $recherche['type'];
$params = $recherche['params'];
}
$siret = $params['siret'];
if(empty($siret)) $this->_forward('search');
else $this->_forward('identite');
}
public function searchAction()
{
$rechercheParams = new RechercheHistorique();
if (count($rechercheParams->liste()) > 0)
{
$recherche = $rechercheParams->item(0);
$type = $recherche['type'];
$params = $recherche['params'];
}
$search = new GiantRechercheController($params['pays']);
$result = $search->Liste($params, $this->getRequest()->getParam('page'));
$this->view->label = $search->Search->getLabelDesc();
$this->view->labelResults = $search->Search->getLabelResults;
$this->view->pays = $params['pays'];
$this->view->currentPage = $search->Search->getCurrentPage();
$this->view->userMaxResult = $this->user->nbReponses;
$this->view->resultats = $result;
$this->view->referer = $search->Search->getQuery();
}
public function identiteAction()
{
$rechercheParams = new RechercheHistorique();
if (count($rechercheParams->liste()) > 0)
{
$recherche = $rechercheParams->item(0);
$type = $recherche['type'];
$params = $recherche['params'];
}
$identite = new GiantRechercheController($params['pays']);
$result = $identite->Identite($this->getRequest()->getParam('companyId'), $this->getRequest()->getParam('pays'));
$ListeRapport = $identite->ListeRapport($this->getRequest()->getParam('companyId'));
$this->view->resultats = $result;
$this->view->listeRapport = $ListeRapport;
}
public function __destruct()
{
unset($_SESSION['recherche']['giant']);
}
}