This commit is contained in:
KONE SOREL 2026-03-14 08:48:24 +00:00
parent 3bb38d983e
commit 2cfe57d561
3 changed files with 176 additions and 109 deletions

View File

@ -1,14 +1,61 @@
<form id="formData">
<legend id="titre_formData"><?= _("Ajouter des données") ?></legend>
<table class="table table-responsive table-condensed">
<tbody>
<tr>
<td width="5%" align="center" class="required">Code</td>
<td width="10%" ><INPUT class="form-control majuscule" TYPE="text" id="codePays" NAME="codePays" required AUTOCOMPLETE="OFF" autofocus ></td>
<div class="card border-0 shadow-sm border-start border-success border-4 mb-4">
<div class="card-header bg-white py-3 border-0">
<h6 class="mb-0 fw-bold text-uppercase text-success small" id="titre_formData">
<i class="fas fa-plus-circle me-2"></i><?= _("Ajouter un Pays") ?>
</h6>
</div>
<td width="5%" align="center" class="required"><?= _("Libellé") ?></td>
<td width="70%" ><INPUT class="form-control majuscule" TYPE="text" id="libelle" NAME="libelle" required AUTOCOMPLETE="OFF" ></td>
</tr>
</tbody>
</table>
</form>
<div class="card-body">
<form id="formData">
<div class="row g-3">
<div class="col-md-3">
<label class="form-label small fw-bold text-muted required">Code</label>
<div class="input-group">
<span class="input-group-text bg-light border-2 border-end-0"><i class="fas fa-barcode text-muted"></i></span>
<input class="form-control border-2 border-start-0 ps-0 majuscule fw-bold"
type="text"
id="codePays"
name="codePays"
maxlength="3"
required
autocomplete="off"
autofocus>
</div>
</div>
<div class="col-md-9">
<label class="form-label small fw-bold text-muted required"><?= _("Libellé du Pays") ?></label>
<div class="input-group">
<span class="input-group-text bg-light border-2 border-end-0"><i class="fas fa-globe-africa text-muted"></i></span>
<input class="form-control border-2 border-start-0 ps-0 majuscule"
type="text"
id="libelle"
name="libelle"
required
autocomplete="off">
</div>
</div>
</div>
<div id="form-errors" class="alert alert-danger mt-3 d-none small py-2"></div>
</form>
</div>
</div>
<style>
/* Force la majuscule pendant la saisie */
.majuscule { text-transform: uppercase; }
/* Style spécifique pour les champs requis */
.required:after {
content: " *";
color: #dc3545;
font-weight: bold;
}
/* Animation au focus */
.form-control:focus {
border-color: #28a745 !important;
box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.15) !important;
}
</style>

View File

