This commit is contained in:
KONE SOREL 2026-04-16 14:47:41 +00:00
parent b878a88bc8
commit a32a749505
5 changed files with 86 additions and 11 deletions

View File

@ -50,11 +50,21 @@ class ControleurAjaxmouvementassurevalider extends Controleur {
$this->mouvementassure->selectionner_rejet_rh($idMvtTemp, $rejet);
}
public function majobservation()
public function ouvremotif()
{
$idMvtTemp = $this->requete->getParametreFormulaire("idMvtTemp");
$mouvementassure = $this->mouvementassure->getMouvementassureID($idMvtTemp);
$this->genererVueAjax(array('idMvtTemp' => $idMvtTemp, 'mouvementassure' => $mouvementassure));
}
public function savemotif()
{
$idMvtTemp = $this->requete->getParametreFormulaire("idMvtTemp");
$this->genererVueAjax(array('idMvtTemp' => $idMvtTemp));
$motif = $this->requete->getParametreFormulaire("motif");
$this->mouvementassure->enregistrer_motif_rejet_rh($idMvtTemp, $motif);
}
}

View File

@ -45404,7 +45404,7 @@ function selectionner_rejet_rh(idMvtTemp, rejet)
setTimeout(function() {
if((rejet=="1")){
maj_observation_rejet_rh(idMvtTemp);
ouvre_motif_rejet_rh(idMvtTemp);
}
}, 150);
},
@ -45416,14 +45416,14 @@ function selectionner_rejet_rh(idMvtTemp, rejet)
});
}
function maj_observation_rejet_rh(idMvtTemp)
function ouvre_motif_rejet_rh(idMvtTemp)
{
donnees = 'idMvtTemp='+idMvtTemp;
$("#div_patienter").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()+"Ajaxmouvementassurevalider/majobservation/",
url: $("#racineWeb").val()+"Ajaxmouvementassurevalider/ouvremotif/",
type : 'post',
data: donnees,
error: function(errorData){
@ -45438,6 +45438,39 @@ function maj_observation_rejet_rh(idMvtTemp)
},
complete: function() {
}
});
}
function enregistrer_motif_rejet(idMvtTemp)
{
motif = $("#motif").val();
if (motif<=" ")
{
v_msg="Veuillez entrer le motif du rejet !";
v_msgEng="Please enter the reason for rejection!";
alert_ebene(v_msg, v_msgEng);
$("#motif").focus();
return;
}
donnees = 'idMvtTemp='+idMvtTemp+'&motif='+motif;
$.ajax({
url: $("#racineWeb").val()+"Ajaxmouvementassurevalider/savemotif/",
type : 'post',
data: donnees,
error: function(errorData){
alert("Erreur : "+errorData);
},
success: function(data) {
//alert("Success : "+data);
},
complete: function() {
}
});
}

View File

@ -114,4 +114,19 @@ class Mouvementassure extends Modele {
$this->executerRequete($sql, array($idMvtTemp, $rejet));
}
public function enregistrer_motif_rejet_rh($idMvtTemp, $motif)
{
$sql = 'call sp_r_enregistrer_motif_rejet_rh(?, ?)';
$this->executerRequete($sql, array($idMvtTemp, $motif));
}
public function getMouvementassureID($idMvtTemp)
{
$sql = 'call sp_r_get_mouvementassures_rh_id(?)';
$resultat = $this->executerRequete($sql, array($idMvtTemp));
return $resultat->fetch(PDO::FETCH_ASSOC);
}
}

View File

@ -96,7 +96,7 @@
<?php endif; ?>
</td>
<td class="text-center" style="vertical-align: middle;">
<?php if ($choix == '0'): ?>
<?php if ($choix == '0' || $rejet == '1'): ?>
<input type="checkbox" <?= ($rejet == '1') ? 'checked' : '' ?> value="<?= $rejet ?>"
onClick="javascript:this.value=(this.value=='1'?'0':'1');selectionner_rejet_rh(<?= $idMvtTemp ?>, this.value);"
>
@ -105,7 +105,7 @@
<td class="text-center" style="vertical-align: middle;">
<?php if ($rejet == '1'): ?>
<input type="button" value="Obs" onClick='javascript:maj_observation_rejet_rh(<?= $idMvtTemp ?>);'>
<input type="button" value="Obs" onClick='javascript:ouvre_motif_rejet_rh(<?= $idMvtTemp ?>);'>
<?php endif; ?>
</td>
</tr>

View File

@ -1,3 +1,8 @@
<?php
$motif = $mouvementassure['motif'];
$choix = $mouvementassure['choix'];
?>
<div class="modal-dialog" style="width: 70%;" role="document">
<div class="modal-content" style="border-radius: 4px; box-shadow: 0 5px 15px rgba(0,0,0,.5);">
@ -21,29 +26,41 @@
</td>
<td style="border-top: none;">
<div class="form-group" style="margin-bottom: 0;">
<?php if($choix == "1"):?>
<textarea class="form-control"
placeholder="<?= _("Saisie obligatoire...");?>"
placeholder="<?= _("Saisie obligatoire...");?>"
name="motif"
id="motif"
rows="5"
value="<?= $motif; ?>"
rows="7"
required
AUTOCOMPLETE="OFF"
style="width:100%; border-radius: 4px; resize: vertical;"></textarea>
<?php else:?>
<textarea class="form-control"
value="<?= $motif; ?>"
rows="7"
required
disabled
style="width:100%; border-radius: 4px; resize: vertical;"></textarea>
<?php endif;?>
</div>
</td>
</tr>
<?php if($choix == "0"):?>
<tr>
<td style="border-top: none;"> </td>
<td style="border-top: none; padding-top: 15px;">
<button type="button"
class="btn btn-primary"
style="font-weight: bold; padding: 10px 30px;"
onClick="javascript:enregistree_obs_rejet(<?= $idMvtTemp ?>);">
onClick="javascript:enregistrer_motif_rejet(<?= $idMvtTemp ?>);">
<span class="glyphicon glyphicon-save" style="margin-right: 8px;"></span>
<?= _("Enregistrer") ?>
</button>
</td>
</tr>
<?php endif;?>
</tbody>
</table>
</div>