Your IP : 18.221.221.171
<?php
session_start();
include("lib/connect.inc.php");
$uid = $covis->Uid();
$stage = $covis->stageCalc($uidx);
$lev = $covis->stageLevel($uidx);
if(isset($_SESSION['report'])){$report = $_SESSION['report']; }
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Loan App</title>
<link rel="shortcut icon" href="img/fav.png" />
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Font Awesome -->
<?php include('head.php'); ?>
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
<?php include('nav.php'); ?>
<!-- Content Wrapper. Contains page content -->
<!-- Content Header (Page header) -->
<!-- Content Header (Page header) -->
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Loan Application</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item active">Loan Application</li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Content Header (Page header) -->
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header text-white bg-dark">
<h5> Loan Application</h5>
</div>
<!-- <h2 class="card-title">
Referral
</h2> -->
<br/>
<div id="refresh"><?php if(isset($report)){$covis->Alert(); } ?></div>
<div class="card-body">
<div class="col-md-6">
<h6>Covis Club International now offers loans to members in Stage 2, Level 2 and above </h6>
<b>NOTE</b><br>
1. Loans attract monthly interest of 10% <br>
2. You can access up to twice your savings<br><br>
<p><h5>Current Loan Potential: $<?php $max=$covis->loanPotential($uid); echo $max; ?></h5>
<br><i>This is the maximum loan you can access right now based on your level and cummulative savings</i></p>
</div>
<div class="col-md-6">
<?php if($covis->activeLoan($uid)==0){ ?>
<form class="form-group" method="post">
How much do you want?
<input type="number" min="1" max="<?php echo (int)$max ?>" class="form-control" name="amount" placeholder="Amount in Dollars (Min: $1)" required/> <br/>
<select name="duration" class="form-control" required>
<option value="">SELECT LOAN TENURE...</option>
<option value="30">30 Days</option>
<option value="60">60 Days</option>
<option value="90">90 Days</option>
</select>
<br>
<input type="password" class="form-control" name="authenticate" placeholder="Enter Password" required/> <br/>
<br/>
<button class="btn btn-success float-md-right" name="LoanApplication">Submit Loan Application</button>
<br/><br/>
</form>
<?php }else{ ?>
<h5>All previous loan applications must be settled before applying for a new one.</h5>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header text-white bg-dark">
<h5> Loan History</h5>
</div>
<br/>
<div class="card-body">
<div class="col-md-12">
<table class="table table-bordered table-hover">
<tr>
<th>S/N</th>
<th>Transaction ID</th>
<th>Amount($)</th>
<th>Duration</th>
<th>Interest</th>
<th>Status</th>
<th>Application Date</th>
<th>Activation Date</th>
<th>Expiry Date</th>
<th>Action</th>
</tr>
<?php
$sql = $db->query("SELECT * FROM myloan WHERE id='$uid' ORDER BY created DESC"); $i = 0; $sum = 0; $int=0;
while($row = $sql->fetch_assoc()){ $i +=1; $sum += $row['amount']; $int += $row['amount']*0.02*age($row['ctime']);
$status = 'Complete';
?>
<tr>
<td><?php echo $i ?></th>
<td><?php echo $row['tno'] ?></th>
<td>$<?php echo $row['amount'] ?></th>
<td><?php echo $row['duration'] ?> Days</th>
<td>$<?php echo $row['interest'] ?></th>
<td><?php echo $covis->loanStatus($row['status']) ?></th>
<td><?php echo date("jS M, Y H:i", strtotime($row['created'])) ?></th>
<td><?php echo $row['ctime']>0 ? date("jS M, Y H:i",$row['ctime']) : ''; ?></th>
<td><?php echo $row['loandue']>0 ? date("jS M, Y H:i",$row['loandue']) : ''; ?></th>
<td><form method="post">
<input type="hidden" name="status" value="<?php echo $row['status'] ?>">
<?php if($row['status']<3){ ?>
<button type="submit" class="btn-danger btn" name="LoanCancel" value="<?php echo $row['sn'] ?>">CANCEL LOAN</button>
<?php }elseif($row['status']==3){ ?>
BALANCE: $<?php echo $covis->totalEarnings($covis->idToKey($row['id'])); ?>
<button type="submit" class="btn-success btn" name="LoanRepay" value="<?php echo $row['sn'] ?>">REPAY LOAN</button>
<?php } ?>
</form></th>
</tr>
<?php } ?>
<!-- <tr>
<th colspan="2">TOTAL SAVINGS</th>
<th colspan="3">$<?php echo $sum ?></th>
</tr>
<tr>
<th colspan="2">SAVINGS INTEREST</th>
<th colspan="3">$<?php echo $int ?></th>
</tr> -->
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- /.card-header -->
<!-- /.card-body -->
<!-- /.content-wrapper -->
<?php include('foot.php'); ?>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<!-- jQuery -->
<script src="../plugins/jquery/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="../plugins/jquery-ui/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
$.widget.bridge('uibutton', $.ui.button)
</script>
<!-- Bootstrap 4 -->
<script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- ChartJS -->
<script src="../plugins/chart.js/Chart.min.js"></script>
<!-- Sparkline -->
<script src="../plugins/sparklines/sparkline.js"></script>
<!-- JQVMap -->
<script src="../plugins/jqvmap/jquery.vmap.min.js"></script>
<script src="../plugins/jqvmap/maps/jquery.vmap.usa.js"></script>
<!-- jQuery Knob Chart -->
<script src="../plugins/jquery-knob/jquery.knob.min.js"></script>
<!-- daterangepicker -->
<script src="../plugins/moment/moment.min.js"></script>
<script src="../plugins/daterangepicker/daterangepicker.js"></script>
<!-- Tempusdominus Bootstrap 4 -->
<script src="../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
<!-- Summernote -->
<script src="../plugins/summernote/summernote-bs4.min.js"></script>
<!-- overlayScrollbars -->
<script src="../plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
<!-- AdminLTE App -->
<script src="../dist/js/adminlte.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="../dist/js/pages/dashboard.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../dist/js/demo.js"></script>
<!-- DataTables -->
<script src="../plugins/datatables/jquery.dataTables.min.js"></script>
<script src="../plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="../plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="../plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
<!-- page script -->
<script>
$(function () {
$("#example1").DataTable({
"responsive": true,
"autoWidth": false,
});
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false,
"responsive": true,
});
});
</script>
</body>
</html>