radiantassure/Vue/Ged/index.php
2025-12-07 09:35:13 +00:00

299 lines
11 KiB
PHP
Executable File

<?php
$this->titre = "Intersanté - GED Globale";
?>
<div class="card shadow-lg border-0 mb-4" style="border-radius: 15px;">
<div class="card-header bg-primary text-white py-3" style="border-radius: 15px 15px 0 0;">
<div class="row align-items-center">
<div class="col-8 text-center">
<h4 id="h4_titre" class="mb-2 text-center">
<i class="fas fa-archive me-2"></i>
<?= _("GED Globale") ?>
</h4>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="alert alert-info mb-4">
<small>
<i class="fas fa-info-circle me-2"></i>
<?= _("NB : Limité à 100 documents => Filtrer sur période pour obtenir le résultat souhaité") ?>
</small>
</div>
<!-- Formulaire de filtres et upload -->
<div class="card shadow-sm mb-8">
<div class="card-body">
<form enctype="multipart/form-data" action="Ged" method="post">
<div class="row g-3 align-items-end">
<!-- Période du -->
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
<label class="form-label fw-bold"><?= _("Période du") ?></label>
<input class="form-control form-control-sm datepicker" type="text"
id="d1" name="d1"
value="<?= $_SESSION['dUneSemaineAvantFr_C'] ?>" required>
</div>
<!-- Période au -->
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
<label class="form-label fw-bold"><?= _("au") ?></label>
<input class="form-control form-control-sm datepicker" type="text"
id="d2" name="d2"
value="<?= dateCouranteLang($_SESSION['lang']) ?>" required>
</div>
<!-- Recherche document -->
<div class="col-12 col-md-4 col-lg-3">
<label class="form-label fw-bold"><?= _("Document") ?></label>
<input class="form-control form-control-sm" type="text"
id="nomOrigine" name="nomOrigine"
placeholder="<?= _('Rechercher un document') ?>">
</div>
<!-- Bouton Actualiser -->
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
<button type="button" class="btn btn-primary w-100 btn_autre"
onclick="javascript:lister_ged();">
<i class="fas fa-sync-alt me-2"></i><?= _("Actualiser") ?>
</button>
</div>
<!-- Upload de fichier -->
<div class="col-12 col-sm-6 col-md-4 col-lg-9">
<label class="form-label fw-bold"><?= _("Envoyer un document") ?></label>
<input class="form-control" name="fichier_upload" type="file"
id="fichier_upload" />
</div>
<!-- Bouton Envoyer -->
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
<button type="submit" name="submit" class="btn btn-success w-100 mt-md-0 btn_autre">
<i class="fas fa-upload me-2"></i><?= _("Envoyer / Send") ?>
</button>
</div>
</div>
</form>
</div>
</div>
<!-- Résultats -->
<div id="div_ged">
<div class="card shadow-sm">
<div class="card-header bg-light py-2 d-flex justify-content-between align-items-center">
<h5 class="mb-0 text-dark">
<i class="fas fa-list me-2"></i>
<span class="hide-on-mobile"><?= _("Liste des documents")?></span>
<span class="badge bg-primary view-end"><?= format_N(count($geds)).' '._("document(s)") ?> </span>
</h5>
</div>
<div class="card-body p-0">
<?php if((isset($msgErreur)) && ($msgErreur>" ")) : ?>
<div class="alert alert-danger m-3" role="alert">
<i class="fas fa-exclamation-circle me-2"></i>
<?= $msgErreur ?>
</div>
<?php endif; ?>
<div class="d-none d-md-block">
<div class="table-responsive">
<table class="table table-striped table-hover mb-0" style="font-size:9pt; white-space: nowrap;">
<thead class="table-dark">
<tr>
<th class="text-center">Date</th>
<th class="text-center d-none d-sm-table-cell">Src</th>
<th class="d-none d-lg-table-cell"><?= _("Souscripteur") ?></th>
<th class="text-center d-none d-xl-table-cell"><?= _("Police") ?></th>
<th class="d-none d-xl-table-cell"><?= _("Adhérent") ?></th>
<th class="text-center"><?= _("Bénéficiaire") ?></th>
<th>Document</th>
<th class="text-center"><?= _("Télécharger")?></th>
</tr>
</thead>
<tbody>
<?php if (count($geds) > 0): ?>
<?php foreach ($geds as $ged):
$idGed = $this->nettoyer($ged['idGed']);
$cheminFichier = $this->nettoyer($ged['cheminFichier']);
$nomFichier = $this->nettoyer($ged['nomOrigine']);
?>
<tr>
<td class="text-center" style="min-width: 120px;">
<?= dateheureLang($this->nettoyer($ged['dateSysteme']), $_SESSION['lang']) ?>
</td>
<td class="text-center d-none d-sm-table-cell">
<?= $this->nettoyer($ged['source']) ?>
</td>
<td class="d-none d-lg-table-cell">
<?= $this->nettoyer($ged['souscripteur']) ?>
</td>
<td class="text-center d-none d-xl-table-cell">
<?= $this->nettoyer($ged['numeroPolice']) ?>
</td>
<td class="d-none d-xl-table-cell">
<?= $this->nettoyer($ged['adherent']) ?>
</td>
<td class="text-center" data-bs-toggle="tooltip"
title="<?= $this->nettoyer($ged['beneficiaire']) ?>">
<?= $this->nettoyer($ged['numeroBeneficiaire']) ?>
</td>
<td class="text-truncate" style="max-width: 200px;"
data-bs-toggle="tooltip" title="<?= $nomFichier ?>">
<?= $nomFichier ?>
</td>
<td class="text-center">
<a href="<?= $cheminFichier ?>" target="_blank"
class="btn btn-sm btn-outline-danger"
title="Télécharger le document">
<i class="fas fa-download me-1 d-none d-sm-inline"></i>
</a>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<div class="text-center text-muted py-4">
<div class="alert alert-info mt-3" style="margin-bottom:15px;">
<small>
<i class="fas fa-info-circle me-2"></i>
<?= _("Aucun document trouvé pour les critères sélectionnés") ?>
</small>
</div>
</div>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<!-- Affichage mobile (cartes) -->
<div class="d-md-none">
<?php foreach ($geds as $ged):
$idGed = $this->nettoyer($ged['idGed']);
$cheminFichier = $this->nettoyer($ged['cheminFichier']);
$nomFichier = $this->nettoyer($ged['nomOrigine']);
?>
<div class="card-body py-2">
<div class="row mb-2">
<div class="col-12 mb-2">
<div class="d-flex justify-content-between align-items-center">
<span class="text-muted small me-3">Date</span>
<span class="fw-bold me-2"><?= dateheureLang($this->nettoyer($ged['dateSysteme']), $_SESSION['lang']) ?></span>
</div>
</div>
<div class="col-10 mb-2">
<div class="d-flex justify-content-between align-items-center">
<span class="text-muted small me-3"><?= _("Document") ?></span>
<span class="text-truncate" style="max-width: 200px;"><?= $this->nettoyer($ged['nomOrigine']) ?></span>
</div>
</div>
<div class="col-2 mb-2">
<div class="d-flex justify-content-between align-items-center">
<a href="<?= $cheminFichier ?>"
class="btn btn-sm btn-danger w-100">
<i class="fas fa-download me-1 d-sm-inline" style="font-size:1.8rem !important"></i>
</a>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<style>
.legend-title {
color: #2c3e50;
font-weight: 600;
padding-bottom: 10px;
border-bottom: 2px solid #3498db;
}
.card {
border: none;
border-radius: 10px;
}
.form-label {
font-size: 0.9rem;
}
.table th {
font-size: 0.85rem;
font-weight: 600;
white-space: nowrap;
}
.table td {
font-size: 0.85rem;
vertical-align: middle;
}
/* Styles pour mobile */
@media (max-width: 768px) {
.card-body {
padding: 1rem;
}
.btn {
padding: 0.35rem 0.5rem;
font-size: 0.8rem;
}
.table-responsive {
font-size: 0.8rem;
}
.badge {
font-size: 0.75rem;
}
}
/* Version ultra-mobile */
@media (max-width: 576px) {
.table th, .table td {
padding: 0.4rem;
}
.btn-sm {
padding: 0.25rem 0.4rem;
}
}
/* Tooltips */
.tooltip-inner {
max-width: 300px;
text-align: left;
}
</style>
<script>
// Initialiser les tooltips Bootstrap
document.addEventListener('DOMContentLoaded', function() {
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
// Adapter l'affichage sur mobile
function adaptForMobile() {
if (window.innerWidth < 576) {
// Actions supplémentaires pour très petits écrans
}
}
adaptForMobile();
window.addEventListener('resize', adaptForMobile);
});
</script>