This commit is contained in:
Claire DELBOS 2017-04-14 16:59:12 +02:00
parent 4d4df8e6cd
commit 12bd937a6c
2 changed files with 14 additions and 5 deletions

View File

@ -2908,6 +2908,9 @@ class SaisieController extends Zend_Controller_Action
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$request = $this->getRequest(); $request = $this->getRequest();
$siren = $request->getParam('siren', null); $siren = $request->getParam('siren', null);
if(empty($siren)){
throw(new Exception('Parametres errones'));
}
$mode = $request->getParam('mode'); $mode = $request->getParam('mode');
$guichetMod = $request->getParam('guichetMod'); $guichetMod = $request->getParam('guichetMod');
$banqueMod = $request->getParam('banqueMod'); $banqueMod = $request->getParam('banqueMod');
@ -2923,7 +2926,11 @@ class SaisieController extends Zend_Controller_Action
$ws = new Scores_Ws_Client('saisie', '0.2'); $ws = new Scores_Ws_Client('saisie', '0.2');
$result = $ws->getRib($params); $result = $ws->getRib($params);
} }
$this->view->assign('oldvals', json_encode($result)); $tab=(array)json_decode($result);
$oldvals=implode('####',$tab);
//$olddvals->siren=$siren;
//var_dump($oldvals);die;
$this->view->assign('oldvals', urlencode($result));
$this->view->assign('siren', $siren); $this->view->assign('siren', $siren);
$this->view->assign('mode', $mode); $this->view->assign('mode', $mode);
$this->view->assign('banques', $result); $this->view->assign('banques', $result);
@ -2937,6 +2944,7 @@ class SaisieController extends Zend_Controller_Action
public function ribansaveAction(){ public function ribansaveAction(){
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$request = $this->getRequest(); $request = $this->getRequest();
//var_dump($request->getParams());die;
$params= new stdClass(); $params= new stdClass();
$values=array( $values=array(
'siren' => str_replace(' ', '',$request->getParam('siren')), 'siren' => str_replace(' ', '',$request->getParam('siren')),
@ -2945,17 +2953,18 @@ class SaisieController extends Zend_Controller_Action
'numCompte' => str_replace(' ', '',$request->getParam('num_compte')), 'numCompte' => str_replace(' ', '',$request->getParam('num_compte')),
'bic' => str_replace(' ', '',$request->getParam('bic_swift')), 'bic' => str_replace(' ', '',$request->getParam('bic_swift')),
'iban' => str_replace(' ', '',$request->getParam('iban')), 'iban' => str_replace(' ', '',$request->getParam('iban')),
'oldvals' => $request->getParam('oldvals'), 'oldvals' => urldecode($request->getParam('oldvals')),
'mode' => $request->getParam('mode'), 'mode' => $request->getParam('mode'),
); );
$params->infos=json_encode($values); $params->infos=json_encode($values);
//echo $values['oldvals'];die;
$ws = new Scores_Ws_Client('saisie', '0.2'); $ws = new Scores_Ws_Client('saisie', '0.2');
$result = $ws->setRib($params); $result = $ws->setRib($params);
if($result){ if($result==true or $result==1){
echo 'Opération enregistrée'; echo 'Opération enregistrée';
}else { }else {
echo 'Opération échouée '; echo 'Opération non enregistrée '.$result;
} }
die; die;
} }

View File

@ -16,7 +16,7 @@ $lbanque = (array)json_decode($this->banques);
<form name="saveRiban" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'ribansave'),null, true)?>" method="post"> <form name="saveRiban" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'ribansave'),null, true)?>" method="post">
<input type="hidden" name="mode" value="<?=$this->mode?>" /> <input type="hidden" name="mode" value="<?=$this->mode?>" />
<input type="hidden" name="siren" value="<?=$this->siren?>" /> <input type="hidden" name="siren" value="<?=$this->siren?>" />
<input type="hidden" name="oldvals value="<?=$this->oldvals?>" /> <input type="hidden" name="oldvals" value="<?=$this->oldvals?>" />
<?php if($this->mode == 'add' || $this->mode == 'edit'){?> <?php if($this->mode == 'add' || $this->mode == 'edit'){?>
<div class="fieldgrp"> <div class="fieldgrp">
<label>Siren</label> <label>Siren</label>