|
|
|
|
@ -4,44 +4,43 @@
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
<title>Agency | Banking Management</title>
|
|
|
|
|
<link rel="stylesheet" href="<?= base_url('<link rel="stylesheet"href="https://cdn.datatables.net/1.13.6/css/dataTables.bootstrap.min.css">') ?>">
|
|
|
|
|
|
|
|
|
|
<!-- CSS DataTables & Plugins -->
|
|
|
|
|
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.6/css/dataTables.bootstrap.min.css">
|
|
|
|
|
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.1/css/buttons.bootstrap.min.css">
|
|
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
|
|
|
|
|
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
|
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
div.dataTables_wrapper {
|
|
|
|
|
width: 100%;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.action-buttons {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 6px; /* espace entre les boutons */
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.action-buttons button {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
div.dataTables_wrapper { width: 100%; margin: 0 auto; }
|
|
|
|
|
.action-buttons { display: flex; gap: 6px; justify-content: center; }
|
|
|
|
|
.action-buttons button { display: inline-flex; align-items: center; justify-content: center; }
|
|
|
|
|
|
|
|
|
|
/* Styles pour les modals de vérification (Review) */
|
|
|
|
|
.view-label { font-weight: bold; color: #555; font-size: 13px; }
|
|
|
|
|
.view-value { color: #000; margin-bottom: 10px; display: block; border-bottom: 1px solid #eee; padding-bottom: 5px; font-size: 14px; }
|
|
|
|
|
.section-header { border-bottom: 2px solid #3c8dbc; padding-bottom: 5px; margin-bottom: 15px; margin-top: 10px; color: #3c8dbc; font-weight: 600; }
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div class="content-wrapper">
|
|
|
|
|
|
|
|
|
|
<section class="content-header">
|
|
|
|
|
<h1>
|
|
|
|
|
<?= $this->lang->line('management_bank_accounts'); ?>
|
|
|
|
|
</h1>
|
|
|
|
|
<h1><?= $this->lang->line('management_bank_accounts'); ?></h1>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class="content">
|
|
|
|
|
|
|
|
|
|
<div class="box">
|
|
|
|
|
<!-- =======================================================
|
|
|
|
|
TABLEAU 1 : COMPTES AGENCE
|
|
|
|
|
======================================================= -->
|
|
|
|
|
<div class="box box-primary">
|
|
|
|
|
<div class="box-header with-border">
|
|
|
|
|
<h3 class="box-title"><?= $this->lang->line('list_bank_accounts'); ?></h3>
|
|
|
|
|
<h3 class="box-title"><?= $this->lang->line('list_of_request_opening_bank_accounts'); ?></h3>
|
|
|
|
|
<div class="box-tools pull-right">
|
|
|
|
|
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="box-body">
|
|
|
|
|
@ -53,82 +52,186 @@
|
|
|
|
|
<th class="text-center"><?= $this->lang->line('firstname'); ?></th>
|
|
|
|
|
<th class="text-center"><?= $this->lang->line('account'); ?></th>
|
|
|
|
|
<th class="text-center">IBAN</th>
|
|
|
|
|
<th class="text-center">Swift</th>
|
|
|
|
|
<th class="text-center"><?= $this->lang->line('reason') ?></th>
|
|
|
|
|
<th class="text-center">Type</th>
|
|
|
|
|
<th class="text-center"><?= $this->lang->line('balance'); ?></th>
|
|
|
|
|
<th class="text-center"><?= $this->lang->line('status'); ?></th>
|
|
|
|
|
<th class="text-center">Actions</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php foreach ($accounts as $a): ?>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="text-center"><?= $a->id ?></td>
|
|
|
|
|
<td class="text-center"><?= $a->lastname ?></td>
|
|
|
|
|
<td class="text-center"><?= $a->firstname ?></td>
|
|
|
|
|
<td class="text-center"><?= $a->account_number ?></td>
|
|
|
|
|
<td class="text-center"><?= $a->iban ?></td>
|
|
|
|
|
<td class="text-center"><?= $a->swift_code ?></td>
|
|
|
|
|
<td class="text-center"><?= $a->reason ?? '-' ?></td>
|
|
|
|
|
<td class="text-center"><?= $a->account_type ?></td>
|
|
|
|
|
<td class="text-center"><?= number_format($a->balance,0,',',' ') ?></td>
|
|
|
|
|
<td class="text-center">
|
|
|
|
|
<?= getStatusBadge($a->status, $this->lang) ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="text-center action-buttons">
|
|
|
|
|
<button
|
|
|
|
|
data-toggle="modal"
|
|
|
|
|
data-target="#editModal"
|
|
|
|
|
class="open-edit-modal btn btn-primary btn-sm"
|
|
|
|
|
<?php if(!empty($request_bank_accounts)): ?>
|
|
|
|
|
<?php $j = 1; ?>
|
|
|
|
|
<?php foreach ($request_bank_accounts as $a): ?>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="text-center"><?= $j++; ?></td>
|
|
|
|
|
<td class="text-center"><?= $a->lastname ?></td>
|
|
|
|
|
<td class="text-center"><?= $a->firstname ?></td>
|
|
|
|
|
<td class="text-center"><?= $a->account_number ?></td>
|
|
|
|
|
<td class="text-center"><?= $a->iban ?></td>
|
|
|
|
|
<td class="text-center"><?= $a->account_type ?></td>
|
|
|
|
|
<td class="text-center"><?= number_format($a->balance,0,',',' ') ?></td>
|
|
|
|
|
<td class="text-center">
|
|
|
|
|
<?= getStatusBadge($a->status, $this->lang) ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="text-center action-buttons">
|
|
|
|
|
|
|
|
|
|
<!-- BOUTON VOIR (REVIEW) -->
|
|
|
|
|
<button
|
|
|
|
|
class="open-review-modal btn btn-info btn-sm"
|
|
|
|
|
data-toggle="modal"
|
|
|
|
|
data-target="#reviewModal"
|
|
|
|
|
title="Vérifier"
|
|
|
|
|
data-id="<?= $a->id ?>"
|
|
|
|
|
data-lastname="<?= $a->lastname ?>"
|
|
|
|
|
data-firstname="<?= $a->firstname ?>"
|
|
|
|
|
data-account_number="<?= $a->account_number ?>"
|
|
|
|
|
data-iban="<?= $a->iban ?>"
|
|
|
|
|
data-swift_code="<?= $a->swift_code ?>"
|
|
|
|
|
data-status="<?= $a->status ?>"
|
|
|
|
|
data-reason="<?= $a->reason ?>"
|
|
|
|
|
data-balance="<?= $a->balance ?>"
|
|
|
|
|
data-account_type="<?= $a->account_type ?>"
|
|
|
|
|
data-birth_date="<?= $a->birth_date ?>"
|
|
|
|
|
data-birth_country="<?= $a->birth_country ?>"
|
|
|
|
|
data-birth_city="<?= $a->birth_city ?>"
|
|
|
|
|
data-nationality="<?= $a->nationality ?>"
|
|
|
|
|
data-marital_status="<?= $a->marital_status ?>"
|
|
|
|
|
data-profession="<?= $a->profession ?>"
|
|
|
|
|
data-sector_activity="<?= $a->sector_activity ?>"
|
|
|
|
|
data-tax_number="<?= $a->tax_number ?>"
|
|
|
|
|
data-employer_name="<?= $a->employer_name ?>"
|
|
|
|
|
data-employer_address="<?= $a->employer_address ?>"
|
|
|
|
|
>
|
|
|
|
|
<i class='fa fa-eye'></i>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
data-id="<?= $a->id ?>"
|
|
|
|
|
data-lastname="<?= $a->lastname ?>"
|
|
|
|
|
data-firstname="<?= $a->firstname ?>"
|
|
|
|
|
data-account_number="<?= $a->account_number ?>"
|
|
|
|
|
data-iban="<?= $a->iban ?>"
|
|
|
|
|
data-swift_code="<?= $a->swift_code ?>"
|
|
|
|
|
data-status="<?= $a->status ?>"
|
|
|
|
|
data-reason="<?= $a->reason ?>"
|
|
|
|
|
data-balance="<?= $a->balance ?>"
|
|
|
|
|
data-birth_date="<?= $a->birth_date ?>"
|
|
|
|
|
data-birth_country="<?= $a->birth_country ?>"
|
|
|
|
|
data-birth_city="<?= $a->birth_city ?>"
|
|
|
|
|
data-father_firstname="<?= $a->father_firstname ?>"
|
|
|
|
|
data-father_lastname="<?= $a->father_lastname ?>"
|
|
|
|
|
data-mother_firstname="<?= $a->mother_firstname ?>"
|
|
|
|
|
data-mother_lastname="<?= $a->mother_lastname ?>"
|
|
|
|
|
data-marital_name="<?= $a->marital_name ?>"
|
|
|
|
|
data-nationality="<?= $a->nationality ?>"
|
|
|
|
|
data-marital_status="<?= $a->marital_status ?>"
|
|
|
|
|
data-profession="<?= $a->profession ?>"
|
|
|
|
|
data-sector_activity="<?= $a->sector_activity ?>"
|
|
|
|
|
data-subsector_activity="<?= $a->subsector_activity ?>"
|
|
|
|
|
data-tax_number="<?= $a->tax_number ?>"
|
|
|
|
|
data-employee_number="<?= $a->employee_number ?>"
|
|
|
|
|
data-position="<?= $a->position ?>"
|
|
|
|
|
data-employer_name="<?= $a->employer_name ?>"
|
|
|
|
|
data-employer_address="<?= $a->employer_address ?>"
|
|
|
|
|
data-created_at="<?= $a->created_at ?>"
|
|
|
|
|
<!-- BOUTON MODIFIER (EDIT) -->
|
|
|
|
|
<button
|
|
|
|
|
data-toggle="modal"
|
|
|
|
|
data-target="#editModal"
|
|
|
|
|
class="open-edit-modal btn btn-primary btn-sm"
|
|
|
|
|
|
|
|
|
|
data-id="<?= $a->id ?>"
|
|
|
|
|
data-lastname="<?= $a->lastname ?>"
|
|
|
|
|
data-firstname="<?= $a->firstname ?>"
|
|
|
|
|
data-account_number="<?= $a->account_number ?>"
|
|
|
|
|
data-iban="<?= $a->iban ?>"
|
|
|
|
|
data-swift_code="<?= $a->swift_code ?>"
|
|
|
|
|
data-status="<?= $a->status ?>"
|
|
|
|
|
data-reason="<?= $a->reason ?>"
|
|
|
|
|
data-balance="<?= $a->balance ?>"
|
|
|
|
|
data-account_type="<?= $a->account_type ?>"
|
|
|
|
|
data-birth_date="<?= $a->birth_date ?>"
|
|
|
|
|
data-birth_country="<?= $a->birth_country ?>"
|
|
|
|
|
data-birth_city="<?= $a->birth_city ?>"
|
|
|
|
|
data-father_firstname="<?= $a->father_firstname ?>"
|
|
|
|
|
data-father_lastname="<?= $a->father_lastname ?>"
|
|
|
|
|
data-mother_firstname="<?= $a->mother_firstname ?>"
|
|
|
|
|
data-mother_lastname="<?= $a->mother_lastname ?>"
|
|
|
|
|
data-marital_name="<?= $a->marital_name ?>"
|
|
|
|
|
data-nationality="<?= $a->nationality ?>"
|
|
|
|
|
data-marital_status="<?= $a->marital_status ?>"
|
|
|
|
|
data-profession="<?= $a->profession ?>"
|
|
|
|
|
data-sector_activity="<?= $a->sector_activity ?>"
|
|
|
|
|
data-subsector_activity="<?= $a->subsector_activity ?>"
|
|
|
|
|
data-tax_number="<?= $a->tax_number ?>"
|
|
|
|
|
data-employee_number="<?= $a->employee_number ?>"
|
|
|
|
|
data-position="<?= $a->position ?>"
|
|
|
|
|
data-employer_name="<?= $a->employer_name ?>"
|
|
|
|
|
data-employer_address="<?= $a->employer_address ?>"
|
|
|
|
|
data-created_at="<?= $a->created_at ?>"
|
|
|
|
|
>
|
|
|
|
|
<i class='fa fa-edit'></i>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
<i class='fa fa-edit'></i>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
<button
|
|
|
|
|
class="delete-account btn btn-danger btn-sm"
|
|
|
|
|
data-id="<?= $a->id ?>"
|
|
|
|
|
onclick="deleteRequest(<?= $a->id ?>)"
|
|
|
|
|
>
|
|
|
|
|
<i class='fa fa-trash'></i>
|
|
|
|
|
</button>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
<button class="delete-account btn btn-danger btn-sm" onclick="deleteRequest(<?= $a->id ?>)">
|
|
|
|
|
<i class='fa fa-trash'></i>
|
|
|
|
|
</button>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- =======================================================
|
|
|
|
|
TABLEAU 2 : DEMANDES DE RATTACHEMENT
|
|
|
|
|
======================================================= -->
|
|
|
|
|
<div class="box box-info" style="margin-top: 30px;">
|
|
|
|
|
<div class="box-header with-border">
|
|
|
|
|
<h3 class="box-title">Demandes de Rattachement (Comptes Bancaires)</h3>
|
|
|
|
|
<div class="box-tools pull-right">
|
|
|
|
|
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="box-body">
|
|
|
|
|
<table class="table table-bordered table-striped" id="linksTable">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th class="text-center">ID</th>
|
|
|
|
|
<th class="text-center">Nom complet</th>
|
|
|
|
|
<th class="text-center">User Code</th>
|
|
|
|
|
<th class="text-center">Client</th>
|
|
|
|
|
<th class="text-center">Téléphone</th>
|
|
|
|
|
<th class="text-center">Banque</th>
|
|
|
|
|
<th class="text-center">IBAN / Compte</th>
|
|
|
|
|
<th class="text-center"><?= $this->lang->line('status'); ?></th>
|
|
|
|
|
<th class="text-center">Actions</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php if(!empty($request_links_bank_accounts)): ?>
|
|
|
|
|
<?php $i = 1; ?>
|
|
|
|
|
<?php foreach ($request_links_bank_accounts as $l): ?>
|
|
|
|
|
<?php
|
|
|
|
|
$statusStr = 'pending';
|
|
|
|
|
if($l->is_verified == 1) $statusStr = 'active';
|
|
|
|
|
if($l->is_verified == 2) $statusStr = 'rejected';
|
|
|
|
|
?>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="text-center"><?= $i++; ?></td>
|
|
|
|
|
<td class="text-center"><?= $l->lastname .' '. $l->firstname ?></td>
|
|
|
|
|
<td class="text-center"><?= $l->user_code ?></td>
|
|
|
|
|
<td class="text-center">
|
|
|
|
|
<?= $l->lastname ?> <?= $l->firstname ?><br>
|
|
|
|
|
<small class="text-muted"><?= $l->email ?></small>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="text-center"><?= $l->phone ?></td>
|
|
|
|
|
<td class="text-center">
|
|
|
|
|
<strong><?= $l->bank_name ?></strong><br>
|
|
|
|
|
<small><?= substr($l->bank_address, 0, 20) ?>...</small>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="text-center"><?= $l->iban ?></td>
|
|
|
|
|
<td class="text-center">
|
|
|
|
|
<?= getStatusBadge($statusStr, $this->lang) ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="text-center action-buttons">
|
|
|
|
|
<button
|
|
|
|
|
class="open-link-review-modal btn btn-info btn-sm"
|
|
|
|
|
data-toggle="modal"
|
|
|
|
|
data-target="#reviewLinkModal"
|
|
|
|
|
title="Vérifier le rattachement"
|
|
|
|
|
data-id="<?= $l->id_transaction ?>"
|
|
|
|
|
data-user_code="<?= $l->user_code ?>"
|
|
|
|
|
data-fullname="<?= $l->lastname . ' ' . $l->firstname ?>"
|
|
|
|
|
data-email="<?= $l->email ?>"
|
|
|
|
|
data-phone="<?= $l->phone ?>"
|
|
|
|
|
data-bank_name="<?= $l->bank_name ?>"
|
|
|
|
|
data-bank_address="<?= $l->bank_address ?>"
|
|
|
|
|
data-iban="<?= $l->iban ?>"
|
|
|
|
|
data-status="<?= $statusStr ?>"
|
|
|
|
|
data-created_at="<?= $l->created_at ?>"
|
|
|
|
|
>
|
|
|
|
|
<i class='fa fa-eye'></i>
|
|
|
|
|
</button>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -136,7 +239,99 @@
|
|
|
|
|
</section>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- MODAL EDIT -->
|
|
|
|
|
<!-- =======================================================
|
|
|
|
|
MODAL 1 : VÉRIFICATION AGENCE (AGENCY BANKING)
|
|
|
|
|
======================================================= -->
|
|
|
|
|
<div class="modal fade" id="reviewModal">
|
|
|
|
|
<div class="modal-dialog modal-lg">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
|
|
|
|
<h4 class="modal-title text-center">Vérification de la demande d'ouverture de compte</h4>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
<input type="hidden" id="review_id">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-12"><h5 class="section-header">Informations Personnelles</h5></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Nom :</span> <span class="view-value" id="view_lastname"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Prénom :</span> <span class="view-value" id="view_firstname"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Date Nais. :</span> <span class="view-value" id="view_birth_date"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Nationalité :</span> <span class="view-value" id="view_nationality"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Matrimonial :</span> <span class="view-value" id="view_marital_status"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Ville de Naissance :</span> <span class="view-value" id="view_birth_city"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Pays de Naissance :</span> <span class="view-value" id="view_birth_country"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Nom de la mere :</span> <span class="view-value" id="view_mother_lastname"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Prénom de la mere :</span> <span class="view-value" id="view_mother_firstname"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Nom du père :</span> <span class="view-value" id="view_father_lastname"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Prénom du père :</span> <span class="view-value" id="view_father_firstname"></span></div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-12"><h5 class="section-header">Détails du Compte</h5></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Numéro :</span> <span class="view-value" id="view_account_number"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Type :</span> <span class="view-value" id="view_account_type"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Solde :</span> <span class="view-value" id="view_balance"></span></div>
|
|
|
|
|
<div class="col-md-6"><span class="view-label">IBAN :</span> <span class="view-value" id="view_iban"></span></div>
|
|
|
|
|
<div class="col-md-6"><span class="view-label">Code Swift :</span> <span class="view-value" id="view_swift_code"></span></div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-12"><h5 class="section-header">Informations Professionnelles</h5></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Profession :</span> <span class="view-value" id="view_profession"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Secteur :</span> <span class="view-value" id="view_sector_activity"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Employeur :</span> <span class="view-value" id="view_employer_name"></span></div>
|
|
|
|
|
<div class="col-md-4"><span class="view-label">Adresse employeur:</span> <span class="view-value" id="view_employer_address"></span></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer" style="background-color: #f9f9f9; display: flex; justify-content: space-between;">
|
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>
|
|
|
|
|
<div>
|
|
|
|
|
<button type="button" class="btn btn-danger btn-lg" id="btn-reject-request"><i class="fa fa-times"></i> REJETER</button>
|
|
|
|
|
<button type="button" class="btn btn-success btn-lg" id="btn-validate-request" style="margin-left: 10px;"><i class="fa fa-check"></i> VALIDER</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- =======================================================
|
|
|
|
|
MODAL 2 : VÉRIFICATION RATTACHEMENT
|
|
|
|
|
======================================================= -->
|
|
|
|
|
<div class="modal fade" id="reviewLinkModal">
|
|
|
|
|
<div class="modal-dialog">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
|
|
|
|
<h4 class="modal-title text-center">Vérification des informations de la demande de rattachment de compte</h4>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
<input type="hidden" id="link_id_transaction">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-12"><h5 class="section-header">Information du Client</h5></div>
|
|
|
|
|
<div class="col-md-6"><span class="view-label">Code Utilisateur :</span> <span class="view-value" id="link_user_code"></span></div>
|
|
|
|
|
<div class="col-md-6"><span class="view-label">Nom Complet :</span> <span class="view-value" id="link_fullname"></span></div>
|
|
|
|
|
<div class="col-md-6"><span class="view-label">Email :</span> <span class="view-value" id="link_email"></span></div>
|
|
|
|
|
<div class="col-md-6"><span class="view-label">Téléphone :</span> <span class="view-value" id="link_phone"></span></div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-12"><h5 class="section-header">Information Banque & Compte</h5></div>
|
|
|
|
|
<div class="col-md-12"><span class="view-label">Nom de la Banque :</span> <span class="view-value" id="link_bank_name"></span></div>
|
|
|
|
|
<div class="col-md-12"><span class="view-label">Adresse Banque :</span> <span class="view-value" id="link_bank_address"></span></div>
|
|
|
|
|
<div class="col-md-12"><span class="view-label">IBAN / Numéro Carte :</span> <span class="view-value" id="link_iban" style="font-size: 16px; font-weight:bold; letter-spacing: 1px;"></span></div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6"><span class="view-label">Date Demande :</span> <span class="view-value" id="link_created_at"></span></div>
|
|
|
|
|
<div class="col-md-6"><span class="view-label">Statut Actuel :</span> <span class="view-value" id="link_status"></span></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer" style="background-color: #f9f9f9; display: flex; justify-content: space-between;">
|
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>
|
|
|
|
|
<div>
|
|
|
|
|
<button type="button" class="btn btn-danger" id="btn-reject-link"><i class="fa fa-times"></i> Rejeter</button>
|
|
|
|
|
<button type="button" class="btn btn-success" id="btn-validate-link" style="margin-left: 10px;"><i class="fa fa-check"></i> Valider</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- =======================================================
|
|
|
|
|
MODAL 3 : EDIT (COMPLET AVEC TOUS LES CHAMPS)
|
|
|
|
|
======================================================= -->
|
|
|
|
|
<div class="modal fade" id="editModal">
|
|
|
|
|
<div class="modal-dialog modal-lg">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
@ -152,96 +347,38 @@
|
|
|
|
|
<input type="hidden" name="id" id="edit_id">
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Nom</label>
|
|
|
|
|
<input id="edit_lastname" name="lastname" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Prénom</label>
|
|
|
|
|
<input id="edit_firstname" name="firstname" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Numéro de compte</label>
|
|
|
|
|
<input id="edit_account_number" name="account_number" class="form-control input-lg">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>IBAN</label>
|
|
|
|
|
<input id="edit_iban" name="iban" class="form-control input-lg">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Swift</label>
|
|
|
|
|
<input id="edit_swift_code" name="swift_code" class="form-control input-lg">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Type de compte</label>
|
|
|
|
|
<input id="edit_account_type" name="account_type" class="form-control input-lg">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Balance</label>
|
|
|
|
|
<input id="edit_balance" name="balance" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-6"><label>Nom</label><input id="edit_lastname" name="lastname" class="form-control input-lg" required></div>
|
|
|
|
|
<div class="col-md-6"><label>Prénom</label><input id="edit_firstname" name="firstname" class="form-control input-lg" required></div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6"><label>Numéro de compte</label><input id="edit_account_number" name="account_number" class="form-control input-lg"></div>
|
|
|
|
|
<div class="col-md-6"><label>IBAN</label><input id="edit_iban" name="iban" class="form-control input-lg"></div>
|
|
|
|
|
<div class="col-md-6"><label>Swift</label><input id="edit_swift_code" name="swift_code" class="form-control input-lg"></div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6"><label>Type de compte</label><input id="edit_account_type" name="account_type" class="form-control input-lg"></div>
|
|
|
|
|
<div class="col-md-6"><label>Balance</label><input id="edit_balance" name="balance" class="form-control input-lg" required></div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Statut du compte</label>
|
|
|
|
|
<select id="edit_status" name="status" class="form-control input-lg" required>
|
|
|
|
|
<option value="pending">En attente</option>
|
|
|
|
|
<option value="active">Activé</option>
|
|
|
|
|
<option value="validated">Validé</option>
|
|
|
|
|
<option value="rejected">Rejeté</option>
|
|
|
|
|
<option value="close">Fermé</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Motif</label>
|
|
|
|
|
<input id="edit_reason" name="reason" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-6"><label>Motif</label><input id="edit_reason" name="reason" class="form-control input-lg" required></div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Date de naissance</label>
|
|
|
|
|
<input id="edit_birth_date" name="birth_date" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-6"><label>Date de naissance</label><input id="edit_birth_date" name="birth_date" class="form-control input-lg" required></div>
|
|
|
|
|
<div class="col-md-6"><label>Pays de naissance</label><input id="edit_birth_country" name="birth_country" class="form-control input-lg" required></div>
|
|
|
|
|
<div class="col-md-6"><label>Ville de naissance</label><input id="edit_birth_city" name="birth_city" class="form-control input-lg" required></div>
|
|
|
|
|
<div class="col-md-6"><label>Nationalité</label><input id="edit_nationality" name="nationality" class="form-control input-lg" required></div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Pays de naissance</label>
|
|
|
|
|
<input id="edit_birth_country" name="birth_country" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Ville de naissance</label>
|
|
|
|
|
<input id="edit_birth_city" name="birth_city" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Nationalité</label>
|
|
|
|
|
<input id="edit_nationality" name="nationality" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Nom de la mère</label>
|
|
|
|
|
<input id="edit_mother_lastname" name="mother_lastname" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Prénom de la mère</label>
|
|
|
|
|
<input id="edit_mother_firstname" name="mother_firstname" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Nom du père</label>
|
|
|
|
|
<input id="edit_father_lastname" name="father_lastname" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Prénom du père</label>
|
|
|
|
|
<input id="edit_father_firstname" name="father_firstname" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-6"><label>Nom de la mère</label><input id="edit_mother_lastname" name="mother_lastname" class="form-control input-lg" required></div>
|
|
|
|
|
<div class="col-md-6"><label>Prénom de la mère</label><input id="edit_mother_firstname" name="mother_firstname" class="form-control input-lg" required></div>
|
|
|
|
|
<div class="col-md-6"><label>Nom du père</label><input id="edit_father_lastname" name="father_lastname" class="form-control input-lg" required></div>
|
|
|
|
|
<div class="col-md-6"><label>Prénom du père</label><input id="edit_father_firstname" name="father_firstname" class="form-control input-lg" required></div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Statut matrimonial</label>
|
|
|
|
|
@ -253,152 +390,121 @@
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label> Numéro fiscal</label>
|
|
|
|
|
<input id="edit_tax_number" name="tax_number" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Secteur d'activité</label>
|
|
|
|
|
<input id="edit_sector_activity" name="sector_activity" class="form-control input-lg">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Profession</label>
|
|
|
|
|
<input id="edit_profession" name="profession" class="form-control input-lg" required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Nom de l’employeur</label>
|
|
|
|
|
<input id="edit_employer_name" name="employer_name" class="form-control input-lg">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Adresse de l’employeur</label>
|
|
|
|
|
<input id="edit_employer_address" name="employer_address" class="form-control input-lg">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Matricule de l’employeur</label>
|
|
|
|
|
<input id="edit_employee_number" name="employee_number" class="form-control input-lg">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<label>Date de création</label>
|
|
|
|
|
<input id="edit_created_at" readonly class="form-control input-lg">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-6"><label>Numéro fiscal</label><input id="edit_tax_number" name="tax_number" class="form-control input-lg" required></div>
|
|
|
|
|
<div class="col-md-6"><label>Secteur d'activité</label><input id="edit_sector_activity" name="sector_activity" class="form-control input-lg"></div>
|
|
|
|
|
<div class="col-md-6"><label>Profession</label><input id="edit_profession" name="profession" class="form-control input-lg" required></div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6"><label>Nom de l’employeur</label><input id="edit_employer_name" name="employer_name" class="form-control input-lg"></div>
|
|
|
|
|
<div class="col-md-6"><label>Adresse de l’employeur</label><input id="edit_employer_address" name="employer_address" class="form-control input-lg"></div>
|
|
|
|
|
<div class="col-md-6"><label>Matricule de l’employeur</label><input id="edit_employee_number" name="employee_number" class="form-control input-lg"></div>
|
|
|
|
|
<div class="col-md-6"><label>Date de création</label><input id="edit_created_at" readonly class="form-control input-lg"></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
|
|
<button type="submit" class="btn btn-primary" id="btn-save-edit">Enregistrer</button>
|
|
|
|
|
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">Fermer</button>
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- MODAL DELETE -->
|
|
|
|
|
<!-- MODAL DELETE (Agency) -->
|
|
|
|
|
<div class="modal fade" id="deleteModal">
|
|
|
|
|
<div class="modal-dialog">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
|
|
|
|
<h4 class="modal-title">Confirmer la suppression</h4>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
<p>Voulez-vous vraiment supprimer ce compte ?</p>
|
|
|
|
|
<input type="hidden" id="delete_id">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="modal-header"><button type="button" class="close" data-dismiss="modal"><span>×</span></button><h4 class="modal-title">Confirmation</h4></div>
|
|
|
|
|
<div class="modal-body"><p>Voulez-vous vraiment supprimer ce compte ?</p><input type="hidden" id="delete_id"></div>
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
|
|
|
|
|
<button type="button" id="confirmDelete" class="btn btn-danger">Supprimer</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
<!-- jQuery 2.2.4 -->
|
|
|
|
|
<!-- Scripts -->
|
|
|
|
|
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
|
|
|
|
|
|
|
|
|
|
<!-- Bootstrap 3.3.7 -->
|
|
|
|
|
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
|
|
|
|
|
<!-- DataTables -->
|
|
|
|
|
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
|
|
|
|
<script src="https://cdn.datatables.net/1.13.6/js/dataTables.bootstrap.min.js"></script>
|
|
|
|
|
<!-- Slimscroll -->
|
|
|
|
|
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
|
|
|
|
|
<!-- FastClick -->
|
|
|
|
|
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
|
|
|
|
|
<!-- AdminLTE App -->
|
|
|
|
|
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
|
|
|
|
|
<!-- AdminLTE for demo purposes -->
|
|
|
|
|
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
|
|
|
|
|
|
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
|
|
|
|
|
|
|
|
|
|
<!-- Export Scripts -->
|
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
|
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
|
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
|
|
|
|
|
<script src="https://cdn.datatables.net/buttons/2.4.1/js/dataTables.buttons.min.js"></script>
|
|
|
|
|
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.bootstrap.min.js"></script>
|
|
|
|
|
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
|
|
|
|
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.print.min.js"></script>
|
|
|
|
|
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
|
|
|
|
|
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
|
|
|
|
/* =====================================================
|
|
|
|
|
* INITIALISATION DATATABLE
|
|
|
|
|
* ===================================================== */
|
|
|
|
|
// Configuration commune pour l'exportation
|
|
|
|
|
const exportButtonsConfig = [
|
|
|
|
|
'pageLength',
|
|
|
|
|
{
|
|
|
|
|
extend: 'excelHtml5',
|
|
|
|
|
text: '<i class="fa fa-file-excel-o"></i> Excel',
|
|
|
|
|
titleAttr: 'Exporter en Excel',
|
|
|
|
|
className: 'btn btn-success btn-sm',
|
|
|
|
|
exportOptions: { columns: ':not(:last-child)' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
extend: 'csvHtml5',
|
|
|
|
|
text: '<i class="fa fa-file-text-o"></i> CSV',
|
|
|
|
|
titleAttr: 'Exporter en CSV',
|
|
|
|
|
className: 'btn btn-info btn-sm',
|
|
|
|
|
exportOptions: { columns: ':not(:last-child)' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
extend: 'pdfHtml5',
|
|
|
|
|
text: '<i class="fa fa-file-pdf-o"></i> PDF',
|
|
|
|
|
titleAttr: 'Exporter en PDF',
|
|
|
|
|
className: 'btn btn-danger btn-sm',
|
|
|
|
|
orientation: 'landscape',
|
|
|
|
|
pageSize: 'LEGAL',
|
|
|
|
|
exportOptions: { columns: ':not(:last-child)' }
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// TABLEAU 1 : COMPTES AGENCE
|
|
|
|
|
$('#accountsTable').DataTable({
|
|
|
|
|
"pageLength": 10,
|
|
|
|
|
"ordering": true,
|
|
|
|
|
"scrollX": true,
|
|
|
|
|
dom: 'Bfrtip',
|
|
|
|
|
"buttons": [
|
|
|
|
|
'pageLength',
|
|
|
|
|
{
|
|
|
|
|
"extend": 'excelHtml5',
|
|
|
|
|
title: "<?= $this->lang->line('list_bank_accounts') ?>",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
extend: 'csvHtml5',
|
|
|
|
|
title: "<?= $this->lang->line('list_bank_accounts') ?>",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
extend: 'pdfHtml5',
|
|
|
|
|
orientation: 'landscape',
|
|
|
|
|
pageSize: 'LEGAL',
|
|
|
|
|
title: "<?= $this->lang->line('list_bank_accounts') ?>",
|
|
|
|
|
},
|
|
|
|
|
// 'colvis'
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
"scrollX": true,
|
|
|
|
|
"order": [[ 0, "desc" ]],
|
|
|
|
|
dom: "<'row'<'col-sm-6'B><'col-sm-6'f>>" +
|
|
|
|
|
"<'row'<'col-sm-12'tr>>" +
|
|
|
|
|
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
|
|
|
|
buttons: exportButtonsConfig
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// === FLATPICKR ===
|
|
|
|
|
flatpickr("#edit_birth_date",
|
|
|
|
|
{
|
|
|
|
|
// TABLEAU 2 : DEMANDES DE RATTACHEMENT
|
|
|
|
|
$('#linksTable').DataTable({
|
|
|
|
|
"pageLength": 10,
|
|
|
|
|
"ordering": true,
|
|
|
|
|
"scrollX": true,
|
|
|
|
|
"order": [[ 0, "desc" ]],
|
|
|
|
|
dom: "<'row'<'col-sm-6'B><'col-sm-6'f>>" +
|
|
|
|
|
"<'row'<'col-sm-12'tr>>" +
|
|
|
|
|
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
|
|
|
|
buttons: exportButtonsConfig
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Datepicker pour le champ date de naissance
|
|
|
|
|
flatpickr("#edit_birth_date", {
|
|
|
|
|
dateFormat: "Y-m-d",
|
|
|
|
|
maxDate: "today",
|
|
|
|
|
disableMobile: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/* =====================================================
|
|
|
|
|
* OUVERTURE DU MODAL : AUTO-FILL DES DONNÉES
|
|
|
|
|
/* =====================================================
|
|
|
|
|
* LOGIQUE MODAL EDIT (AGENCY) - TOUS CHAMPS RESTAURÉS
|
|
|
|
|
* ===================================================== */
|
|
|
|
|
$(document).on("click", ".open-edit-modal", function () {
|
|
|
|
|
|
|
|
|
|
const fields = [
|
|
|
|
|
"id", "lastname", "firstname", "account_number", "iban", "swift_code",
|
|
|
|
|
"status", "reason", "balance", "birth_date", "birth_country",
|
|
|
|
|
@ -408,102 +514,121 @@ $(document).ready(function () {
|
|
|
|
|
"subsector_activity", "tax_number", "employee_number", "position",
|
|
|
|
|
"employer_name", "employer_address", "created_at", "account_type"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
fields.forEach(f => {
|
|
|
|
|
$("#edit_" + f).val($(this).data(f));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// === ENVOI DU FORMULAIRE DE MISE À JOUR ===
|
|
|
|
|
$("#btn-save-edit").on("click", function (e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "<?= base_url('Gestion/update_request_agency'); ?>",
|
|
|
|
|
type: "POST",
|
|
|
|
|
data: $("#update-form").serialize(),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
|
|
|
|
// Vérification de base
|
|
|
|
|
if (!res) {
|
|
|
|
|
toastr.error("Réponse invalide du serveur");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Si le serveur a envoyé alert = ok
|
|
|
|
|
if (res.alert === "ok") {
|
|
|
|
|
|
|
|
|
|
// Succès total
|
|
|
|
|
if (res.success === "ok") {
|
|
|
|
|
|
|
|
|
|
// Fermer la modal
|
|
|
|
|
$('#editModal').modal('hide');
|
|
|
|
|
|
|
|
|
|
//Afficher reponse
|
|
|
|
|
toastr.success(res.message)
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
location.reload();
|
|
|
|
|
}, 2600);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
// Message d'erreur du serveur
|
|
|
|
|
toastr.errot(res.message);
|
|
|
|
|
}
|
|
|
|
|
if (res && res.success === "ok") {
|
|
|
|
|
$('#editModal').modal('hide');
|
|
|
|
|
toastr.success(res.message);
|
|
|
|
|
setTimeout(() => location.reload(), 1500);
|
|
|
|
|
} else {
|
|
|
|
|
toastr.error(res.message || "Erreur lors de la mise à jour");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
error: function () {
|
|
|
|
|
toastr.error("Erreur interne (500)");
|
|
|
|
|
}
|
|
|
|
|
error: function() { toastr.error("Erreur 500"); }
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/* =====================================================
|
|
|
|
|
* SUPPRESSION : OUVERTURE MODAL
|
|
|
|
|
* LOGIQUE MODAL REVIEW (AGENCY & LINK)
|
|
|
|
|
* ===================================================== */
|
|
|
|
|
$(document).on("click", ".open-review-modal", function () {
|
|
|
|
|
let id = $(this).data("id");
|
|
|
|
|
$("#review_id").val(id);
|
|
|
|
|
const fields = ["lastname", "firstname", "account_number", "iban", "balance", "status", "profession", "employer_name", "sector_activity", "account_type", "birth_date", "birth_country", "birth_city", "nationality", "marital_status"];
|
|
|
|
|
fields.forEach(f => { $("#view_" + f).text($(this).data(f) || "-"); });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function processAgencyRequest(status) {
|
|
|
|
|
let id = $("#review_id").val();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "<?= base_url('Gestion/update_request_agency'); ?>",
|
|
|
|
|
type: "POST",
|
|
|
|
|
data: { id: id, status: status },
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (res) {
|
|
|
|
|
if (res && res.success === "ok") {
|
|
|
|
|
$('#reviewModal').modal('hide');
|
|
|
|
|
toastr.success("Mise à jour effectuée !");
|
|
|
|
|
setTimeout(() => location.reload(), 1500);
|
|
|
|
|
} else { toastr.error(res.message || "Erreur"); }
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
$("#btn-validate-request").click(function() { processAgencyRequest('active'); });
|
|
|
|
|
$("#btn-reject-request").click(function() { processAgencyRequest('rejected'); });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Logique Review LINK
|
|
|
|
|
$(document).on("click", ".open-link-review-modal", function () {
|
|
|
|
|
let id = $(this).data("id");
|
|
|
|
|
$("#link_id_transaction").val(id);
|
|
|
|
|
$("#link_user_code").text($(this).data("user_code"));
|
|
|
|
|
$("#link_fullname").text($(this).data("fullname"));
|
|
|
|
|
$("#link_email").text($(this).data("email"));
|
|
|
|
|
$("#link_phone").text($(this).data("phone"));
|
|
|
|
|
$("#link_bank_name").text($(this).data("bank_name"));
|
|
|
|
|
$("#link_bank_address").text($(this).data("bank_address"));
|
|
|
|
|
$("#link_iban").text($(this).data("iban"));
|
|
|
|
|
$("#link_status").text($(this).data("status"));
|
|
|
|
|
$("#link_created_at").text($(this).data("created_at"));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function processLinkRequest(is_verified_status) {
|
|
|
|
|
let id = $("#link_id_transaction").val();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "<?= base_url('Gestion/update_link_request'); ?>",
|
|
|
|
|
type: "POST",
|
|
|
|
|
data: { id_transaction: id, is_verified: is_verified_status },
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (res) {
|
|
|
|
|
if (res && res.success === "ok") {
|
|
|
|
|
$('#reviewLinkModal').modal('hide');
|
|
|
|
|
toastr.success(res.message || "Statut mis à jour !");
|
|
|
|
|
setTimeout(() => location.reload(), 1500);
|
|
|
|
|
} else { toastr.error(res.message || "Erreur serveur"); }
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
$("#btn-validate-link").click(function() { processLinkRequest(1); });
|
|
|
|
|
$("#btn-reject-link").click(function() { processLinkRequest(2); });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* =====================================================
|
|
|
|
|
* LOGIQUE DELETE
|
|
|
|
|
* ===================================================== */
|
|
|
|
|
window.deleteRequest = function (id) {
|
|
|
|
|
$("#delete_id").val(id);
|
|
|
|
|
$("#deleteModal").modal("show");
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* =====================================================
|
|
|
|
|
* CONFIRMATION SUPPRESSION
|
|
|
|
|
* ===================================================== */
|
|
|
|
|
$("#confirmDelete").click(function () {
|
|
|
|
|
|
|
|
|
|
const id = $("#delete_id").val();
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "<?= base_url('Gestion/delete_request_agency') ?>",
|
|
|
|
|
method: "POST",
|
|
|
|
|
data: { id: id },
|
|
|
|
|
data: { id: $("#delete_id").val() },
|
|
|
|
|
dataType: "json",
|
|
|
|
|
|
|
|
|
|
success: function (response) {
|
|
|
|
|
if (response.success === "ok") {
|
|
|
|
|
|
|
|
|
|
$("#deleteModal").modal("hide");
|
|
|
|
|
toastr.success(response.message);
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
location.reload();
|
|
|
|
|
}, 2600);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
toastr.error(response.message);
|
|
|
|
|
setTimeout(() => location.reload(), 1500);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
error: function () {
|
|
|
|
|
toastr.error("Erreur serveur. (500)");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
|