a
This commit is contained in:
parent
45445b09fc
commit
91740025be
32
Controleur/ControleurAjaxcontroleavenantpolice.php
Normal file
32
Controleur/ControleurAjaxcontroleavenantpolice.php
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
require_once 'Framework/Controleur.php';
|
||||||
|
require_once 'Modele/Police.php';
|
||||||
|
|
||||||
|
class ControleurAjaxcontroleavenantpolice extends Controleur {
|
||||||
|
private $police;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->police = new Police();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$controler_avenant_info = "0";
|
||||||
|
|
||||||
|
$idPolice = $_SESSION['idPolice_C'];
|
||||||
|
|
||||||
|
$controle = $this->requete->getParametreFormulaire("controle");
|
||||||
|
|
||||||
|
if($controle=="existequittance")
|
||||||
|
{
|
||||||
|
$controler_avenant_info = $this->police->getExisteQuittance($idPolice);
|
||||||
|
|
||||||
|
if($controler_avenant_info=="0")
|
||||||
|
{
|
||||||
|
$controler_avenant_info = $this->police->getExisteConsommationPolice($idPolice);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->genererVueAjax(array('controler_avenant_info' => $controler_avenant_info));
|
||||||
|
}
|
||||||
|
}
|
||||||
145
Js/fonctions.js
145
Js/fonctions.js
|
|
@ -1377,9 +1377,6 @@ function creer_avenant()
|
||||||
|
|
||||||
function enregistrer_avenant()
|
function enregistrer_avenant()
|
||||||
{
|
{
|
||||||
alert("enregistrer_avenant");
|
|
||||||
return;
|
|
||||||
|
|
||||||
codeTypeAvenant=$("#codeTypeAvenant").val();
|
codeTypeAvenant=$("#codeTypeAvenant").val();
|
||||||
oldCodeTypeAvenant=$("#oldCodeTypeAvenant").val();
|
oldCodeTypeAvenant=$("#oldCodeTypeAvenant").val();
|
||||||
|
|
||||||
|
|
@ -1419,71 +1416,16 @@ function enregistrer_avenant()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(codeTypeAvenant=="REN")
|
motifavenant=$("#motifavenant").val();
|
||||||
{
|
|
||||||
var td1 = new Date($("#DateRenouvellement").val());
|
|
||||||
var td2 = $("#dateAvenant").datepicker("getDate");
|
|
||||||
|
|
||||||
dt1=Math.round(Date.parse(td1)/(1000*3600*24));
|
if ($("#motifavenant").val()<" ")
|
||||||
dt2=Math.round(Date.parse(td2)/(1000*3600*24));
|
{
|
||||||
|
v_msg="Veuillez fournir le motif!";
|
||||||
|
v_msgEng="Please provide the reason";
|
||||||
|
alert_ebene(v_msg, v_msgEng);
|
||||||
|
|
||||||
if (dt1>dt2)
|
return;
|
||||||
{
|
}
|
||||||
v_msg="Veuillez revoir la date de renouvellement!";
|
|
||||||
v_msgEng="Please review the renewal date!";
|
|
||||||
alert_ebene(v_msg, v_msgEng);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var eff = $("#dateAvenant").datepicker("getDate");
|
|
||||||
var ech = $("#dateEcheanceRen").datepicker("getDate");
|
|
||||||
|
|
||||||
if (ech>eff.addMonths(12)) {
|
|
||||||
v_msg="Période supérieur à un an!";
|
|
||||||
v_msgEng="Period greater than one year!";
|
|
||||||
alert_ebene(v_msg, v_msgEng);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(codeTypeAvenant=="CHE" && oldCodeTypeAvenant=="REN")
|
|
||||||
{
|
|
||||||
var td1 = new Date($("#dateEffet").val());
|
|
||||||
var td2 = $("#dateAvenant").datepicker("getDate");
|
|
||||||
|
|
||||||
dt1=Math.round(Date.parse(td1)/(1000*3600*24));
|
|
||||||
dt2=Math.round(Date.parse(td2)/(1000*3600*24));
|
|
||||||
|
|
||||||
if (dt1>dt2)
|
|
||||||
{
|
|
||||||
v_msg="Veuillez revoir la date!";
|
|
||||||
v_msgEng="Please review the date!";
|
|
||||||
alert_ebene(v_msg, v_msgEng);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
codeTypeAvenant=="RET" ||
|
|
||||||
codeTypeAvenant=="RES" ||
|
|
||||||
codeTypeAvenant=="SUS" ||
|
|
||||||
codeTypeAvenant=="ANL"||
|
|
||||||
codeTypeAvenant=="RVP"||
|
|
||||||
codeTypeAvenant=="ADL"||
|
|
||||||
codeTypeAvenant=="CHE")
|
|
||||||
{
|
|
||||||
motifavenant=$("#motifavenant").val();
|
|
||||||
|
|
||||||
if ($("#motifavenant").val()<" ")
|
|
||||||
{
|
|
||||||
v_msg="Veuillez fournir le motif!";
|
|
||||||
v_msgEng="Please provide the reason";
|
|
||||||
alert_ebene(v_msg, v_msgEng);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
v_msg="Confirmez-vous cet avenant?";
|
v_msg="Confirmez-vous cet avenant?";
|
||||||
v_msgEng="Do you confirm this amendment to the contract?";
|
v_msgEng="Do you confirm this amendment to the contract?";
|
||||||
|
|
@ -1492,75 +1434,6 @@ function enregistrer_avenant()
|
||||||
{
|
{
|
||||||
var div_attente = $('#div_attente');
|
var div_attente = $('#div_attente');
|
||||||
div_attente.html('<div style="padding-top:80px;"><img src="Bootstrap/images/loading.gif"/> <span style="font-size:15pt;">' + 'Chargement en cours! Veuillez patienter...' + '</span></div>');
|
div_attente.html('<div style="padding-top:80px;"><img src="Bootstrap/images/loading.gif"/> <span style="font-size:15pt;">' + 'Chargement en cours! Veuillez patienter...' + '</span></div>');
|
||||||
|
$("#btn_enreg").click();
|
||||||
codeTypeAvenant=$("#codeTypeAvenant").val();
|
|
||||||
|
|
||||||
donnees = "";
|
|
||||||
|
|
||||||
if (codeTypeAvenant=="ANL")
|
|
||||||
{
|
|
||||||
donnees = "controle=existequittance";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(donnees>" ")
|
|
||||||
{
|
|
||||||
$.ajax({
|
|
||||||
url: $("#racineWeb").val()+"Ajaxcontroleavenantpolice/",
|
|
||||||
type : 'post',
|
|
||||||
data: donnees,
|
|
||||||
error: function(errorData) {
|
|
||||||
},
|
|
||||||
success: function(data) {
|
|
||||||
alert(data);
|
|
||||||
$("#div_controler_avenant").html(data);
|
|
||||||
},
|
|
||||||
complete: function() {
|
|
||||||
$("#controler_avenant").val($("#controler_avenant_info").val());
|
|
||||||
|
|
||||||
resultat_controler_avenant = $("#controler_avenant").val();
|
|
||||||
|
|
||||||
if (resultat_controler_avenant=="Q")
|
|
||||||
{
|
|
||||||
v_msg="Attention, cette police possède des quittances!";
|
|
||||||
v_msgEng="Warning, this policy has premium issues!";
|
|
||||||
alert_ebene(v_msg, v_msgEng);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (resultat_controler_avenant=="C")
|
|
||||||
{
|
|
||||||
v_msg="Attention, cette police possède des sinistres!";
|
|
||||||
v_msgEng="Warning, this policy has claims!";
|
|
||||||
alert_ebene(v_msg, v_msgEng);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (codeTypeAvenant=="ADL")
|
|
||||||
{
|
|
||||||
donnees = "dateAvenant="+$("#dateAvenant").val()+"&motifavenant="+motifavenant;
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
url: $("#racineWeb").val()+"Ajaxlimiteadditionnelle/",
|
|
||||||
type : 'post',
|
|
||||||
data: donnees,
|
|
||||||
error: function(errorData) {
|
|
||||||
},
|
|
||||||
success: function(data) {
|
|
||||||
},
|
|
||||||
complete: function() {
|
|
||||||
$("#btn_enreg").click();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$("#btn_enreg").click();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user