radiantrh/Vue/Gedpolice/index.php
2026-01-06 13:53:43 +00:00

125 lines
7.2 KiB
PHP

<?php $this->titre = "INTER-SANTE - GED Police"; ?>
<div id="div_police" class="container-fluid py-4 animate__animated animate__fadeIn">
<h1 class="text-primary"><i class="fas fa-folder-open me-2"></i></i> <?= _("Gestion Électronique des Documents (GED)") ?></h1>
<div class="card-header d-flex justify-content-between align-items-center py-1">
<h4 class="fw-bold text-secondary mb-0">
<?= _("Police") ?> :
<span class="text-primary"><?= $this->nettoyer($_SESSION['numeroPolice_C']) ?></span>
</h4>
<span class="badge bg-info-subtle text-dark border border-info-subtle px-3 py-2">
<i class="fas fa-info-circle me-1"></i> <?= _("Limité aux 50 derniers documents") ?>
</span>
</div>
<?php if((isset($msgErreur)) && ($msgErreur > " ")) : ?>
<div class="alert alert-danger shadow-sm d-flex align-items-center" role="alert">
<i class="fas fa-exclamation-triangle me-2 fs-4"></i>
<div><?= $msgErreur ?></div>
</div>
<?php endif; ?>
<div class="row g-4 mt-1">
<div class="col-xl-4">
<div class="card shadow-sm border-0 h-100">
<div class="card-header bg-white py-3">
<h6 class="mb-0 fw-bold"><i class="fas fa-filter me-2"></i><?= _("Actions & Filtres") ?></h6>
</div>
<div class="card-body">
<div class="mb-4">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Période de recherche") ?></label>
<div class="input-group mb-2">
<span class="input-group-text small"><?= _("Du") ?></span>
<input type="text" id="d1" name="d1" class="form-control datepicker text-center"
value="<?= dateLang($_SESSION['dUneSemaineAvant_C'], $_SESSION['lang']) ?>" required>
</div>
<div class="input-group mb-3">
<span class="input-group-text small"><?= _("Au") ?></span>
<input type="text" id="d2" name="d2" class="form-control datepicker text-center"
value="<?= dateCouranteLang($_SESSION['lang']) ?>" required>
</div>
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Nom du document") ?></label>
<input type="text" id="nomOrigine" name="nomOrigine" class="form-control mb-3" placeholder="Ex: Contrat...">
<button type="button" class="btn btn-primary w-100 fw-bold" onclick="lister_ged_police();">
<i class="fas fa-sync-alt me-2"></i><?= _("Actualiser la liste") ?>
</button>
</div>
<hr class="text-muted opacity-25">
<form enctype="multipart/form-data" action="Gedpolice" method="post" class="mt-4">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Nouveau document") ?></label>
<div class="mb-3">
<input class="form-control" name="fichier_upload" type="file" id="fichier_upload" required>
<div class="form-text x-small"><?= _("Sélectionnez un fichier pour l'ajouter à cette police.") ?></div>
</div>
<button type="submit" name="submit" class="btn btn-success w-100 fw-bold">
<i class="fas fa-cloud-upload-alt me-2"></i><?= _("Envoyer le fichier") ?>
</button>
</form>
</div>
</div>
</div>
<div class="col-xl-8">
<div class="card shadow-sm border-0 h-100">
<div id="div_ged" class="table-responsive">
<table class="table table-hover align-middle mb-0" style="font-size:0.85rem;">
<thead class="bg-light text-muted">
<tr>
<th class="ps-3"><?= _("Date") ?></th>
<th><?= _("Source") ?></th>
<th><?= _("Police / Bénéficiaire") ?></th>
<th><?= _("Document") ?></th>
<th class="text-center pe-3"><?= _("Action") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($geds as $ged):
$cheminFichier = $this->nettoyer($ged['cheminFichier']);
?>
<tr>
<td class="ps-3">
<div class="fw-bold"><?= dateheureLang($this->nettoyer($ged['dateSysteme'])) ?></div>
<div class="text-muted x-small"><?= $this->nettoyer($ged['souscripteur']) ?></div>
</td>
<td>
<span class="badge bg-secondary-subtle text-secondary"><?= $this->nettoyer($ged['source']) ?></span>
</td>
<td>
<div class="small"><i class="fas fa-file-contract me-1 opacity-50"></i> <?= $this->nettoyer($ged['numeroPolice']) ?></div>
<div class="fw-bold text-primary">
<?= $this->nettoyer($ged['numeroBeneficiaire']) ?> - <?= $this->nettoyer($ged['beneficiaire']) ?>
</div>
<div class="x-small text-muted italic"><?= $this->nettoyer($ged['adherent']) ?></div>
</td>
<td>
<div class="text-truncate" style="max-width: 200px;" title="<?= $this->nettoyer($ged['nomOrigine']) ?>">
<i class="far fa-file-pdf text-danger me-1"></i> <?= $this->nettoyer($ged['nomOrigine']) ?>
</div>
</td>
<td class="text-center pe-3">
<a href="<?= $cheminFichier ?>" target="_blank" class="btn btn-sm btn-outline-primary rounded-pill px-3">
<i class="fas fa-download me-1"></i> <?= _("Ouvrir") ?>
</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<style>
.x-small { font-size: 0.75rem; }
.italic { font-style: italic; }
.table-responsive { max-height: 700px; overflow-y: auto; }
.bg-warning-subtle { background-color: #fff3cd !important; }
</style>