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(); $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(); $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(); $giantFunction = new GiantFunction(); 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()); $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) $this->view->soap = $ListeRapport->soapG; } public function creditrecommendationAction() { $giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId')); $id = $giantController->commande($this->getRequest()->getParam('CompanyId'), $this->getRequest()->getParam('Type'), $this->getRequest()->getParam('Pays'), $this->TestIndication ); $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); } } $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'); $this->view->dateFunction = new WDate(); } public function compactAction() { $giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId')); $id = $giantController->commande($this->getRequest()->getParam('CompanyId'), $this->getRequest()->getParam('Type'), $this->getRequest()->getParam('Pays'), $this->TestIndication ); $compactAction = array('getAvisDeCredit' => 'CreditRecommendation', 'getPositionFinanciere' => 'FinancialSummary', 'getStructureEntreprise' => 'Associated', 'getDirigeant' => 'Position' ); $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); } } $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'); $this->view->dateFunction = new WDate(); } public function fullAction() { $giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId').'-'.$this->getRequest()->getParam('Type')); $id = $giantController->commande($this->getRequest()->getParam('CompanyId'), $this->getRequest()->getParam('Type'), $this->getRequest()->getParam('Pays'), $this->TestIndication ); $fullAction = array('getAvisDeCredit' => 'CreditRecommendation', 'getComptesAnnuels' => 'AnnualAccounts', 'getPositionFinanciere' => 'FinancialSummary', 'getComportementPaiement' => 'PaymentBehaviour', 'getStructureEntreprise' => 'Associated', 'getDirigeant' => 'Position', 'getComparaisonValeurs'=> 'PeerGroup', 'getHistoriques' => 'Event' ); $full = unserialize(base64_decode($id)); $full->DataSet->Company->CompanyId= $this->getRequest()->getParam('CompanyId'); $identiteController = new GiantIdentiteController($full); $giantConstroller = new GiantControllerLib($this->getRequest()->getParam('CompanyId').'-'.$this->getRequest()->getParam('Type')); $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); $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'); $this->view->dateFunction = new WDate(); } public function getForm() { $form = new Zend_Form(); $form->setMethod('post') ->setAction('investigation'); $reference = $form->createElement('text', 'reference', array('label' => 'Votre Reference')); $reference->setRequired(true); $elements[] = $reference; $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); } public function investigationAction() { 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(); } }