extranet/application/controllers/GiantController.php

91 lines
4.1 KiB
PHP
Raw Normal View History

2011-04-15 12:40:29 +00:00
<?php
require_once ('Giant/ChromePhp.php');
2011-04-19 15:59:50 +00:00
require_once ('Giant/WSgiant.php');
require_once ('Giant/Search.lib.php');
2011-06-29 14:39:16 +00:00
require_once ('Scores/RechercheHistorique.php');
require_once ('Giant/CreditData.lib.php');
require_once ('Giant/Controller/RechercheController.php');
require_once ('Scores/Utilisateur.php');
require_once ('Giant/Functions.php');
require_once ('Giant/Controller/GiantController.php');
require_once ('Giant/Controller/IdentiteController.php');
2011-04-19 15:59:50 +00:00
2011-04-15 12:40:29 +00:00
class GiantController extends Zend_Controller_Action
{
2011-06-30 15:30:43 +00:00
protected $TestIndication = true;
2011-04-15 12:40:29 +00:00
2011-04-19 15:59:50 +00:00
public function init()
{
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all');
2011-06-30 15:30:43 +00:00
$this->view->headScript()->appendFile('/themes/default/scripts/finance.js', 'text/javascript');
$this->view->headScript()->appendFile('/themes/default/scripts/giant.js', 'text/javascript');
2011-06-29 14:39:16 +00:00
$this->view->debug = false;
2011-04-15 12:40:29 +00:00
}
2011-04-19 15:59:50 +00:00
public function searchAction()
2011-06-27 16:34:26 +00:00
{
2011-06-30 15:30:43 +00:00
$user = new Utilisateur();
2011-06-29 14:39:16 +00:00
$rechercheParams = new RechercheHistorique();
2011-06-27 16:34:26 +00:00
if (count($rechercheParams->liste()) > 0)
{
$recherche = $rechercheParams->item(0);
2011-06-27 16:34:26 +00:00
$type = $recherche['type'];
$params = $recherche['params'];
}
2011-06-30 15:30:43 +00:00
$search = new GiantRechercheController($params['pays'], $this->TestIndication);
2011-06-27 16:34:26 +00:00
$result = $search->Liste($params, $this->getRequest()->getParam('page'));
2011-06-29 14:39:16 +00:00
$this->view->label = $search->getObjet()->getLabelDesc();
$this->view->labelResults = $search->getObjet()->getLabelResults;
2011-06-27 16:34:26 +00:00
$this->view->pays = $params['pays'];
2011-06-29 14:39:16 +00:00
$this->view->currentPage = $search->getObjet()->getCurrentPage();
2011-06-30 15:30:43 +00:00
$this->view->userMaxResult = $user->getNbRep();
2011-06-27 16:34:26 +00:00
$this->view->resultats = $result;
2011-06-29 14:39:16 +00:00
$this->view->page = $this->getRequest()->getParam('page');
$this->view->referer = $search->getObjet()->getQuery();
$this->view->lienReferer = $search->getQueryLink($params);
if($this->view->debug)
$this->view->soap = $search->soapG;
2011-04-19 15:59:50 +00:00
}
2011-06-27 16:34:26 +00:00
public function identiteAction()
2011-04-19 15:59:50 +00:00
{
2011-06-30 15:30:43 +00:00
$rechercheParams = new RechercheHistorique();
2011-06-27 16:34:26 +00:00
if (count($rechercheParams->liste()) > 0)
{
$recherche = $rechercheParams->item(0);
2011-06-27 16:34:26 +00:00
$type = $recherche['type'];
$params = $recherche['params'];
}
2011-06-30 15:30:43 +00:00
$ListeRapport = new GiantRechercheController($params['pays'], $this->TestIndication);
$result = $ListeRapport->ListeRapport($this->getRequest()->getParam('CompanyId'));
ChromePhp::log($result);
2011-06-30 15:30:43 +00:00
$this->view->modification = $ListeRapport->getModification($result->MonitoringOptions->MonitoringOption[0]);
$this->view->description = $ListeRapport->getDescription();
$this->view->raisonSociale = $this->getRequest()->getParam('raisonSociale');
$this->view->listeRapport = $result;
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
$this->view->raisonSociale = $this->getRequest()->getParam('raisonSociale');
2011-06-29 14:39:16 +00:00
$this->view->CompanyRegisterNumber = $this->getRequest()->getParam('CompanyRegisterNumber');
2011-06-30 15:30:43 +00:00
$this->view->Pays = $this->getRequest()->getParam('Pays');
$this->view->Adresse = explode(':', $this->getRequest()->getParam('Adresse'));
if($this->view->debug)
$this->view->soap = $ListeRapport->soapG;
}
public function rapportAction()
2011-06-30 15:30:43 +00:00
{
$rechercheParams = new RechercheHistorique();
if (count($rechercheParams->liste()) > 0)
{
$recherche = $rechercheParams->item(0);
$type = $recherche['type'];
$params = $recherche['params'];
}
$Full = new GiantRechercheController($params['pays'], $this->TestIndication);
$result = $Full->GetRapport($this->getRequest()->getParam('CompanyId'), $this->getRequest()->getParam('Type'));
$identiteController = new GiantIdentiteController($result);
$identiteController->ficheAction();
$this->view->fiche = $identiteController->getObjet('fiche');
2011-04-19 15:59:50 +00:00
}
2011-04-15 12:40:29 +00:00
}