2011-04-15 12:40:29 +00:00
|
|
|
<?php
|
2012-08-28 19:54:01 +00:00
|
|
|
require_once 'Scores/RechercheHistorique.php';
|
|
|
|
require_once 'Giant/WSgiant.php';
|
|
|
|
require_once 'Giant/Controllers.lib.php';
|
|
|
|
require_once 'Giant/RequestDatabase.lib.php';
|
|
|
|
require_once 'Giant/Functions.lib.php';
|
|
|
|
require_once 'common/dates.php';
|
2011-04-19 15:59:50 +00:00
|
|
|
|
2011-04-15 12:40:29 +00:00
|
|
|
class GiantController extends Zend_Controller_Action
|
|
|
|
{
|
2011-08-31 14:22:23 +00:00
|
|
|
protected $TestIndication = true;
|
2013-06-14 09:06:17 +00:00
|
|
|
|
2012-08-28 19:54:01 +00:00
|
|
|
protected $TestCompanies = array(
|
2013-06-14 09:06:17 +00:00
|
|
|
'BE' => array(
|
|
|
|
'0439546194', '0436576412', '0430459076', '0430000604', '0404869783', '0404869783',
|
|
|
|
'0406952018'
|
|
|
|
),
|
|
|
|
'ES' => array(
|
|
|
|
'A00000000', 'A80192727'
|
|
|
|
),
|
|
|
|
'GB' => array(
|
|
|
|
'00000086', '00082932', '98888888', '214436', '1777777', '991581', '1800000'
|
|
|
|
),
|
|
|
|
'NL' => array(
|
|
|
|
'533885', '1383988', '1383989', '891962239', '891974008', '892130032', '896614719',
|
|
|
|
'896614735', '896614735', '896615243'
|
|
|
|
),
|
|
|
|
'FR' => array(
|
|
|
|
'55214450300018', '49496793800031', '47997411500012', '48765114300017',
|
|
|
|
'43235433000040', '39435613300022', '39504742600014', '76980020200020',
|
|
|
|
'35379698000020', '56202109700018', '70204756400068', '70204756400068'
|
|
|
|
),
|
2012-08-28 19:54:01 +00:00
|
|
|
);
|
2013-06-14 09:06:17 +00:00
|
|
|
|
2011-08-31 14:22:23 +00:00
|
|
|
|
2011-04-19 15:59:50 +00:00
|
|
|
public function init()
|
|
|
|
{
|
2011-08-31 14:22:23 +00:00
|
|
|
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all');
|
|
|
|
$this->view->headScript()->appendFile('/themes/default/scripts/giant.js', 'text/javascript');
|
|
|
|
$this->view->debug = false;
|
2011-04-15 12:40:29 +00:00
|
|
|
}
|
2011-08-31 14:22:23 +00:00
|
|
|
|
2011-04-19 15:59:50 +00:00
|
|
|
public function searchAction()
|
2011-08-26 14:02:45 +00:00
|
|
|
{
|
2012-05-20 16:31:28 +00:00
|
|
|
$user = new Scores_Utilisateur();
|
2011-08-31 14:22:23 +00:00
|
|
|
$params = $this->getRequest()->getParams();
|
|
|
|
$search = new GiantRechercheController($params['pays'], $this->TestIndication);
|
|
|
|
$result = $search->Liste($params, $this->getRequest()->getParam('page'));
|
|
|
|
$this->view->label = $search->getObjet()->getLabelDesc();
|
2011-12-07 08:58:50 +00:00
|
|
|
$this->view->labelResults = $search->getObjet()->getLabelResults();
|
2011-08-31 14:22:23 +00:00
|
|
|
$this->view->pays = $params['pays'];
|
|
|
|
$this->view->currentPage = $search->getObjet()->getCurrentPage();
|
|
|
|
$this->view->userMaxResult = $user->getNbRep();
|
|
|
|
$this->view->resultats = $result;
|
|
|
|
$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-08-31 14:22:23 +00:00
|
|
|
|
2011-06-27 16:34:26 +00:00
|
|
|
public function identiteAction()
|
2011-04-19 15:59:50 +00:00
|
|
|
{
|
2011-08-31 14:22:23 +00:00
|
|
|
$rechercheParams = new RechercheHistorique();
|
2011-11-14 10:01:41 +00:00
|
|
|
$giantFunction = new GiantFunction();
|
2013-06-14 09:06:17 +00:00
|
|
|
if (count($rechercheParams->liste()) > 0)
|
|
|
|
{
|
|
|
|
$recherche = $rechercheParams->item(0);
|
|
|
|
$type = $recherche['type'];
|
|
|
|
$params = $recherche['params'];
|
|
|
|
}
|
|
|
|
$Commande = new Commandes();
|
|
|
|
$user = new Scores_Utilisateur();
|
|
|
|
$listeCommandes = $Commande->getCommandesByLogin($user->getLogin());
|
|
|
|
$total = 0;
|
|
|
|
$liste = $giantFunction->divCommande($listeCommandes, $total);
|
|
|
|
$ListeRapport = new GiantRechercheController($params['pays'], $this->TestIndication);
|
|
|
|
$result = $ListeRapport->ListeRapport($this->getRequest()->getParam('CompanyId'));
|
|
|
|
$this->view->total = $total;
|
|
|
|
$this->view->listeCommandes = $liste;
|
|
|
|
$this->view->modification = (isset($result->MonitoringOptions))?($ListeRapport->getModification($result->MonitoringOptions->MonitoringOption[0])):null;
|
|
|
|
$this->view->description = $ListeRapport->getDescription();
|
|
|
|
$this->view->raisonSociale = $this->getRequest()->getParam('raisonSociale');
|
|
|
|
$this->view->listeRapport = $result;
|
|
|
|
$this->view->telephone = $this->getRequest()->getParam('telephone');
|
|
|
|
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
|
|
|
|
$this->view->raisonSociale = $this->getRequest()->getParam('raisonSociale');
|
|
|
|
$this->view->CompanyRegisterNumber = $this->getRequest()->getParam('CompanyRegisterNumber');
|
|
|
|
$this->view->Pays = $this->getRequest()->getParam('Pays');
|
|
|
|
$this->view->Adresse = explode(':', $this->getRequest()->getParam('Adresse'));
|
|
|
|
if($this->view->debug)
|
2011-08-31 14:22:23 +00:00
|
|
|
$this->view->soap = $ListeRapport->soapG;
|
2011-06-30 15:30:43 +00:00
|
|
|
}
|
2011-08-25 08:57:37 +00:00
|
|
|
|
2011-09-06 12:40:31 +00:00
|
|
|
public function creditrecommendationAction()
|
2011-08-31 14:22:23 +00:00
|
|
|
{
|
2011-09-06 12:40:31 +00:00
|
|
|
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
|
|
|
|
$id = $giantController->commande($this->getRequest()->getParam('CompanyId'),
|
2013-06-14 09:06:17 +00:00
|
|
|
$this->getRequest()->getParam('Type'),
|
|
|
|
$this->getRequest()->getParam('Pays'),
|
|
|
|
$this->getRequest()->getParam('Language'),
|
|
|
|
$this->TestIndication
|
2011-09-06 12:40:31 +00:00
|
|
|
);
|
|
|
|
$creditrecommendationAction = array('getAvisDeCredit' => 'CreditRecommendation');
|
|
|
|
$creditrecommendation = unserialize(base64_decode($id));
|
|
|
|
$identiteController = new GiantIdentiteController($creditrecommendation);
|
|
|
|
$giantConstroller = new GiantControllerLib($this->getRequest()->getParam('CompanyId').'-'.$this->getRequest()->getParam('Type'));
|
|
|
|
$identiteController->ficheAction();
|
|
|
|
$fiche = $identiteController->getObjet('fiche');
|
|
|
|
foreach($creditrecommendationAction as $action => $val) {
|
|
|
|
if(isset($creditrecommendation->DataSet->Company->$val)) {
|
|
|
|
$creditrecommendation = $giantConstroller->$action($creditrecommendation);
|
|
|
|
}
|
2011-08-31 14:22:23 +00:00
|
|
|
}
|
2011-09-06 12:40:31 +00:00
|
|
|
$fiche = $giantConstroller->getInformationGenerale($creditrecommendation);
|
|
|
|
$this->view->carte = $this->getRequest()->getParam('Pays');
|
|
|
|
$this->view->reportType = $this->getRequest()->getParam('Type');
|
|
|
|
$this->view->report = $fiche;
|
|
|
|
$this->view->Type = $this->getRequest()->getParam('Type');
|
2011-11-14 10:01:41 +00:00
|
|
|
$this->view->dateFunction = new WDate();
|
2011-09-06 12:40:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function compactAction()
|
|
|
|
{
|
|
|
|
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
|
|
|
|
$id = $giantController->commande($this->getRequest()->getParam('CompanyId'),
|
2013-06-14 09:06:17 +00:00
|
|
|
$this->getRequest()->getParam('Type'),
|
|
|
|
$this->getRequest()->getParam('Pays'),
|
|
|
|
$this->getRequest()->getParam('Language'),
|
|
|
|
$this->TestIndication
|
2011-09-06 12:40:31 +00:00
|
|
|
);
|
|
|
|
$compactAction = array('getAvisDeCredit' => 'CreditRecommendation', 'getPositionFinanciere' => 'FinancialSummary',
|
2013-06-14 09:06:17 +00:00
|
|
|
'getStructureEntreprise' => 'Associated', 'getDirigeant' => 'Position'
|
2011-09-06 12:40:31 +00:00
|
|
|
);
|
|
|
|
$compact = unserialize(base64_decode($id));
|
|
|
|
$identiteController = new GiantIdentiteController($compact);
|
|
|
|
$giantConstroller = new GiantControllerLib($this->getRequest()->getParam('CompanyId').'-'.$this->getRequest()->getParam('Type'));
|
|
|
|
$identiteController->ficheAction();
|
|
|
|
$fiche = $identiteController->getObjet('fiche');
|
|
|
|
|
|
|
|
foreach($compactAction as $action => $val) {
|
|
|
|
if(isset($compact->DataSet->Company->$val)) {
|
|
|
|
$compact = $giantConstroller->$action($compact);
|
|
|
|
}
|
2011-08-31 14:22:23 +00:00
|
|
|
}
|
2011-09-06 12:40:31 +00:00
|
|
|
$fiche = $giantConstroller->getInformationGenerale($compact);
|
|
|
|
$this->view->carte = $this->getRequest()->getParam('Pays');
|
|
|
|
$this->view->reportType = $this->getRequest()->getParam('Type');
|
|
|
|
$this->view->report = $fiche;
|
|
|
|
$this->view->Type = $this->getRequest()->getParam('Type');
|
2011-11-14 10:01:41 +00:00
|
|
|
$this->view->dateFunction = new WDate();
|
2011-09-06 12:40:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function fullAction()
|
|
|
|
{
|
|
|
|
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId').'-'.$this->getRequest()->getParam('Type'));
|
2012-05-20 16:31:28 +00:00
|
|
|
$id = $giantController->commande($this->getRequest()->getParam('CompanyId'),
|
2013-06-14 09:06:17 +00:00
|
|
|
$this->getRequest()->getParam('Type'),
|
|
|
|
$this->getRequest()->getParam('Pays'),
|
|
|
|
$this->getRequest()->getParam('Language'),
|
|
|
|
$this->TestIndication
|
2011-09-06 12:40:31 +00:00
|
|
|
);
|
2011-08-31 14:22:23 +00:00
|
|
|
$fullAction = array('getAvisDeCredit' => 'CreditRecommendation', 'getComptesAnnuels' => 'AnnualAccounts', 'getPositionFinanciere' => 'FinancialSummary',
|
2013-06-14 09:06:17 +00:00
|
|
|
'getComportementPaiement' => 'PaymentBehaviour', 'getStructureEntreprise' => 'Associated', 'getDirigeant' => 'Position',
|
|
|
|
'getComparaisonValeurs'=> 'PeerGroup', 'getHistoriques' => 'Event'
|
2011-09-01 13:56:31 +00:00
|
|
|
);
|
2011-09-05 14:31:19 +00:00
|
|
|
$full = unserialize(base64_decode($id));
|
2011-10-13 07:06:08 +00:00
|
|
|
$full->DataSet->Company->CompanyId= $this->getRequest()->getParam('CompanyId');
|
2011-08-31 14:22:23 +00:00
|
|
|
$identiteController = new GiantIdentiteController($full);
|
2011-09-06 12:40:31 +00:00
|
|
|
$giantConstroller = new GiantControllerLib($this->getRequest()->getParam('CompanyId').'-'.$this->getRequest()->getParam('Type'));
|
2011-08-31 14:22:23 +00:00
|
|
|
$identiteController->ficheAction();
|
|
|
|
$fiche = $identiteController->getObjet('fiche');
|
|
|
|
|
|
|
|
foreach($fullAction as $action => $val) {
|
|
|
|
if(isset($full->DataSet->Company->$val))
|
|
|
|
$full = $giantConstroller->$action($full);
|
|
|
|
}
|
|
|
|
$fiche = $giantConstroller->getInformationGenerale($full);
|
2011-09-02 12:45:55 +00:00
|
|
|
$this->view->carte = $this->getRequest()->getParam('Pays');
|
2011-08-31 14:22:23 +00:00
|
|
|
$this->view->reportType = $this->getRequest()->getParam('Type');
|
|
|
|
$this->view->report = $fiche;
|
2011-09-06 12:40:31 +00:00
|
|
|
$this->view->Type = $this->getRequest()->getParam('Type');
|
2011-11-14 10:01:41 +00:00
|
|
|
$this->view->dateFunction = new WDate();
|
2011-04-19 15:59:50 +00:00
|
|
|
}
|
2011-09-06 12:56:45 +00:00
|
|
|
|
2011-09-07 08:41:47 +00:00
|
|
|
public function getForm()
|
|
|
|
{
|
|
|
|
$form = new Zend_Form();
|
|
|
|
$form->setMethod('post')
|
2013-06-14 09:06:17 +00:00
|
|
|
->setAction('investigation');
|
2011-09-07 08:41:47 +00:00
|
|
|
|
|
|
|
$reference = $form->createElement('text', 'reference', array('label' => 'Votre Reference'));
|
|
|
|
$reference->setRequired(true);
|
|
|
|
$elements[] = $reference;
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-09-07 08:41:47 +00:00
|
|
|
$telephone = $form->createElement('text', 'telephone', array('label' => 'Votre téléphone'));
|
|
|
|
$telephone->setRequired(true);
|
|
|
|
$elements[] = $telephone;
|
|
|
|
|
|
|
|
$mail = $form->createElement('text', 'mail', array('label' => 'Adresse Email'));
|
|
|
|
$mail->setRequired(true);
|
|
|
|
$elements[] = $mail;
|
|
|
|
|
|
|
|
$elements[] = $form->createElement('textarea', 'remarque', array('label' => 'Remarque ou commentaire à destination de l\'enquêteur :'));
|
|
|
|
$elements[] = $form->createElement('text', 'domiciliation', array('label' => 'Domiciliation Bancaire :'));
|
|
|
|
$elements[] = $form->createElement('text', 'Encours', array('label' => 'Encours demandé :'));
|
|
|
|
$elements[] = $form->createElement('text', 'nbEcheance', array('label' => 'Nombre d\'échéances :'));
|
|
|
|
|
|
|
|
$form->addElements($elements)
|
|
|
|
->addElement('submit', 'Envoyer', array('label' => 'Envoyer'));
|
|
|
|
return ($form);
|
|
|
|
}
|
|
|
|
|
2011-09-06 12:56:45 +00:00
|
|
|
public function investigationAction()
|
|
|
|
{
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-09-07 08:41:47 +00:00
|
|
|
if($this->getRequest()->isPost()) {
|
|
|
|
$data = $this->getRequest()->getPost();
|
|
|
|
if($this->getForm()->isValid($data))
|
|
|
|
$this->view->form = $this->getRequest()->getParam('reference');
|
|
|
|
else {
|
|
|
|
return ($this->view->form = $this->getForm());
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
$this->view->form = $this->getForm();
|
2011-09-06 12:56:45 +00:00
|
|
|
}
|
2013-06-14 09:06:17 +00:00
|
|
|
public function startmonitoringAction()
|
|
|
|
{
|
|
|
|
$this->_helper->layout()->disableLayout();
|
|
|
|
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all');
|
|
|
|
$this->view->lang = $this->getRequest()->getParam('lang');
|
|
|
|
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
|
2013-06-14 13:24:18 +00:00
|
|
|
$this->view->Pays = $this->getRequest()->getParam('Pays');
|
2013-06-17 12:26:12 +00:00
|
|
|
$this->view->CompanyName = $this->getRequest()->getParam('CompanyName');
|
|
|
|
$this->view->action = $this->getRequest()->getParam('action');
|
2013-06-14 13:24:18 +00:00
|
|
|
$this->view->values = $this->getRequest()->getParams();
|
|
|
|
if ($this->getRequest()->isPost()) {
|
|
|
|
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
|
2013-06-17 12:26:12 +00:00
|
|
|
$result = $giantController->startmonitoring($this->getRequest()->getParam('CompanyId'),
|
2013-06-14 13:24:18 +00:00
|
|
|
$this->getRequest()->getParam('CategoryName'),
|
|
|
|
$this->getRequest()->getParam('EventType'),
|
|
|
|
$this->getRequest()->getParam('StartDate'),
|
|
|
|
$this->getRequest()->getParam('EndDate'),
|
|
|
|
$this->getRequest()->getParam('Version'),
|
|
|
|
$this->getRequest()->getParam('LanguageCode'),
|
2013-06-18 13:28:22 +00:00
|
|
|
$this->getRequest()->getParam('Pays'),
|
2013-07-16 12:36:10 +00:00
|
|
|
$this->TestIndication,
|
|
|
|
$this->getRequest()->getParam('CompanyName')
|
2013-06-14 13:24:18 +00:00
|
|
|
);
|
|
|
|
$this->view->result = $result;
|
|
|
|
}
|
2013-06-18 13:28:22 +00:00
|
|
|
|
2013-06-14 09:06:17 +00:00
|
|
|
}
|
2013-06-17 12:26:12 +00:00
|
|
|
public function stopmonitoringAction()
|
|
|
|
{
|
|
|
|
$this->_helper->layout()->disableLayout();
|
|
|
|
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all');
|
|
|
|
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
|
|
|
|
$this->view->Pays = $this->getRequest()->getParam('Pays');
|
|
|
|
$this->view->InternalOrderId = $this->getRequest()->getParam('InternalOrderId');
|
|
|
|
$this->view->CompanyName = $this->getRequest()->getParam('CompanyName');
|
|
|
|
$this->view->action = $this->getRequest()->getParam('action');
|
|
|
|
$this->view->values = $this->getRequest()->getParams();
|
2013-06-18 13:28:22 +00:00
|
|
|
|
2013-06-17 12:26:12 +00:00
|
|
|
if ($this->getRequest()->isPost()) {
|
|
|
|
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
|
|
|
|
$result = $giantController->stopmonitoring($this->getRequest()->getParam('CompanyId'),
|
|
|
|
$this->getRequest()->getParam('EndDate'),
|
|
|
|
$this->getRequest()->getParam('InternalOrderId'),
|
2013-06-18 13:28:22 +00:00
|
|
|
$this->getRequest()->getParam('Pays'),
|
|
|
|
$this->TestIndication
|
|
|
|
);
|
|
|
|
$this->view->result = $result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public function updatemonitoringAction()
|
|
|
|
{
|
|
|
|
$this->_helper->layout()->disableLayout();
|
|
|
|
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all');
|
|
|
|
$this->view->lang = $this->getRequest()->getParam('lang');
|
|
|
|
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
|
|
|
|
$this->view->Pays = $this->getRequest()->getParam('Pays');
|
|
|
|
$this->view->CompanyName = $this->getRequest()->getParam('CompanyName');
|
|
|
|
$this->view->action = $this->getRequest()->getParam('action');
|
|
|
|
$this->view->values = $this->getRequest()->getParams();
|
|
|
|
|
|
|
|
if ($this->getRequest()->isPost()) {
|
|
|
|
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
|
|
|
|
$result = $giantController->updatemonitoring($this->getRequest()->getParam('CompanyId'),
|
|
|
|
$this->getRequest()->getParam('InternalOrderId'),
|
|
|
|
$this->getRequest()->getParam('CategoryName'),
|
|
|
|
$this->getRequest()->getParam('EventType'),
|
|
|
|
$this->getRequest()->getParam('StartDate'),
|
|
|
|
$this->getRequest()->getParam('Version'),
|
|
|
|
$this->getRequest()->getParam('LanguageCode'),
|
|
|
|
$this->getRequest()->getParam('Pays'),
|
|
|
|
$this->TestIndication
|
2013-06-17 12:26:12 +00:00
|
|
|
);
|
|
|
|
$this->view->result = $result;
|
|
|
|
}
|
2013-06-18 13:28:22 +00:00
|
|
|
|
2013-06-17 12:26:12 +00:00
|
|
|
}
|
2013-06-20 10:35:49 +00:00
|
|
|
public function retrivemonitoringAction()
|
|
|
|
{
|
|
|
|
$this->view->headScript()->appendFile('/themes/default/scripts/giant_monitoring.js', 'text/javascript');
|
|
|
|
$this->view->CompanyId = $this->getRequest()->getParam('CompanyId');
|
|
|
|
$this->view->Pays = $this->getRequest()->getParam('Pays');
|
|
|
|
$this->view->CompanyName = $this->getRequest()->getParam('CompanyName');
|
|
|
|
$this->view->action = $this->getRequest()->getParam('action');
|
|
|
|
$this->view->values = $this->getRequest()->getParams();
|
|
|
|
|
|
|
|
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
|
|
|
|
$result = $giantController->retrivemonitoring($this->getRequest()->getParam('CompanyId'),
|
|
|
|
$this->getRequest()->getParam('StartFrom'),
|
|
|
|
$this->getRequest()->getParam('InternalOrderId'),
|
|
|
|
$this->getRequest()->getParam('Pays'),
|
2013-06-27 06:03:46 +00:00
|
|
|
$this->TestIndication,
|
2013-07-22 06:28:01 +00:00
|
|
|
$this->getRequest()->getParam('monitor_type'),
|
|
|
|
$this->getRequest()->getParam('CompanyName')
|
2013-06-20 10:35:49 +00:00
|
|
|
);
|
|
|
|
$this->view->result = $result;
|
2013-08-22 13:23:41 +00:00
|
|
|
|
2013-06-20 10:35:49 +00:00
|
|
|
$merged =Array();
|
|
|
|
foreach ($result->MonitoringEvents->MonitoringEvent as $MonitoringEvent):
|
|
|
|
if ($merged[$MonitoringEvent->Company->Event[0]->EventCode]){
|
2013-08-22 13:23:41 +00:00
|
|
|
array_push($merged[$MonitoringEvent->Company->Event[0]->EventCode],$MonitoringEvent) ;
|
2013-06-20 10:35:49 +00:00
|
|
|
} else {
|
2013-08-22 13:23:41 +00:00
|
|
|
$merged[$MonitoringEvent->Company->Event[0]->EventCode][]=$MonitoringEvent;
|
2013-06-20 10:35:49 +00:00
|
|
|
}
|
|
|
|
endforeach;
|
|
|
|
$this->view->val = $merged;
|
|
|
|
}
|
2013-08-20 07:06:30 +00:00
|
|
|
public function retriveAction()
|
|
|
|
{
|
|
|
|
$this->view->headScript()->appendFile('/themes/default/scripts/giant_monitoring.js', 'text/javascript');
|
|
|
|
$giantController = new GiantControllerLib();
|
2013-08-28 14:05:43 +00:00
|
|
|
$auth = Zend_Auth::getInstance();
|
|
|
|
if ( $auth->hasIdentity() ) {
|
|
|
|
$identity = $auth->getIdentity();
|
|
|
|
}
|
|
|
|
$result = $auth->getStorage()->read($identity);
|
|
|
|
if(!empty($result->result->mon_result)){
|
|
|
|
$result = $result->result->mon_result;
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
$result = $giantController->retrive(1,$this->TestIndication,'RetrieveMonitoringEventsForCustomer');
|
|
|
|
$sess = new stdClass();
|
|
|
|
$sess->mon_result = $result;
|
|
|
|
$identity->result = $sess;
|
|
|
|
$auth->getStorage()->write($identity);
|
|
|
|
}
|
2013-08-21 14:01:45 +00:00
|
|
|
$resultDB = $giantController->retrivDB();
|
|
|
|
$this->view->resultDB = $resultDB;
|
2013-08-20 07:06:30 +00:00
|
|
|
$this->view->result = $result;
|
|
|
|
$merged =Array();
|
|
|
|
foreach ($result->MonitoringEvents->MonitoringEvent as $MonitoringEvent):
|
|
|
|
if ($merged[$MonitoringEvent->ProviderOrderId]){
|
|
|
|
array_push($merged[$MonitoringEvent->ProviderOrderId],$MonitoringEvent) ;
|
|
|
|
} else {
|
|
|
|
$merged[$MonitoringEvent->ProviderOrderId][]=$MonitoringEvent;
|
|
|
|
}
|
|
|
|
endforeach;
|
|
|
|
$this->view->val = $merged;
|
2013-08-22 13:23:41 +00:00
|
|
|
|
2013-08-20 07:06:30 +00:00
|
|
|
$merged_siren =Array();
|
|
|
|
foreach ($result->MonitoringEvents->MonitoringEvent as $MonitoringEvent):
|
|
|
|
if ($merged_siren[$MonitoringEvent->Company->CompanyId]){
|
|
|
|
array_push($merged_siren[$MonitoringEvent->Company->CompanyId],$MonitoringEvent) ;
|
|
|
|
} else {
|
|
|
|
$merged_siren[$MonitoringEvent->Company->CompanyId][]=$MonitoringEvent;
|
|
|
|
}
|
|
|
|
endforeach;
|
|
|
|
$this->view->val_siren = $merged_siren;
|
2013-08-27 13:08:07 +00:00
|
|
|
|
2013-08-29 13:28:38 +00:00
|
|
|
|
2013-08-22 13:23:41 +00:00
|
|
|
}
|
|
|
|
public function retAction()
|
|
|
|
{
|
|
|
|
$giantController = new GiantControllerLib();
|
2013-09-02 12:39:30 +00:00
|
|
|
$type = $this->getRequest()->getParam('type');
|
2013-08-22 13:23:41 +00:00
|
|
|
$resultDB = $giantController->retrivDB($this->getRequest()->getParam('date_st'));
|
2013-09-02 12:39:30 +00:00
|
|
|
print_r($resultDB[0][$type]);
|
2013-08-20 07:06:30 +00:00
|
|
|
}
|
2013-08-27 13:08:07 +00:00
|
|
|
public function reteventsAction()
|
|
|
|
{
|
|
|
|
$this->_helper->layout()->disableLayout();
|
2013-09-03 08:14:01 +00:00
|
|
|
$this->view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all');
|
|
|
|
$this->view->headScript()->appendFile('/themes/default/scripts/giant_monitoring.js', 'text/javascript');
|
|
|
|
$this->view->headScript()->appendFile('/themes/default/scripts/giant.js', 'text/javascript');
|
2013-08-27 13:08:07 +00:00
|
|
|
$auth = Zend_Auth::getInstance();
|
|
|
|
$identity = $auth->getIdentity();
|
|
|
|
$result = $auth->getStorage()->read($identity);
|
2013-08-28 14:05:43 +00:00
|
|
|
$result = $result->result->mon_result;
|
2013-09-03 08:14:01 +00:00
|
|
|
$merged_siren = Array();
|
2013-08-28 14:05:43 +00:00
|
|
|
foreach ($result->MonitoringEvents->MonitoringEvent as $MonitoringEvent):
|
|
|
|
if ($merged_siren[$MonitoringEvent->Company->CompanyId]){
|
|
|
|
array_push($merged_siren[$MonitoringEvent->Company->Event[0]->EventCode],$MonitoringEvent) ;
|
|
|
|
} else {
|
|
|
|
$merged_siren[$MonitoringEvent->Company->Event[0]->EventCode][]=$MonitoringEvent;
|
|
|
|
}
|
|
|
|
endforeach;
|
|
|
|
$type = $this->getRequest()->getParam('Type');
|
2013-09-03 08:14:01 +00:00
|
|
|
$id = $this->getRequest()->getParam('Id');
|
|
|
|
|
|
|
|
$merged = Array();
|
|
|
|
foreach ($merged_siren[$type] as $MonitoringEvent):
|
|
|
|
if ($merged[$MonitoringEvent->ProviderOrderId]){
|
|
|
|
array_push($merged[$MonitoringEvent->ProviderOrderId],$MonitoringEvent) ;
|
|
|
|
} else {
|
|
|
|
$merged[$MonitoringEvent->ProviderOrderId][]=$MonitoringEvent;
|
|
|
|
}
|
|
|
|
endforeach;
|
|
|
|
$this->view->result = $merged[$id];
|
2013-08-27 13:08:07 +00:00
|
|
|
}
|
2011-04-15 12:40:29 +00:00
|
|
|
}
|