@ -1,84 +1,62 @@
<?php
$nbreTotal = count($pays);
<div class="card border-0 shadow-sm overflow-hidden" style="border-radius: var(--radius-md);">
<div class="card-header bg-white py-3 border-bottom d-flex justify-content-between align-items-center">
<div class="d-flex align-items-center">
<h6 class="mb-0 fw-bold text-uppercase text-primary small">
<i class="fas fa-table me-2"></i><?= _("Référentiel des Pays") ?>
</h6>
<span class="badge bg-primary-ghost text-primary ms-3 px-3 py-2 rounded-pill fw-bold" id="badge-total">
0 <?= _("Lignes") ?>
</span>
</div>
<div id="table-buttons" class="d-flex gap-2"></div>
</div>
if($nbreTotal < 10){
$nbreTotal = '0'.$nbreTotal;
}else{
$nbreTotal = format_N($nbreTotal);
}
if (est_anglophone()){
if($existeselection){
$libbouton = "Uncheck all";
}else{
$libbouton = "Check all";
}
}else{
if($existeselection){
$libbouton = "Décocher tous";
}else{
$libbouton = "Cocher tous";
}
}
?>
<?php $superUser = $_SESSION['superUser']; ?>
<table style="margin: auto" class="table-responsive">
<tbody>
<td><input class="form-control" style="text-align: center; font-size:10pt;" type="text" id="nbreTotal" name="nbreTotal" value="<?= _("Lignes Total").": ". $nbreTotal; ?>" readonly> </td>
</tbody>
</table>
<input type="hidden" id="total" value="<?= $nbreTotal; ?>">
<table id="tableLister" class="table table-striped table-bordered table-hover table-condensed table-responsive compact">
<thead>
<div class="card-body p-0">
<div class="table-responsive">
<table id="tableLister" class="table table-hover align-middle mb-0" style="width:100%">
<thead class="bg-light text-muted small text-uppercase">
<tr>
<th class="text-center"><?= _("Centre gestion") ?></th>
<th class="text-center">Code</th>
<th class="text-center"><?= _("Libellé") ?></th>
<!--
<th class="text-center">
<button type="button" style="font-size:10pt; font-weight: bold; width:100%; background-color:#4caf50; color: white;" class="form-control btn" onclick="javascript:cocherDecocherTout($('#fichier_lister').val());" > <?= $libbouton; ?> </button>
</th>
-->
<th class="text-center"><?= _("Modifier") ?></th>
<!--
<th class="text-center">Supprimer</th>
-->
<th class="ps-4 border-0"><?= _("Centre") ?></th>
<th class="border-0 text-center"><?= _("Code") ?></th>
<th class="border-0"><?= _("Libellé") ?></th>
<th class="border-0 text-center pe-4"><?= _("Actions") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($pays as $v):
$idData = $this->nettoyer($v['id']);
?>
<tr valign="top">
<td class="text-center" width="15%"><?= $this->nettoyer($v['codeSociete']) ?></td>
<td class="text-center" width="10%"><?= $this->nettoyer($v['codePays']) ?></td>
<td class="text-left" width="70%"><?= $this->nettoyer($v['libelle']) ?></td>
<!--
<td class="text-center" width="10%">
<?php
if($this->nettoyer($v['choix'] == '0')){
$check ='';
}
else{
$check = 'checked';
}
?>
<INPUT TYPE="checkbox" class="custom-control-input" style="width: 2rem;height: 2rem;" id="choix" NAME="choix" value="<?=(($this->nettoyer($v['choix'])==0)? 0 : 1);?>" onclick="if (this.checked) this.value=1; else this.value=0;cocherDecocherUn($('#fichier_lister').val(),<?= $idData; ?>);" <?= $check;?>>
<tr>
<td class="ps-4 fw-medium text-dark"><?= $this->nettoyer($v['codeSociete']) ?></td>
<td class="text-center">
<span class="badge bg-light text-dark fw-bold border"><?= $this->nettoyer($v['codePays']) ?></span>
</td>
-->
<td class="text-center" width="10%">
<button style="width:100%" class ="form-control btn btn-primary" type="button" id="btn-editer" name="Modifier"
onclick="JAVASCRIPT:formModifTableRef(<?= $idData; ?>);" ><?= _("Modifier") ?></button>
<td class="text-dark fw-bold"><?= $this->nettoyer($v['libelle']) ?></td>
<td class="text-center pe-4">
<button type="button"
class="btn btn-outline-primary btn-sm px-3 rounded-pill fw-bold shadow-xs"
onclick="formModifTableRef(<?= $idData ?>);">
<i class="fas fa-edit me-1"></i> <?= _("Modifier") ?>
</button>
</td>
<!--
<td class="text-center" width="10%">
<button style="width:100%" class = "form-control btn btn-danger" type="button" id="btn-supprimer" name="Supprimer"
onclick="JAVASCRIPT:supprimeLigneListe(<?= $idData; ?>,'<?= $superUser; ?>')">Supprimer</button>
</td>
-->
</tr>
<?php endforeach; ?>
</tbody>
</table>
</table>
</div>
</div>
</div>
<style>
.bg-primary-ghost { background-color: rgba(33, 46, 83, 0.08) !important; }
#tableLister thead th { padding-top: 15px; padding-bottom: 15px; font-weight: 700; }
#tableLister tbody td { border-color: #f1f4f6; }
.shadow-xs { box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
/* Style pour les boutons d'export injectés */
.dt-buttons .btn {
font-size: 0.75rem !important;
padding: 0.4rem 0.8rem !important;
}
.text-primary { color: #212e53 !important; }
</style>

View File

@ -1,15 +1,57 @@
<form id="formData">
<legend id="titre_formData"><?= _("Modification des données") ?></legend>
<INPUT class="sr-only" TYPE="text" id = "id" name = "id" value="<?=$pays['id']?>">
<table class="table table-responsive table-condensed">
<tbody>
<tr>
<td width="5%" align="center">Code</td>
<td width="10%" ><INPUT class="form-control majuscule" TYPE="text" id="codePays" NAME="codePays" required AUTOCOMPLETE="OFF" autofocus value="<?= $this->nettoyer($pays['codePays']); ?>" readonly></td>
<div class="card border-0 shadow-sm border-start border-primary border-4 mb-4">
<div class="card-header bg-white py-3 border-0">
<h6 class="mb-0 fw-bold text-uppercase text-warning small" id="titre_formData">
<i class="fas fa-edit me-2"></i><?= _("Modification des données du Pays") ?>
</h6>
</div>
<td width="5%" align="center" class="required"><?= _("Libellé") ?></td>
<td width="70%" ><INPUT class="form-control majuscule" TYPE="text" id="libelle" NAME="libelle" required AUTOCOMPLETE="OFF" value="<?= $this->nettoyer($pays['libelle']); ?>"></td>
</tr>
</tbody>
</table>
</form>
<div class="card-body">
<form id="formData">
<input type="hidden" id="id" name="id" value="<?= $pays['id'] ?>">
<div class="row g-3">
<div class="col-md-3">
<label class="form-label small fw-bold text-muted">Code</label>
<div class="input-group">
<span class="input-group-text bg-light border-2 border-end-0"><i class="fas fa-lock text-muted"></i></span>
<input class="form-control border-2 border-start-0 ps-0 majuscule fw-bold bg-white"
type="text"
id="codePays"
name="codePays"
value="<?= $this->nettoyer($pays['codePays']); ?>"
readonly>
</div>
</div>
<div class="col-md-9">
<label class="form-label small fw-bold text-muted required"><?= _("Libellé du Pays") ?></label>
<div class="input-group">
<span class="input-group-text bg-light border-2 border-end-0"><i class="fas fa-globe-africa text-muted"></i></span>
<input class="form-control border-2 border-start-0 ps-0 majuscule"
type="text"
id="libelle"
name="libelle"
value="<?= $this->nettoyer($pays['libelle']); ?>"
required
autocomplete="off"
autofocus>
</div>
</div>
</div>
</form>
</div>
</div>
<style>
/* Focus Ring spécifique au mode édition */
.form-control:focus {
border-color: #212e53 !important;
box-shadow: 0 0 0 0.25rem rgba(33, 46, 83, 0.15) !important;
}
/* Style champ readonly pour qu'il ne paraisse pas désactivé mais protégé */
input[readonly] {
cursor: not-allowed;
color: #6c757d !important;
}
</style>