fav
This commit is contained in:
parent
5c930f2151
commit
56911b2589
20
Controleur/ControleurAjaxlisterpolicesclient.php
Normal file
20
Controleur/ControleurAjaxlisterpolicesclient.php
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
require_once 'Framework/Controleur.php';
|
||||||
|
require_once 'Modele/Police.php';
|
||||||
|
|
||||||
|
class ControleurAjaxlisterpolicesclient extends Controleur {
|
||||||
|
private $police;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->police = new Police();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$vue = $this->requete->getParametreFormulaire("vue");
|
||||||
|
$polices = $this->police->getPoliceRh();
|
||||||
|
|
||||||
|
$this->genererVueAjax(array('vue' => $vue, 'polices' => $polices));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4129,4 +4129,89 @@ function consulterfactureged_pop()
|
||||||
complete: function() {
|
complete: function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function lister_polices_client(id) {
|
||||||
|
const vues = {
|
||||||
|
1: "Rechercherassure",
|
||||||
|
2: "Syntheseconsopolice",
|
||||||
|
3: "Sppolice"
|
||||||
|
};
|
||||||
|
|
||||||
|
vue = vues[id] || null; // null si id ne correspond à rien
|
||||||
|
|
||||||
|
const modalEl = document.getElementById('pop_police');
|
||||||
|
|
||||||
|
// On déplace le modal directement sous <body> s'il n'y est pas déjà.
|
||||||
|
// Cela permet de passer outre les z-index des conteneurs parents (Sidebar, Header).
|
||||||
|
if (modalEl.parentElement !== document.body) {
|
||||||
|
document.body.appendChild(modalEl);
|
||||||
|
}
|
||||||
|
|
||||||
|
const racine = $("#racineWeb").val() || "/";
|
||||||
|
const divPolice = document.getElementById('div_police');
|
||||||
|
|
||||||
|
/* ===================================================
|
||||||
|
* Préparation visuelle (Spinner)
|
||||||
|
* =================================================== */
|
||||||
|
showLoader("#div_police", { size: 3 });
|
||||||
|
|
||||||
|
|
||||||
|
/* ===================================================
|
||||||
|
* Initialisation de l'instance Bootstrap
|
||||||
|
* =================================================== */
|
||||||
|
const modal = bootstrap.Modal.getOrCreateInstance(modalEl, {
|
||||||
|
backdrop: 'static',
|
||||||
|
keyboard: false
|
||||||
|
});
|
||||||
|
|
||||||
|
/* ===================================================
|
||||||
|
* Gestion de l'événement d'affichage et AJAX
|
||||||
|
* =================================================== */
|
||||||
|
// On utilise 'shown.bs.modal' pour lancer l'AJAX une fois le modal visible
|
||||||
|
$(modalEl).one('shown.bs.modal', function () {
|
||||||
|
$.ajax({
|
||||||
|
url: racine + "Ajaxlisterpolicesclient/",
|
||||||
|
type: 'POST',
|
||||||
|
data: { vue: vue },
|
||||||
|
success: function (data) {
|
||||||
|
divPolice.innerHTML = data;
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
divPolice.innerHTML = `
|
||||||
|
<div class="alert alert-danger m-3 shadow-sm">
|
||||||
|
<strong>Erreur :</strong> Impossible de générer la liste des polices.
|
||||||
|
<small class="d-block text-muted mt-1">${error}</small>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
/* ===================================================
|
||||||
|
* 6. Affichage final
|
||||||
|
* =================================================== */
|
||||||
|
modal.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
function ajax_contexter_police(){
|
||||||
|
idPolice = $("#idPolice").val();
|
||||||
|
|
||||||
|
donnees = 'idPolice='+idPolice;
|
||||||
|
$.ajax({
|
||||||
|
url: $("#racineWeb").val()+"Ajaxcontextpolice/",
|
||||||
|
type : 'post',
|
||||||
|
data: donnees,
|
||||||
|
error: function(errorData) {
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function ouvrir_vue(vue)
|
||||||
|
{
|
||||||
|
window.location.assign($("#racineWeb" ).val()+vue+"/");
|
||||||
}
|
}
|
||||||
63
Vue/Ajaxlisterpolicesclient/index.php
Normal file
63
Vue/Ajaxlisterpolicesclient/index.php
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
|
||||||
|
<div id="div_police" class="p-3 bg-white rounded shadow-sm border">
|
||||||
|
<div class="row g-3 align-items-end">
|
||||||
|
<div class="col-md-7">
|
||||||
|
<label for="idPolice" class="form-label extra-small fw-bold text-muted text-uppercase mb-2">
|
||||||
|
<i class="fa-solid fa-circle-dot text-primary me-1"></i><?= _("Police d'Assurance cible") ?>
|
||||||
|
</label>
|
||||||
|
<div class="input-group border rounded-3 overflow-hidden shadow-sm transition-focus">
|
||||||
|
<span class="input-group-text bg-light border-0">
|
||||||
|
<i class="fa-solid fa-file-contract text-primary"></i>
|
||||||
|
</span>
|
||||||
|
<select class="form-select border-0 fw-bold text-dark"
|
||||||
|
id="idPolice"
|
||||||
|
name="idPolice"
|
||||||
|
required
|
||||||
|
onchange="javascript:ajax_contexter_police();"
|
||||||
|
style="font-size: 10pt; height: 45px;">
|
||||||
|
<?php liste_options($polices, "", false); ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-5">
|
||||||
|
<button type="button"
|
||||||
|
class="btn btn-primary w-100 fw-bold shadow-sm d-flex align-items-center justify-content-center hover-lift"
|
||||||
|
onclick="javascript:ouvrir_vue('<?= $vue; ?>');"
|
||||||
|
style="height: 45px; border-radius: 8px;">
|
||||||
|
<i class="fas fa-external-link-alt me-2"></i>
|
||||||
|
<span><?= _("Accéder au module") ?></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.extra-small { font-size: 0.7rem; }
|
||||||
|
|
||||||
|
/* Animation de focus sur l'input group */
|
||||||
|
.transition-focus {
|
||||||
|
transition: all 0.2s ease-in-out;
|
||||||
|
border: 1px solid #dee2e6 !important;
|
||||||
|
}
|
||||||
|
.transition-focus:focus-within {
|
||||||
|
border-color: #0d6efd !important;
|
||||||
|
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Effet au survol du bouton */
|
||||||
|
.hover-lift {
|
||||||
|
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||||
|
}
|
||||||
|
.hover-lift:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Style du select pour éviter le contour bleu par défaut de Bootstrap */
|
||||||
|
.form-select:focus {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -11,12 +11,11 @@
|
||||||
<div class="card border-0 shadow-sm rounded-0 rounded-bottom mb-4">
|
<div class="card border-0 shadow-sm rounded-0 rounded-bottom mb-4">
|
||||||
<div class="card-body bg-light border-bottom">
|
<div class="card-body bg-light border-bottom">
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Police d'Assurance") ?></label>
|
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Police d'Assurance") ?></label>
|
||||||
<div class="input-group shadow-sm">
|
<div class="input-group shadow-sm">
|
||||||
<span class="input-group-text bg-white"><i class="fa-solid fa-file-contract text-primary"></i></span>
|
<span class="input-group-text bg-white"><i class="fa-solid fa-file-contract text-primary"></i></span>
|
||||||
<select class="form-control selectpicker shadow-none" data-live-search="true" id="idPolice" name="idPolice" required>
|
<select class="form-select shadow-none" id="idPolice" name="idPolice" required>
|
||||||
<?php liste_options($polices, "", false); ?>
|
<?php liste_options($polices, "", false); ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -594,6 +594,29 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--<button class="d-none" id="btn_police" data-bs-toggle="modal" data-bs-target="#pop_police"></button>-->
|
||||||
|
<!-- Polices Modal -->
|
||||||
|
<div class="modal fade" id="pop_police" role="dialog">
|
||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-bs-dismiss="modal"> <?= _("Fermer") ?> </button>
|
||||||
|
<h4 class="modal-title"> <?= _("Sélectionner une police") ?> </h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<div id="div_police">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-bs-dismiss="modal"> <?= _("Fermer") ?> </button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="div_ajaxgabarit">
|
<div id="div_ajaxgabarit">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -639,7 +662,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
|
||||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||||
|
|
||||||
<!-- Application Scripts -->
|
<!-- Application Scripts -->
|
||||||
<script src="/Js/fonctions.js?ver=2026.01.12.03"></script>
|
<script src="/Js/fonctions.js?ver=2026.01.13.00"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
raffraichier_gabarit();
|
raffraichier_gabarit();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user