a
This commit is contained in:
parent
02738590e5
commit
3eb66a7d4a
51
Controleur/ControleurAjaxcontextadherent.php
Normal file
51
Controleur/ControleurAjaxcontextadherent.php
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Beneficiaire.php';
|
||||
require_once 'Modele/Adherent.php';
|
||||
require_once 'Modele/Police.php';
|
||||
|
||||
|
||||
class ControleurAjaxcontextadherent extends Controleur {
|
||||
|
||||
private $beneficiaire;
|
||||
private $adherent;
|
||||
private $police;
|
||||
|
||||
public function __construct() {
|
||||
$this->beneficiaire = new Beneficiaire();
|
||||
$this->adherent = new Adherent();
|
||||
$this->police = new Police();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$idBeneficiaire = $this->requete->getParametreFormulaire("idBeneficiaire");
|
||||
|
||||
$this->beneficiaire->getContexteBeneficiaireId($idBeneficiaire);
|
||||
|
||||
$idPolice = $_SESSION['idPolice_C'];
|
||||
$_SESSION['idBeneficiaire_C'] = $idBeneficiaire;
|
||||
|
||||
$this->police->getContextePoliceId($idPolice);
|
||||
|
||||
$this->beneficiaire->getContexteBeneficiaireId($idBeneficiaire);
|
||||
|
||||
|
||||
$idAdherent = $_SESSION['idAdherent_C'];
|
||||
|
||||
$verifieBenRemb = $this->adherent->aBeneficiaireRemboursement($idAdherent);
|
||||
|
||||
if($verifieBenRemb == "0"){
|
||||
$this->adherent->addBeneficiaireRembAuto($idAdherent);
|
||||
}
|
||||
|
||||
$aBeneficiaireRemb = $this->adherent->aBeneficiaireRemboursement($idAdherent);
|
||||
$beneficiaireRemb = $this->adherent->getMandantaireRemboursement($idAdherent);
|
||||
|
||||
$_SESSION['beneficiaireReglement_C'] = is_array($beneficiaireRemb) ? $beneficiaireRemb['beneficiaireReglement'] : $_SESSION['beneficiaire_C'];
|
||||
$_SESSION['beneficiaireLienParente_C'] = is_array($beneficiaireRemb) ? $beneficiaireRemb['codeLienBeneficiaire'] : $_SESSION['codeLienParente_C'];
|
||||
$_SESSION['codeModePaiement_C'] = $beneficiaireRemb['codeModePaiement'];
|
||||
$_SESSION['rib_C'] = $beneficiaireRemb['rib'];
|
||||
|
||||
$this->genererVueAjax(array('aBeneficiaireRemb' => $aBeneficiaireRemb, 'beneficiaireRemb' => $beneficiaireRemb));
|
||||
}
|
||||
}
|
||||
33
Controleur/ControleurAjaxcontextbeneficiaire.php
Normal file
33
Controleur/ControleurAjaxcontextbeneficiaire.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Finger.php';
|
||||
|
||||
class ControleurAjaxcontextbeneficiaire extends Controleur {
|
||||
private $finger;
|
||||
|
||||
public function __construct() {
|
||||
$this->finger = new Finger();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$idBeneficiaire = $this->requete->getParametre("idBeneficiaire");
|
||||
|
||||
if ($idBeneficiaire == $_SESSION['p_idBeneficiaire_sav'])
|
||||
{
|
||||
$_SESSION['p_okId'] = $this->requete->getParametre("okId");
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['p_okId'] = "-1";
|
||||
}
|
||||
$_SESSION['p_idBeneficiaire_C'] = $idBeneficiaire;
|
||||
$_SESSION['p_idBeneficiaire_sav'] = $_SESSION['p_idBeneficiaire_C'];
|
||||
}
|
||||
|
||||
public function saveenroleur()
|
||||
{
|
||||
$user_id = $this->requete->getParametreFormulaire("user_id");
|
||||
$this->finger->saveenroleur($user_id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -45627,12 +45627,10 @@ function valider_reponse_demande_rd()
|
|||
error: function(errorData) {
|
||||
},
|
||||
success: function(data) {
|
||||
// alert(data);
|
||||
|
||||
|
||||
$('#div_test_gabarit').html(data);
|
||||
alert(data);
|
||||
},
|
||||
complete: function() {
|
||||
|
||||
if(codeEtatDemandeRemboursement=="1"){
|
||||
ajax_context_adherent(idBeneficiaire);
|
||||
}else{
|
||||
|
|
@ -45651,7 +45649,6 @@ function valider_reponse_demande_rd()
|
|||
|
||||
function creer_dossier_demande_rd()
|
||||
{
|
||||
|
||||
idBeneficiaire = $("#idBeneficiaire").val();
|
||||
|
||||
v_msg="Confirmez-vous la création du dossier de remboursement ?";
|
||||
|
|
@ -45667,4 +45664,57 @@ function creer_dossier_demande_rd()
|
|||
console.log("Confirmation refusée");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function ajax_context_adherent(idBeneficiaire)
|
||||
{
|
||||
if (idBeneficiaire=="0")
|
||||
{
|
||||
v_msg="Veuillez sélectionner un assuré!";
|
||||
v_msgEng="Please select one person!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
donnees = "idBeneficiaire="+idBeneficiaire;
|
||||
donnees_retour = "";
|
||||
|
||||
$("#div_attente").html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
||||
|
||||
$.ajax({
|
||||
url: $("#racineWeb").val()+"Ajaxcontextadherent/",
|
||||
type : 'post',
|
||||
data: donnees,
|
||||
success: function(data)
|
||||
{
|
||||
|
||||
//$("#div_ajaxgabarit").html(data);
|
||||
|
||||
$("#div_context_adherent").html(data);
|
||||
|
||||
//$("#div_attente").html('');
|
||||
|
||||
var aBeneficiaireRemb = $("#aBeneficiaireRemb").val();
|
||||
//var idAdherent = $("#idAdherent").val();
|
||||
|
||||
if(aBeneficiaireRemb > "0")
|
||||
{
|
||||
window.location.assign($("#racineWeb" ).val()+"Creerdossierclassique/");
|
||||
|
||||
}else{
|
||||
v_msg="Aucun bénéficiaire de remboursement n'est enregistré pour cet assuré!";
|
||||
v_msgEng="No reimbursement beneficiary is registered for this insured";
|
||||
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
return;
|
||||
}
|
||||
},
|
||||
error: function(errorData) {
|
||||
},
|
||||
complete: function() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
1
Vue/Ajaxcontextadherent/index.php
Normal file
1
Vue/Ajaxcontextadherent/index.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<input class="sr-only" id="aBeneficiaireRemb" name="aBeneficiaireRemb" type="text" value="<?= $aBeneficiaireRemb ;?>" >
|
||||
|
|
@ -35,6 +35,8 @@
|
|||
|
||||
<legend> <?= _("Demande de remboursement direct") ?> </legend>
|
||||
|
||||
<INPUT TYPE="text" value="<?= $idBeneficiaire ?>">
|
||||
|
||||
<INPUT class="sr-only" TYPE="text" id="idDemandeRemboursement" NAME="idDemandeRemboursement" value="<?= $idDemandeRemboursement ?>">
|
||||
<INPUT class="sr-only" TYPE="text" id="idAdherent" NAME="idAdherent" value="<?= $idAdherent ?>">
|
||||
<INPUT class="sr-only" TYPE="text" id="idBeneficiaire" NAME="idBeneficiaire" value="<?= $idBeneficiaire ?>">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user