sdf
This commit is contained in:
parent
ac718ca6c5
commit
7304569929
|
|
@ -34647,25 +34647,25 @@ function requetes_synthese_consommation_police_export()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function modifier_type_bon(idTypebon)
|
function modifier_type_bon(idTypebon) {
|
||||||
{
|
let donnees = 'idTypebon=' + idTypebon;
|
||||||
donnees = 'idTypebon='+idTypebon;
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: $("#racineWeb").val()+"Ajaxparambons/",
|
url: $("#racineWeb").val() + "Ajaxparambons/",
|
||||||
type : 'post',
|
type: 'post',
|
||||||
data: donnees,
|
data: donnees,
|
||||||
error: function(errorData) {
|
error: function(errorData) {
|
||||||
},
|
console.error("Erreur lors du chargement des paramètres du bon.");
|
||||||
success: function(data)
|
},
|
||||||
{
|
success: function(data) {
|
||||||
donnees_retour = data;
|
// 1. Injecter le contenu dans le conteneur de la modale
|
||||||
},
|
$('#div_maj_type_bon').html(data);
|
||||||
complete: function()
|
|
||||||
{
|
// 2. Initialiser et afficher la modale Bootstrap
|
||||||
$('#div_maj_type_bon').html(donnees_retour);
|
var myModal = new bootstrap.Modal(document.getElementById('div_maj_type_bon'));
|
||||||
}
|
myModal.show();
|
||||||
});
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function enregistrer_modif_type_bon()
|
function enregistrer_modif_type_bon()
|
||||||
|
|
@ -92072,4 +92072,63 @@ function enregistrer_modif_parametres_med()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function initSmartTable(selector = '.datatable-inter', pageTitle = 'Export Données') {
|
||||||
|
if ($(selector).length === 0) return;
|
||||||
|
|
||||||
|
// Détection automatique : la barre de recherche personnalisée existe-t-elle ?
|
||||||
|
var hasGlobalSearch = $('#globalSearch').length > 0;
|
||||||
|
|
||||||
|
if ($.fn.DataTable.isDataTable(selector)) {
|
||||||
|
$(selector).DataTable().destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Configuration du DOM :
|
||||||
|
// Si hasGlobalSearch est vrai, on retire 'f' (recherche native)
|
||||||
|
var domStructure = hasGlobalSearch
|
||||||
|
? '<"d-flex align-items-center justify-content-start p-3 border-bottom"B>t<"d-flex justify-content-between align-items-center p-3 bg-light"ip>'
|
||||||
|
: '<"d-flex align-items-center justify-content-between p-3 border-bottom"Bf>t<"d-flex justify-content-between align-items-center p-3 bg-light"ip>';
|
||||||
|
|
||||||
|
var table = $(selector).DataTable({
|
||||||
|
"dom": domStructure,
|
||||||
|
"buttons": [
|
||||||
|
{
|
||||||
|
extend: 'excelHtml5',
|
||||||
|
text: '<i class="fas fa-file-excel me-2"></i>Excel',
|
||||||
|
className: 'btn btn-success btn-sm fw-bold border-0 shadow-sm px-3'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdfHtml5',
|
||||||
|
text: '<i class="fas fa-file-pdf me-2"></i>PDF',
|
||||||
|
className: 'btn btn-danger btn-sm fw-bold border-0 shadow-sm px-3 ms-2',
|
||||||
|
title: pageTitle,
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"language": {
|
||||||
|
"url": "//cdn.datatables.net/plug-ins/1.13.6/i18n/fr-FR.json",
|
||||||
|
"search": "Rechercher : ",
|
||||||
|
"searchPlaceholder": "Filtrer..."
|
||||||
|
},
|
||||||
|
"pageLength": 10,
|
||||||
|
"autoWidth": false,
|
||||||
|
"drawCallback": function() {
|
||||||
|
// Style uniquement si la recherche native est affichée
|
||||||
|
if (!hasGlobalSearch) {
|
||||||
|
$('.dataTables_filter input').addClass('form-control form-control-sm d-inline-block ms-2 rounded-pill border-2 shadow-none').css('width', '200px');
|
||||||
|
}
|
||||||
|
$('.dataTables_paginate .paginate_button').addClass('btn btn-xs mx-1');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// LIAISON AUTOMATIQUE : Si globalSearch existe, on branche l'événement tout de suite
|
||||||
|
if (hasGlobalSearch) {
|
||||||
|
$('#globalSearch').off('keyup').on('keyup', function() {
|
||||||
|
table.search(this.value).draw();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return table;
|
||||||
}
|
}
|
||||||
|
|
@ -1,44 +1,67 @@
|
||||||
<div id="div_maj_type_bon">
|
<div class="modal-dialog modal-dialog-centered shadow-lg">
|
||||||
|
<div class="modal-content border-0" style="border-radius: var(--radius-md);">
|
||||||
|
|
||||||
|
<div class="modal-header border-bottom-0 pb-3 pt-4 px-4 border-start border-warning border-5" style="background-color: #212e53; border-top-left-radius: var(--radius-md); border-top-right-radius: var(--radius-md);">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="icon-shape bg-warning text-white rounded-circle me-3" style="width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.2);">
|
||||||
|
<i class="fas fa-edit"></i>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h5 class="modal-title fw-bold text-uppercase mb-0" style="color: #ffffff !important; letter-spacing: -0.5px; font-size: 1.1rem;">
|
||||||
|
<?= _("Mise à jour du paramètre") ?>
|
||||||
|
</h5>
|
||||||
|
<small style="color: rgba(255,255,255,0.7);"><?= $this->nettoyer($typebon['libelleTypebon']) ?></small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="btn p-2 border-0 shadow-none d-flex align-items-center justify-content-center"
|
||||||
|
data-bs-dismiss="modal" aria-label="Close"
|
||||||
|
style="background: transparent; transition: transform 0.2s ease;">
|
||||||
|
<i class="fas fa-times text-white fs-4"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<legend> <?= _("MISE A JOUR DES PARAMETRES") ?> </legend>
|
<div class="modal-body p-4">
|
||||||
|
<input class="sr-only" type="text" id="idTypebon" name="idTypebon" value="<?= $this->nettoyer($typebon['idTypebon']) ?>">
|
||||||
|
|
||||||
<input class="sr-only" type="text" id="idTypebon" name="idTypebon" value="<?= $this->nettoyer($typebon['idTypebon']) ?>">
|
<div class="p-3 mb-4 rounded-3 bg-light border border-light shadow-sm">
|
||||||
|
<label class="form-label small fw-bold text-muted text-uppercase mb-2" style="font-size: 0.65rem;"><?= _("Configuration Actuelle") ?></label>
|
||||||
|
<div class="row g-2 text-center">
|
||||||
|
<div class="col-6">
|
||||||
|
<div class="small text-muted mb-1"><?= _("Durée") ?></div>
|
||||||
|
<div class="h5 mb-0 fw-bold text-dark"><?= $this->nettoyer($typebon['dureeVie']) ?> <?= _("Jours") ?></div>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 border-start border-white">
|
||||||
|
<div class="small text-muted mb-1"><?= _("Gestion") ?></div>
|
||||||
|
<div class="h5 mb-0 fw-bold text-dark"><?= $this->nettoyer($typebon['libelleTypeGestionBon']) ?></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<table class="table table-responsive table-condensed" style="font-size:10pt;">
|
<div class="row g-3">
|
||||||
<tbody>
|
<div class="col-md-6">
|
||||||
<tr>
|
<label class="form-label small fw-bold text-dark required"><?= _("Nouvelle Durée (Jours)") ?></label>
|
||||||
<td> <INPUT style="font-size:10pt; text-align:center;" class="form-control" TYPE="text" value="<?= $this->nettoyer($typebon['libelleTypebon']) ?>" readonly ></td>
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-white border-end-0 text-muted"><i class="fas fa-clock small"></i></span>
|
||||||
|
<input id="dureeVie" name="dureeVie" class="form-control border-start-0 fw-bold border-warning shadow-none" type="number"
|
||||||
|
value="<?= $this->nettoyer($typebon['dureeVie']) ?>"
|
||||||
|
onChange="this.value=supprimer_espace_nombre(this.value); controle_numerique(this);">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<td width="15%" align="center" > <?= _("Durée de vie") ?> </td>
|
<div class="col-md-6">
|
||||||
<td> <INPUT style="font-size:10pt; text-align:center" class="form-control" TYPE="text" value="<?= $this->nettoyer($typebon['dureeVie']) ?>" readonly ></td>
|
<label class="form-label small fw-bold text-dark required"><?= _("Nouveau Type Gestion") ?></label>
|
||||||
|
<select class="form-select fw-bold border-warning shadow-none" id="codeGestionBon" name="codeGestionBon">
|
||||||
|
<?php liste_options($typegestion, $typebon['codeGestionBon'], true); ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<td width="15%" align="center" > <?= _("Gestion") ?> </td>
|
<div class="modal-footer border-0 bg-light p-3" style="border-bottom-left-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md);">
|
||||||
<td> <INPUT style="font-size:10pt; text-align:center" class="form-control" TYPE="text" value="<?= $this->nettoyer($typebon['libelleTypeGestionBon']) ?>" readonly ></td>
|
<button type="button" class="btn btn-outline-secondary btn-sm px-3 fw-bold border-2" data-bs-dismiss="modal"><?= _("Annuler") ?></button>
|
||||||
</tr>
|
<button type="button" class="btn btn-primary btn-sm px-4 fw-bold shadow-sm" onclick="javascript:enregistrer_modif_type_bon();">
|
||||||
|
<i class="fas fa-check-circle me-1"></i> <?= _("Appliquer les modifications") ?>
|
||||||
<tr>
|
</button>
|
||||||
<td align="center" > <?= _("Nouvelles valeurs") ?> </td>
|
</div>
|
||||||
|
</div>
|
||||||
<td align="center" > <?= _("Durée de vie") ?> </td>
|
</div>
|
||||||
<td align='center'>
|
|
||||||
<INPUT style="font-size:10pt; text-align:center;" id="dureeVie" name="dureeVie" class="form-control" TYPE="number" value="<?= $this->nettoyer($typebon['dureeVie']) ?>"
|
|
||||||
onChange="this.value=supprimer_espace_nombre(this.value); controle_numerique(this);">
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td align="center" > <?= _("Gestion") ?> </td>
|
|
||||||
<td>
|
|
||||||
<SELECT style="font-size:10pt; text-align:center;" class="form-select" id="codeGestionBon" NAME="codeGestionBon" >
|
|
||||||
<?php liste_options($typegestion, $typebon['codeGestionBon'],true); ?>
|
|
||||||
</SELECT>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td colspan="5">
|
|
||||||
<input style="font-size:10pt;" class = "form-control btn btn-primary" type="button" value="<?= _("Enregistrer") ?>"
|
|
||||||
onClick="javascript:enregistrer_modif_type_bon();">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
Loading…
Reference in New Issue
Block a user