From 4066f127632b5e98cff09fded72cf621b7ec28b6 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 12 Nov 2013 10:51:38 +0000 Subject: [PATCH] Montant, Bootstrap v3.0.2 --- application/configs/application.ini | 2 + application/controllers/ReportController.php | 23 +++++--- application/views/scripts/report/cmd.phtml | 28 +--------- .../views/scripts/report/deliver.phtml | 26 +-------- application/views/scripts/report/footer.phtml | 10 ++++ application/views/scripts/report/header.phtml | 14 +++++ application/views/scripts/report/index.phtml | 56 ++++++++----------- .../views/scripts/report/paiement.phtml | 28 +--------- application/views/scripts/report/retour.phtml | 26 +-------- library/Paybox/System.php | 26 ++++++++- 10 files changed, 99 insertions(+), 140 deletions(-) create mode 100644 application/views/scripts/report/footer.phtml create mode 100644 application/views/scripts/report/header.phtml diff --git a/application/configs/application.ini b/application/configs/application.ini index 4e39073..39eeae9 100644 --- a/application/configs/application.ini +++ b/application/configs/application.ini @@ -37,6 +37,8 @@ profil.db.sdv1.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8" profil.report.username=partner144 profil.report.password=yY2Uhp0mf5 +profil.report.montant = 21.53 + [staging : production] resources.frontController.params.displayExceptions = 1 diff --git a/application/controllers/ReportController.php b/application/controllers/ReportController.php index 0357f30..9bba8a5 100644 --- a/application/controllers/ReportController.php +++ b/application/controllers/ReportController.php @@ -33,9 +33,11 @@ class ReportController extends Zend_Controller_Action if (intval($siren)>100) { //Vérifier que le SIREN existe en base require_once 'Scores/WsScores.php'; + $c = Zend_Registry::get('config'); $login = $c->profil->report->username; $password = $c->profil->report->password; + $ws = new WsScores($login, $password); $response = $ws->getIdentiteLight($siren); if ($response !== false) { @@ -52,6 +54,8 @@ class ReportController extends Zend_Controller_Action 'siren'=>$response->Siren )); + $this->view->montant = $c->profil->report->montant . " €"; + //Session $session->CmdSiren = $response->Siren; $session->CmdRaisonSociale = $response->Nom; @@ -157,11 +161,15 @@ class ReportController extends Zend_Controller_Action if ( !isset($session->CmdID) || empty($session->CmdID) ) { + $c = Zend_Registry::get('config'); + $this->view->montant = $c->profil->report->montant . " €"; + //Get the report if (intval($siren)>100) { - //$report = new Scores_Partner_Report('indiscore3', $siren, 'mricois', 'ju2loh6o'); - //$html = $report->getContent(); - $html = 'blabla'; + $login = $c->profil->report->username; + $password = $c->profil->report->password; + $report = new Scores_Partner_Report('indiscore3', $siren, $login, $password); + $html = $report->getContent(); if ( $html !== false ) { $c = Zend_Registry::get('config'); @@ -239,17 +247,18 @@ class ReportController extends Zend_Controller_Action $row = $commandM->fetchRow('cmdId="'.$cmdId.'"'); if ($row !== null) { - //Paybox : Liste des types de paiements possible + $c = Zend_Registry::get('config'); + $this->view->montant = $c->profil->report->montant . " €"; + + //Paybox $paybox = new Paybox_System(); $paybox->setUrlPaiement(); $paybox->setEmail($row->email); $paybox->setReference($cmdId); - $paybox->setMontant(10.00); + $paybox->setMontant($c->profil->report->montant); $paybox->setUrlParameters(); $paybox->calculateHMAC(); - //@todo : Set PBX_EFFECTUE, PBX_REFUSE, PBX_ANNULE, PBX_ATTENTE, PBX_REPONDRE_A - $this->view->PayboxUrl = $paybox->getFormUrl(); $this->view->PayboxValues = $paybox->getFormParameters(); diff --git a/application/views/scripts/report/cmd.phtml b/application/views/scripts/report/cmd.phtml index 26c9636..694f112 100644 --- a/application/views/scripts/report/cmd.phtml +++ b/application/views/scripts/report/cmd.phtml @@ -1,17 +1,4 @@ - - - - - - -Kompass - Achat Bilan Financier - - - - - - -
+render('report/header.phtml')?> @@ -172,13 +159,4 @@ - - - -
- - inlineScript(); ?> - - \ No newline at end of file +render('report/footer.phtml')?> \ No newline at end of file diff --git a/application/views/scripts/report/deliver.phtml b/application/views/scripts/report/deliver.phtml index 4aa0f7f..e83daae 100644 --- a/application/views/scripts/report/deliver.phtml +++ b/application/views/scripts/report/deliver.phtml @@ -1,17 +1,4 @@ - - - - - - -Kompass - Achat Bilan Financier - - - - - - -
+render('report/header.phtml')?>
- - - - - - inlineScript(); ?> - - \ No newline at end of file +render('report/footer.phtml')?> \ No newline at end of file diff --git a/application/views/scripts/report/footer.phtml b/application/views/scripts/report/footer.phtml new file mode 100644 index 0000000..ba50fb1 --- /dev/null +++ b/application/views/scripts/report/footer.phtml @@ -0,0 +1,10 @@ + + + + + + inlineScript(); ?> + + \ No newline at end of file diff --git a/application/views/scripts/report/header.phtml b/application/views/scripts/report/header.phtml new file mode 100644 index 0000000..2adf076 --- /dev/null +++ b/application/views/scripts/report/header.phtml @@ -0,0 +1,14 @@ + + + + + + +Kompass - Achat Bilan Financier + + + + + + +
\ No newline at end of file diff --git a/application/views/scripts/report/index.phtml b/application/views/scripts/report/index.phtml index de24e59..a2ec323 100644 --- a/application/views/scripts/report/index.phtml +++ b/application/views/scripts/report/index.phtml @@ -1,17 +1,4 @@ - - - - - - -Kompass - Achat Bilan Financier - - - - - - -
+render('report/header.phtml')?>