-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloandetails.php
114 lines (96 loc) · 3.66 KB
/
loandetails.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
session_start();
if(isset($_SESSION['name']));
?>
<!DOCTYPE html>
<html>
<head>
<title>
</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/fontawesome.min.css">
<link rel="stylesheet" href="mydetails.css">
</head>
<body>
<div class="full-page">
<div class="navbar">
<div>
<a href=''>
<?php echo "Check your loan details below ".($_SESSION['role'] == 2 ? " ".$_SESSION['username'] : $_SESSION['username'])."!" ?>
</a>
</div>
<div><a href="">
<button type="button" class="btn btn-outline-primary">Download PDF</button></a>
<a href="loandetails.php">
<button type="button" class="btn btn-outline-primary">View Loan Details</button></a>
</div>
</div>
<h1 align="center" style="color:deepskyblue;">My loan Details</h1>
<br>
<div class="card-body">
<div class ="table-responsive">
<div class="container-fluid">
<form action=""method="POST">
<input type="text"name="clientid"placeholder="Enter Client ID"/>
<input type="submit"name="search"value="SEARCH BY CLIENT ID">
</form>
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Loan ID</th>
<th scope="col">Loan Status</th>
<th scope="col">Application Date</th>
<th scope="col">Purpose</th>
<th scope="col">Loan Amount</th>
<th scope="col">Reference Number</th>
</tr>
</thead>
<tbody>
<?php
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
include('./db_connect.php');
if(isset($_POST['search']))
{
$clientid=$_POST['clientid'];
$query="SELECT * FROM loans where clientID ='$clientid'";
$connect=mysqli_query($conn,$query);
while($row= mysqli_fetch_array($connect))
{
?>
<tr>
<td> <?php echo $row['loanID'];?> </td>
<td class="text-center">
<?php if($row['loan_status'] == 0): ?>
<span class="badge badge-warning">For Approval</span>
<?php elseif($row['loan_status'] == 1): ?>
<span class="badge badge-info">Approved</span>
<?php elseif($row['loan_status'] == 2): ?>
<span class="badge badge-primary">Released</span>
<?php elseif($row['loan_status'] == 3): ?>
<span class="badge badge-success">Completed</span>
<?php elseif($row['loan_status'] == 4): ?>
<span class="badge badge-danger">Denied</span>
<?php endif; ?>
</td>
<td> <?php echo $row['application_date'];?> </td>
<td> <?php echo $row['purpose'];?> </td>
<td> <?php echo $row['loan_amount'];?> </td>
<td> <?php echo $row['ref_number'];?> </td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
<div><a href="Client.php">
<button type="button" class="btn">Go Back</button></a>
</div>
</div>
</div>
</body>
</html>