This commit is contained in:
KONE SOREL 2026-03-05 11:24:41 +00:00
parent 17b5878902
commit 9c0b53546d
6 changed files with 144 additions and 23 deletions

View File

@ -0,0 +1,27 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Societeuser.php';
class ControleurAjaxmotifdepassement extends Controleur {
private $menuvue;
private $societeuser;
public function __construct() {
$this->societeuser = new Societeuser();
}
public function index()
{
$motifs = $this->societeuser->getMotifsDepassement();
$this->genererVueAjax(array(
'motifs' => $motifs
));
}
}

View File

@ -0,0 +1,25 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Societeuser.php';
class ControleurAjaxtextefacturationgarant extends Controleur {
private $menuvue;
private $societeuser;
public function __construct() {
$this->societeuser = new Societeuser();
}
public function index()
{
$textes = $this->societeuser->getTexteFacturationGarant();
$this->genererVueAjax(array(
'textes' => $textes
));
}
}

View File

@ -91618,4 +91618,28 @@ function ui_refresh_select(selector) {
container: false // Garde le menu dans son parent direct
});
}
}
function loadMessageSection(section) {
let url = "";
let target = "#content-" + section;
let donnees = "";
if (section === 'Motifs') url = $("#racineWeb").val() + "Ajaxmotifdepassement/";
if (section === 'Facturation') url = $("#racineWeb").val() + "Ajaxtextefacturationgarant/";
// Éviter de recharger si déjà chargé (optionnel)
if ($(target).find('table').length > 0) return;
$.ajax({
url: url,
type: 'post',
data: donnees,
success: function(data) {
$(target).html(data);
},
error: function() {
$(target).html('<div class="alert alert-danger m-3">Erreur de chargement</div>');
}
});
}

View File

@ -0,0 +1,31 @@
<div class="p-4 bg-white">
<div class="d-flex align-items-center mb-3">
<span class="badge bg-warning text-dark me-2"><?= count($motifs) ?></span>
<h6 class="fw-bold mb-0 text-uppercase small"><?= _("Configuration des motifs") ?></h6>
</div>
<div class="table-responsive">
<table class="table table-hover align-middle border">
<thead class="bg-light small fw-bold">
<tr>
<th width="15%" class="text-center"><?= _("CODE") ?></th>
<th><?= _("MESSAGE PERSONNALISÉ") ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($motifs as $v): $i++; $idMessage = $v['id']; ?>
<tr>
<td class="text-center fw-bold text-primary bg-light"><?= $this->nettoyer($v['codeMotifDepassement']) ?></td>
<td>
<input class="form-control border-0 bg-transparent fw-medium"
value="<?= est_anglophone() ? $this->nettoyer($v['libelleEng']) : $this->nettoyer($v['libelle']) ?>"
onchange="majmotifdepassement(<?=$idMessage ?>, <?=$i ?>);"
placeholder="<?= _("Saisir le texte ici...") ?>">
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>

View File

@ -0,0 +1,37 @@
<div class="p-4 bg-white">
<div class="d-flex align-items-center mb-3 text-primary">
<i class="fas fa-info-circle me-2"></i>
<h6 class="fw-bold mb-0 text-uppercase small"><?= _("Mentions légales sur factures") ?></h6>
</div>
<div class="table-responsive">
<table class="table table-hover align-middle border">
<thead class="bg-light small fw-bold">
<tr>
<th width="10%" class="text-center"><?= _("CODE") ?></th>
<th><?= _("TEXTE DE L'ÉTAT") ?></th>
<th width="15%"><?= _("ÉCHÉANCE") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($textes as $v): $idTexte = $v['id']; ?>
<tr>
<td class="text-center fw-bold text-dark bg-light"><?= $this->nettoyer($v['codeTypeFacturationGarant']) ?></td>
<td>
<textarea class="form-control form-control-sm border-0 bg-transparent" rows="2"
onchange="majtextefacturation(<?=$idTexte ?>, this.value);"><?= est_anglophone() ? $this->nettoyer($v['texteEng']) : $this->nettoyer($v['texte']) ?></textarea>
</td>
<td>
<div class="input-group input-group-sm">
<input type="number" class="form-control fw-bold text-center border-0 bg-light"
value="<?= $this->nettoyer($v['echeance']); ?>"
onchange="majecheancefacturation(<?=$idTexte ?>, this.value);">
<span class="input-group-text bg-light border-0 small">Jrs</span>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>

View File

@ -50,29 +50,6 @@
</div>
</div>
<script>
function loadMessageSection(section) {
let url = "";
let target = "#content-" + section;
if (section === 'Motifs') url = $("#racineWeb").val() + "Motifdepassement/";
if (section === 'Facturation') url = $("#racineWeb").val() + "Textefacturationgarant/";
// Éviter de recharger si déjà chargé (optionnel)
if ($(target).find('table').length > 0) return;
$.ajax({
url: url,
type: 'GET',
success: function(data) {
$(target).html(data);
},
error: function() {
$(target).html('<div class="alert alert-danger m-3">Erreur de chargement</div>');
}
});
}
</script>
<style>
.accordion-button:not(.collapsed) {