view->headLink()->appendStylesheet('/themes/default/styles/giant.css', 'all'); $this->view->headScript()->appendFile('/themes/default/scripts/giant.js', 'text/javascript'); $this->view->debug = false; } public function searchAction() { $user = new Utilisateur(); $rechercheParams = new RechercheHistorique(); if (count($rechercheParams->liste()) > 0) { $recherche = $rechercheParams->item(0); $type = $recherche['type']; $params = $recherche['params']; } $search = new GiantRechercheController($params['pays'], $this->TestIndication); $result = $search->Liste($params, $this->getRequest()->getParam('page')); $this->view->label = $search->getObjet()->getLabelDesc(); $this->view->labelResults = $search->getObjet()->getLabelResults; $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; } public function identiteAction() { $rechercheParams = new RechercheHistorique(); if (count($rechercheParams->liste()) > 0) { $recherche = $rechercheParams->item(0); $type = $recherche['type']; $params = $recherche['params']; } $Commande = new Commandes(); $Utilisateur = new Utilisateur(); $listeCommandes = $Commande->getCommandesByLogin($Utilisateur->getLogin()); $i = 1; $liste .= 'Liste de vos commandes :

'; $ListeRapport = new GiantRechercheController($params['pays'], $this->TestIndication); $result = $ListeRapport->ListeRapport($this->getRequest()->getParam('CompanyId')); ChromePhp::log($result); $this->view->total = $total; $this->view->listeCommandes = $liste; $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'); $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) $this->view->soap = $ListeRapport->soapG; } public function commandesAction() { $Utilisateur = new Utilisateur(); $Commande = new Commandes(); $Rapport = new Rapports($this->getRequest()->getParam('Pays'), $this->TestIndication); $CommandeP = new stdClass(); $id = $Rapport->getRapportExist($this->getRequest()->getParam('CompanyId'), $this->getRequest()->getParam('Type')); if(empty($id)) { $rapport = new GiantRechercheController($this->getRequest()->getParam('Pays'), $this->TestIndication); $result = $rapport->GetRapport($this->getRequest()->getParam('CompanyId'), $this->getRequest()->getParam('Type')); $result = base64_encode(serialize($result)); $id = $Rapport->setReport($this->getRequest()->getParam('CompanyId'), $this->getRequest()->getParam('Type'), $this->getRequest()->getParam('Pays'), $result); } $CommandeP->login = $Utilisateur->getLogin(); $CommandeP->date = date("Y-m-d"); $CommandeP->typeReport = GiantFunction::getTypeReport($this->getRequest()->getParam('Type')); $CommandeP->price = 150; $CommandeP->rapportId = 1; $CommandeP->pays = 'fr'; if(!$Commande->getCommandeExistToday($CommandeP->login, $CommandeP->date, $CommandeP->rapportId, $CommandeP->typeReport)) { $Commande->setCommandes($CommandeP); } $this->_forward('rapport', 'giant', null, array('idRapport' => $id)); } public function rapportAction() { $request = $this->getRequest(); $result = unserialize(base64_decode($request->getParam('idRapport'))); $rechercheParams = new RechercheHistorique(); if (count($rechercheParams->liste()) > 0) { $recherche = $rechercheParams->item(0); $type = $recherche['type']; $params = $recherche['params']; } $result = $identiteController = new GiantIdentiteController($result); $identiteController->ficheAction(); $fiche = $identiteController->getObjet('fiche'); $fiche['Vat'] = $fiche['Vat']->VatNumber; $fiche['CompanyName'] = $fiche['CompanyName']->_; $fiche['CompanyAddress'] = $fiche['CompanyAddress']->HouseNumber.' '.$fiche['CompanyAddress']->Street.'
'.$fiche['CompanyAddress']->PostCode.' '.$fiche['CompanyAddress']->City; $fiche['TelephoneNumber'] = $fiche['TelephoneNumber']->_; $fiche['IncorporationDate'] = WDate::dateT($fiche['IncorporationDate']->format, 'd/m/Y', $fiche['IncorporationDate']->_); $fiche['UnifiedLegalForm'] = $fiche['LegalForm']->UnifiedLegalForm; $fiche['LegalForm'] = $fiche['LegalForm']->CountryLegalForm->_; $fiche['WebAddress'] = ''.$fiche['WebAddress'].''; $fiche['EmailAddress'] = ''.$fiche['EmailAddress'].''; $fiche['ValideNumber'] = GiantFunction::checkVat(substr($fiche['Vat'], 2), $request->getParam('Pays')); $this->view->rapport = $result; $this->view->rapportType = $this->getRequest()->getParam('Type'); $this->view->fiche = $fiche; } }