Testé avec a7e.bigmac loggué methode bp

This commit is contained in:
Claire DELBOS 2017-03-01 17:21:25 +01:00
parent 1a538ed012
commit 3b08476a4f
2 changed files with 42 additions and 5 deletions

View File

@ -58,18 +58,25 @@ class Achatclient_IndexController extends Zend_Controller_Action
} catch(Exception $e) {
$this->error('index','Pas de crédit');
}
if($infocredit===false){
$this->error('index','Service indisponible');
}
if ($infocredit === false || empty($infocredit)) {
$this->error('index','Compte indisponible');
$this->forward('soap', 'error');
$this->error('index','Accès au Service indisponible');
}
if(!isset($this->tranches[$user->getIdClient()])){
$this->error('index','Fonction indisponible pour ce client');
}
}
$infos=array('user' => $user,'tranches' => $this->tranches[$user->getIdClient()]);
$infos['balance']=array('balance'=>0);
//$infos['balance']=array('balance'=>0);
if(!isset($infocredit->balance)){
$infos['balance']['balance']=0;
}else{
foreach($infocredit->balance as $k => $v){
$infos['balance'][$v->key]=$v->value;
}
}
if(intval($infos['balance']['balance'])>$this->maxcredit){
$this->view->msg='Vous détenez le plafond de crédits autorisé.';
unset($infos['tranches']);
@ -180,13 +187,21 @@ class Achatclient_IndexController extends Zend_Controller_Action
$this->view->msg='Annulation de votre transaction';
}
}
public function errorAction(){
$request = $this->getRequest();
$this->view->msg=$request->getParam('message');
}
private function error($ligne=0,$message=""){
$request = $this->getRequest();
switch($ligne){
case "index":
case "paiement":
$this->redirect("http://".$request->getHttpHost()."/achatclient/index/error?message=".$message);
break;
case "paiement":
$this->redirect("http://".$request->getHttpHost()."/achatclient/?message=".$message);
break;
default:

View File

@ -0,0 +1,22 @@
<style>
div .credit{
margin-left:25px;
}
td.nbr{
text-align:right;
}
#message{
color:red;
font-size:14px;
}
</style>
<div id="center">
<h1>Votre compte crédits en ligne</h1>
<h2>Résumé de vos crédits</h2>
<div class="credit">
<div id="message"><?=$this->msg?></div>
</div>
</div>