-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloan_schedule.php
91 lines (84 loc) · 3.01 KB
/
loan_schedule.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php include'lib/dbh.php'?>
<section class="content py-5">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card card-success">
<div class="card-header">
<h3 class="card-title">Payment Schedule</h3>
<div class="card-tools">
</div>
</div>
<!-- /.card-header -->
<div class="card-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>Loan Id</th>
<th>Month</th>
<th>Monthly Payment</th>
<th>Monthly Interest</th>
<th>Monthly Principal</th>
<th>Remaining Loan Amount</th>
<th>Total Paid</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$qry = $conn->query("SELECT * FROM loan_schedule WHERE loan_id={$_GET['id']};");
while($row= $qry->fetch_assoc()):
?>
<tr>
<td><?php echo $row['loan_id']; ?></td>
<td><?php echo $row['month']; ?></td>
<td><?php echo $row['monthly_payment']; ?></td>
<td><?php echo $row['monthly_interest']; ?></td>
<td><?php echo $row['monthly_principal']; ?></td>
<td><?php echo $row['remaining_loan_amount']; ?></td>
<td><?php echo $row['total_paid']; ?></td>
</tr>
<?php endwhile; ?>
</tbody>
<tfoot>
<tr>
<th>Loan Id</th>
<th>Month</th>
<th>Monthly Payment</th>
<th>Monthly Interest</th>
<th>Monthly Principal</th>
<th>Remaining Loan Amount</th>
<th>Total Paid</th>
</tr>
</tfoot>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.content -->
<script>
$(document).ready(function(){
$('#list').dataTable()
$("#example1").DataTable({
"responsive": true, "lengthChange": false, "autoWidth": false,
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
}).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false,
"responsive": true,
});
})
</script>