232 lines
12 KiB
PHP
232 lines
12 KiB
PHP
<?php
|
|
/**
|
|
* Vue : Fiche Police
|
|
* Thème : Office 2019 / PowerPoint Professional
|
|
*/
|
|
|
|
// Initialisation des variables de logique
|
|
$gcactive = ($this->nettoyer($police['gestionConfiee']) == "1");
|
|
$remplacementAdherent = ($this->nettoyer($police['remplacementAdherent']) == "1");
|
|
$isAnglophone = est_anglophone();
|
|
|
|
$typeContrat = $isAnglophone ? $police['typeContratEng'] : $police['typeContrat'];
|
|
$typeAvenant = $isAnglophone ? $police['typeAvenantEng'] : $police['typeAvenant'];
|
|
$etatPolice = $isAnglophone ? $police['etatPoliceEng'] : $police['etatPolice'];
|
|
|
|
$prestationPossible = $this->nettoyer($police['prestationPossible']);
|
|
|
|
|
|
|
|
var_dump(array(
|
|
'0: ' => $_SESSION['lang'],
|
|
'1: ' => dateLang($this->nettoyer($police['dateEffet']), $_SESSION['lang']),
|
|
'2: ' => dateLang("2025-01-11", $_SESSION['lang']),
|
|
'3: ' => dateLang("2025-01-11", "en_US"),
|
|
'4: ' => dateLang("2025-01-11", "fr_FR"),
|
|
'5: ' => $this->nettoyer($police['dateEffet']),
|
|
'6: ' => dateEng("2025-01-11"),
|
|
'7: ' => dateFr("2025-01-11"),
|
|
'8: ' => strtotime("2025-01-11")
|
|
));
|
|
?>
|
|
|
|
<div id="div_police" class="container-fluid py-1">
|
|
<input type="hidden" id="gestionConfiee" value="<?= $this->nettoyer($police['gestionConfiee']) ?>">
|
|
<input type="hidden" id="prestationPossible" value="<?= $prestationPossible ?>">
|
|
<input type="hidden" id="idPolice_C" value="<?= $_SESSION['idPolice_C'] ?>">
|
|
<input type="hidden" id="codeTypeContrat_C" value="<?= $_SESSION['codeTypeContrat'] ?>">
|
|
<input type="hidden" id="nbAdh_C" value="<?= $_SESSION['ndAdh_C'] ?>">
|
|
<input type="hidden" id="nbAdh_C" value="<?= $_SESSION['codeEtatPolice_C'] ?>">
|
|
|
|
<h1 class="text-primary"><i class="fas fa-shield-alt me-2"></i></i> <?= _('Fiche Police') ?></h1>
|
|
|
|
<div class="card shadow-sm mb-0 border-0">
|
|
<div class="card-header d-flex justify-content-between align-items-center py-1">
|
|
<h5 class="mb-0 fw-bold">
|
|
<?= _("POLICE") ?> : <span class="text-secondary"><?= $this->nettoyer($police['numeroPolice']) ?></span>
|
|
<span class="ms-3 badge bg-primary text-light small fw-normal">ID: <?= $this->nettoyer($police['idPolice']) ?></span>
|
|
</h5>
|
|
<div class="text-end">
|
|
<small class="d-block opacity-75"><?= _("Primes non facturées") ?></small>
|
|
<span class="fw-bold h5 mb-0 badge bg-warning"><?= format_N($nb_non_facturees) ?></span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-body p-2">
|
|
<div class="row g-3">
|
|
<div class="col-lg-8 col-md-7">
|
|
<label class="form-label small fw-bold text-uppercase"><?= _("Client") ?></label>
|
|
<div class="input-group">
|
|
<span class="input-group-text bg-light"><i class="fas fa-building-user"></i></span>
|
|
<input type="text" class="form-control" value="<?= $_SESSION['nomClient_C'] ?>" readonly>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-4 col-md-5">
|
|
<label class="form-label small fw-bold text-uppercase"><?= _("Numéro de Police") ?></label>
|
|
<input type="text" class="form-control fw-bold" value="<?= $this->nettoyer($police['numeroPolice']) ?>" readonly>
|
|
</div>
|
|
|
|
<div class="col-lg-4 col-md-6">
|
|
<label class="form-label small fw-bold text-uppercase"><?= _("Courtier / Apporteur") ?></label>
|
|
<input type="text" class="form-control" value="<?= $this->nettoyer($police['apporteur']) ?>" readonly>
|
|
</div>
|
|
<div class="col-lg-2 col-md-6">
|
|
<label class="form-label small fw-bold text-uppercase"><?= _("Tx Comm %") ?></label>
|
|
<input type="text" class="form-control text-center" value="<?= $this->nettoyer($police['tauxCommission']) ?>" readonly>
|
|
</div>
|
|
<div class="col-lg-6 col-md-12">
|
|
<label class="form-label small fw-bold text-uppercase"><?= _("Type de Contrat") ?></label>
|
|
<input type="text" class="form-control" value="<?= $typeContrat ?>" readonly>
|
|
</div>
|
|
|
|
<div class="col-lg-3 col-md-6">
|
|
<label class="form-label small fw-bold text-uppercase"><?= _("État de la Police") ?></label>
|
|
<input type="text" class="form-control fw-bold text-primary border-primary-subtle" value="<?= $etatPolice ?>" readonly>
|
|
</div>
|
|
<div class="col-lg-3 col-md-6">
|
|
<label class="form-label small fw-bold text-uppercase"><?= _("Date Effet") ?></label>
|
|
<input type="text" class="form-control" value="<?= dateLang($this->nettoyer($police['dateEffet']), $_SESSION['lang']) ?>" readonly>
|
|
</div>
|
|
<div class="col-lg-3 col-md-6">
|
|
<label class="form-label small fw-bold text-uppercase"><?= _("Échéance") ?></label>
|
|
<input type="text" class="form-control" value="<?= dateLang($this->nettoyer($police['dateEcheance']), $_SESSION['lang']) ?>" readonly>
|
|
</div>
|
|
<div class="col-lg-3 col-md-6">
|
|
<label class="form-label small fw-bold text-uppercase"><?= _("No Avenant") ?></label>
|
|
<input type="text" class="form-control" value="<?= $this->nettoyer($police['numeroAvenant']) ?>" readonly>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-4 g-2">
|
|
<div class="col-md-3">
|
|
<div class="status-box <?= $gcactive ? 'active' : '' ?>">
|
|
<small><?= _("Gestion Confiée Activée") ?></small>
|
|
<span><?= $gcactive ? _("OUI") : _("NON") ?></span>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="status-box <?= $remplacementAdherent ? 'active' : '' ?>">
|
|
<small><?= _("Remplacer Famille") ?></small>
|
|
<span><?= $remplacementAdherent ? _("OUI") : _("NON") ?></span>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<button type="button" class="btn btn-outline-office w-100 h-100 py-2" onclick="javascript:texte_cp();">
|
|
<i class="fas fa-file-signature me-2"></i> <?= _("Texte Conditions Particulières...") ?>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-footer p-0 border-top-0">
|
|
<div class="row g-0 text-center">
|
|
<div class="col-4 financial-item border-end py-3">
|
|
<small class="text-muted d-block"><?= _("Primes") ?></small>
|
|
<span class="h5 mb-0 text-secondary fw-bold"><?= format_N($this->nettoyer($totalquittance['primeTtc'])) ?></span>
|
|
</div>
|
|
<div class="col-4 financial-item border-end py-3">
|
|
<small class="text-muted d-block"><?= _("Encaissements") ?></small>
|
|
<span class="h5 mb-0 text-success fw-bold"><?= format_N($this->nettoyer($totalquittance['encaisse'])) ?></span>
|
|
</div>
|
|
<div class="col-4 financial-item py-3">
|
|
<small class="text-muted d-block"><?= _("Solde") ?></small>
|
|
<span class="h5 mb-0 text-primary fw-bold"><?= format_N($this->nettoyer($totalquittance['solde'])) ?></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card shadow-sm mb-4">
|
|
<div class="card-body p-4">
|
|
<h6 class="fw-bold text-uppercase mb-3">
|
|
<i class="fas fa-folder-open me-2 text-warning"></i><?= _("Joindre des fichiers à la police") ?>
|
|
</h6>
|
|
|
|
<form enctype="multipart/form-data" action="Fichepolice" method="post" class="row g-3">
|
|
<!-- Zone d'information sur les extensions
|
|
<div class="alert alert-info mt-2 py-2 small col-md-12">
|
|
<strong><?= _("Formats autorisés") ?>:</strong>
|
|
<div class="d-flex flex-wrap mt-2">
|
|
<?php foreach ($tabExt as $ext): ?>
|
|
<?php
|
|
$style = isset($extStyles[$ext]) ? $extStyles[$ext] : ["color" => "secondary", "icon" => "fas fa-file"];
|
|
?>
|
|
<span class="badge bg-<?= $style["color"] ?> me-2 mb-2">
|
|
<i class="<?= $style["icon"] ?> me-1"></i><?= strtoupper($ext) ?>
|
|
</span>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
-->
|
|
<div class="col-md-9">
|
|
<input class="form-control custom-file-input" name="fichier_upload" type="file" id="fichier_upload">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<button type="submit" name="submit" class="btn btn-secondary w-100 fw-bold">
|
|
<i class="fas fa-paper-plane me-2"></i><?= _("Envoyer") ?>
|
|
</button>
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<?php if(isset($msgErreur) && trim($msgErreur) != ""): ?>
|
|
<div class="alert alert-danger mt-3 py-2 small fw-bold text-center"><?= $msgErreur ?></div>
|
|
<?php endif; ?>
|
|
|
|
<div class="table-responsive mt-4">
|
|
<table class="table table-hover align-middle custom-table">
|
|
<thead>
|
|
<tr>
|
|
<th width="15%"><?= _("Date") ?></th>
|
|
<th><?= _("Nom du Document") ?></th>
|
|
<th width="15%" class="text-center"><?= _("Actions") ?></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($geds as $ged): ?>
|
|
<tr>
|
|
<td class="small"><?= dateheureLang($this->nettoyer($ged['dateSysteme']), $_SESSION['lang']) ?></td>
|
|
<td>
|
|
<i class="far fa-file-alt me-2 text-muted"></i>
|
|
<?= $this->nettoyer($ged['nomOrigine']) ?>
|
|
</td>
|
|
<td class="text-center">
|
|
<a href="<?= $this->nettoyer($ged['cheminFichier']) ?>" target="_blank" class="btn btn-light border" title="Télécharger">
|
|
<i class="fas fa-download text-primary"></i>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card shadow-sm">
|
|
<div class="card-body p-4">
|
|
<div class="row g-3 align-items-center">
|
|
<div class="col-auto">
|
|
<span class="fw-bold text-muted text-uppercase small"><?= _("Quittances du") ?></span>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<input class="form-control datepicker text-center" id="debut" NAME="debut" value="<?= dateLang($_SESSION['dateEffet_C'], $_SESSION['lang']) ?>">
|
|
</div>
|
|
<div class="col-auto">
|
|
<span class="fw-bold text-muted text-uppercase small"><?= _("au") ?></span>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<input class="form-control datepicker text-center" id="fin" NAME="fin" value="<?= dateCouranteLang($_SESSION['lang']) ?>">
|
|
</div>
|
|
<div class="col-md-3 ms-auto">
|
|
<button class="btn btn-primary w-100 fw-bold" onclick="javascript:afficher_quittances_police_periode();">
|
|
<i class="fas fa-sync-alt me-2"></i><?= _("Actualiser") ?>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="div_quittancepolice" class="mt-4"></div>
|
|
<div id="div_export"></div>
|
|
</div>
|