newdesigngestionnaire/vues_newdesign/Recherche/index.php
2026-03-12 09:15:34 +00:00

162 lines
11 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// $this->titre = "INTER SANTE - "._("Rechercher assuré") ;
?>
<div class="page-content">
<form id="frmrecherche" name="frmrecherche" method="post" action="Recherche/index/">
<div class="header-section mb-4">
<div class="d-flex align-items-center justify-content-between bg-white p-3 shadow-sm border-start border-primary border-4" style="border-radius: var(--radius-md);">
<div class="d-flex align-items-center">
<div class="icon-shape bg-primary-ghost text-primary rounded-circle me-3" style="width: 45px; height: 45px; display: flex; align-items: center; justify-content: center;">
<i class="fas fa-search fs-5"></i>
</div>
<div>
<h4 id="titre-page" class="mb-0 fw-bold text-uppercase"><?= _("Recherche Assurés") ?></h4>
<p class="text-secondary small mb-0"><?= _("Retrouvez un bénéficiaire par son numéro, son nom ou ses coordonnées") ?></p>
</div>
</div>
</div>
</div>
<div class="card shadow-sm border-0 mb-4" style="border-radius: var(--radius-md); background: #ffffff;">
<div class="card-body">
<div class="row g-3">
<div class="col-md-6 col-lg-3">
<label class="form-label small fw-bold text-dark mb-1"><?= _("Numéro Bénéficiaire") ?></label>
<div class="input-group input-group-merge">
<span class="input-group-text bg-light border-end-0 text-muted"><i class="fas fa-id-card small"></i></span>
<input class="form-control border-start-0 ps-0" type="text" id="numeroBeneficiaire" name="numeroBeneficiaire" autofocus autocomplete="off" placeholder="Ex: 100234...">
</div>
</div>
<div class="col-md-6 col-lg-3">
<label class="form-label small fw-bold text-dark mb-1"><?= _("Numéro Famille") ?></label>
<div class="input-group input-group-merge">
<span class="input-group-text bg-light border-end-0 text-muted"><i class="fas fa-users small"></i></span>
<input class="form-control border-start-0 ps-0" type="text" id="numeroAdherent" name="numeroAdherent" autocomplete="off">
</div>
</div>
<div class="col-md-6 col-lg-3">
<label class="form-label small fw-bold text-dark mb-1"><?= _("Nom") ?></label>
<input class="form-control" type="text" id="nomBeneficiaire" name="nomBeneficiaire" placeholder="Ex: DOE" style="text-transform: uppercase;">
</div>
<div class="col-md-6 col-lg-3">
<label class="form-label small fw-bold text-dark mb-1"><?= _("Prénoms") ?></label>
<input class="form-control" type="text" id="prenomsBeneficiaire" name="prenomsBeneficiaire">
</div>
<div class="col-md-6 col-lg-3">
<label class="form-label small fw-bold text-dark mb-1"><?= _("Téléphone") ?></label>
<div class="input-group">
<span class="input-group-text bg-light border-end-0 text-muted"><i class="fas fa-phone-alt small"></i></span>
<input class="form-control border-start-0 ps-0" type="tel" id="telephonePortable" name="telephonePortable">
</div>
</div>
<div class="col-md-6 col-lg-3">
<label class="form-label small fw-bold text-dark mb-1">E-mail</label>
<div class="input-group">
<span class="input-group-text bg-light border-end-0 text-muted"><i class="fas fa-at small"></i></span>
<input class="form-control border-start-0 ps-0" type="email" id="email" name="email">
</div>
</div>
<div class="col-md-12 col-lg-6 d-flex align-items-end">
<button type="submit" id="lancerrecherche" name="lancerrecherche" class="btn btn-primary w-100 fw-bold py-2 shadow-sm transition-all" style="background-color: var(--color-primary); border: none;">
<i class="fas fa-filter me-2"></i> <?= _("Lancer la recherche") ?>
</button>
</div>
</div>
</div>
</div>
<?php if (isset($derniernumerobeneficiaires) && is_array($derniernumerobeneficiaires) && $derniernumerobeneficiaires['nouveau']>0): ?>
<div class="alert alert-custom-urgent d-flex align-items-center mb-4 p-3 shadow-sm" role="alert">
<div class="icon-circle bg-danger text-white me-3">
<i class="fas fa-exclamation-triangle"></i>
</div>
<div>
<h6 class="alert-heading fw-bold mb-1 text-danger"><?= _("Carte déclarée perdue") ?></h6>
<span class="text-dark">L'ancien numéro <strong><?= $derniernumerobeneficiaires['ancien'] ?></strong> a été remplacé par <strong><?= $derniernumerobeneficiaires['nouveau'] ?></strong>.</span>
</div>
</div>
<?php endif; ?>
<div class="card shadow-sm border-0 overflow-hidden" style="border-radius: var(--radius-md);">
<div class="card-header bg-white py-3 d-flex justify-content-between align-items-center border-bottom">
<h6 class="mb-0 fw-bold text-dark">
<i class="fas fa-th-list me-2 text-primary"></i><?= _("Liste des assurés trouvés") ?>
</h6>
<?php if (isset($beneficiaires) && is_array($beneficiaires)): ?>
<span class="badge bg-primary-ghost text-primary border-0 rounded-pill"><?= count($beneficiaires) ?> <?= _("résultats") ?></span>
<?php endif; ?>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<?php if (isset($beneficiaires) && is_array($beneficiaires) && count($beneficiaires) > 0): ?>
<table class="table table-hover align-middle mb-0 custom-table">
<thead class="bg-light-gray text-muted small text-uppercase">
<tr>
<th class="ps-4 border-0 text-center"><?= _("Matricule") ?></th>
<th class="border-0"><?= _("Identité") ?></th>
<th class="border-0 text-center"><?= _("Parenté") ?></th>
<th class="border-0 text-center"><?= _("Date Naissance") ?></th>
<th class="border-0 text-center"><?= _("Sexe") ?></th>
<th class="border-0"><?= _("Souscripteur / Entreprise") ?></th>
<th class="border-0 text-center pe-4"><?= _("Statut") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($beneficiaires as $beneficiaire):
$idBeneficiaire = $this->nettoyer($beneficiaire['id']);
$numeroBeneficiaire = $this->nettoyer($beneficiaire['numeroBeneficiaire']);
$etatCode = $this->nettoyer($beneficiaire['codeEtatBeneficiaire']);
$statusBadge = ($etatCode == 'ACTIF') ? 'badge-success-ghost' : 'badge-secondary-ghost';
?>
<tr class="beneficiaire-row"
onclick="selectionner_beneficiaire(<?= $idBeneficiaire ?>,'<?= $numeroBeneficiaire ?>');"
ondblclick="selectionner_beneficiaire(<?= $idBeneficiaire ?>,'<?= $numeroBeneficiaire ?>');afficher_beneficiaire_id();">
<td class="text-center ps-4">
<span class="fw-bold text-primary"><?= $numeroBeneficiaire ?></span>
</td>
<td>
<div class="d-flex align-items-center">
<div class="avatar-sm bg-light text-primary rounded-circle me-2 d-flex align-items-center justify-content-center fw-bold" style="width: 32px; height: 32px; font-size: 0.7rem;">
<?= substr($beneficiaire['nomBeneficiaire'], 0, 1) ?>
</div>
<div>
<div class="fw-bold text-dark mb-0"><?= $this->nettoyer($beneficiaire['nomBeneficiaire']) ?></div>
<div class="small text-muted"><?= $this->nettoyer($beneficiaire['prenomsBeneficiaire']) ?></div>
</div>
</div>
</td>
<td class="text-center small"><?= $this->nettoyer($beneficiaire['codeLienParente']) ?></td>
<td class="text-center small"><?= dateLang($this->nettoyer($beneficiaire['dateNaissance'])) ?></td>
<td class="text-center small"><?= ($this->nettoyer($beneficiaire['sexe']) == 'M') ? 'Masc.' : 'Fém.' ?></td>
<td class="small text-truncate" style="max-width: 200px;"><?= $this->nettoyer($beneficiaire['nomClient']) ?></td>
<td class="text-center pe-4">
<span class="badge <?= $statusBadge ?> rounded-pill"><?= $etatCode ?></span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center py-5">
<div class="mb-3">
<i class="fas fa-user-slash fa-3x text-light-gray"></i>
</div>
<h5 class="text-muted"><?= _("Aucun résultat") ?></h5>
<p class="small text-muted px-4"><?= _("Assurezvous que vos critères de recherche sont corrects avant de lancer la recherche.") ?></p>
</div>
<?php endif; ?>
</div>
</div>
</div>
</form>
</div>