107 lines
4.0 KiB
PHP
107 lines
4.0 KiB
PHP
<?php
|
|
session_start();
|
|
if (!isset($_SESSION['token'])) {
|
|
$_SESSION['url'] = "users/";
|
|
header("Location: /login/");
|
|
exit();
|
|
}
|
|
$user_id = $_SESSION['user_id'];
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<?php include '../header.php'; ?>
|
|
<script type="text/javascript" class="init">
|
|
$(document).ready(function() {
|
|
$('#example').DataTable({
|
|
// dom: 'Bfrtip',
|
|
// buttons: [
|
|
// 'csv'
|
|
// ],
|
|
responsive: true
|
|
});
|
|
});
|
|
|
|
function confirmDelete(kycID) {
|
|
if (confirm("Are you sure you want to delete this KYC record?")) {
|
|
window.location.href = 'delete-kyc.php?kycID=' + kycID;
|
|
}
|
|
}
|
|
</script>
|
|
|
|
|
|
<body class="dt-example dt-example-bootstrap">
|
|
<nav class="navbar navbar-default">
|
|
<div class="container-fluid">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<a class="navbar-brand" href="#">oBananaPay</a>
|
|
</div>
|
|
|
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
|
<ul class="nav navbar-nav">
|
|
<li><a href="/admin-test.php">Transactions</a></li>
|
|
<li><a href="users-test.php">Users</a></li>
|
|
<li class="active"><a href="#">KYC</a></li>
|
|
<!-- <li class="dropdown">
|
|
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Loan
|
|
<span class="caret"></span></a>
|
|
<ul class="dropdown-menu">
|
|
<li><a href="/loan/">Applications</a></li>
|
|
<li><a href="/loan/transfer.php">Batch Transfer</a></li>
|
|
<li><a href="/loan/payment.php">Payments</a></li>
|
|
</ul>
|
|
</li> -->
|
|
</ul>
|
|
<ul class="nav navbar-nav navbar-right">
|
|
<li><a href="/logout.php">Logout <span class="glyphicon glyphicon-log-out" aria-hidden="true"></span></a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
<div class="container">
|
|
<h1>Know-Your-Customer</h1>
|
|
<?php
|
|
include '../functions-test.php';
|
|
$response = get_kyc();
|
|
$array = json_decode($response, true);
|
|
?>
|
|
<table id="example" class="table table-bordered display responsive nowrap" style="width:100%">
|
|
<thead>
|
|
<tr>
|
|
<th width='1'>User ID</th>
|
|
<th>KYC ID</th>
|
|
<th>Name</th>
|
|
<th>Date of Birth</th>
|
|
<th>ID Number</th>
|
|
<th>Status</th>
|
|
<th> Action </th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
foreach ($array as $x => $val) {
|
|
echo "<tr>";
|
|
echo "<td>" . $val['userRef'] . "</td>";
|
|
echo "<td>" . $val['_id'] . "</td>";
|
|
echo "<td>" . $val['full_name'] . "</td>";
|
|
echo "<td>" . $val['date_of_birth'] . "</td>";
|
|
echo "<td>" . $val['id_num'] . "</td>";
|
|
echo "<td>" . $val['status'] . "</td> ";
|
|
echo "<td>" .
|
|
"<button class='btn btn-info' onclick=location.href='edit-kyc.php?kycID=" . $val['_id'] . "'>Edit</button>" .
|
|
"<button class='btn btn-default' onclick='confirmDelete(\"" . $val['_id'] . "\")'>Delete</button>" .
|
|
"</td>";
|
|
echo "</tr>";
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|