-
Notifications
You must be signed in to change notification settings - Fork 0
/
users.php
59 lines (59 loc) · 2.01 KB
/
users.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
<?php
session_start();
if(!isset($_SESSION['email']) || !isset($_SESSION['sessionid'])){
header('Location: login.php');
}
include('classes/User.php');
$user_type=$_SESSION['user_type'];
$x = "users";
?>
<?php include('includes/header.php'); ?>
<?php include('includes/topBar.php'); ?>
<div class="row" id="sideMenuDiv">
<?php include('includes/lendingMenu.php'); ?>
<div class="col-sm-10" id="pageContent">
<br/><br/>
<?php
if(isset($_SESSION['add_success'])){
echo $_SESSION['add_success'];
unset($_SESSION['add_success']);
}
?>
<h3>List of Users </h3>
<table class="table table-bordered">
<thead>
<th>SL </th>
<th>User Name</th>
<th>Name </th>
<th>Address</th>
<th>Completed Searches</th>
<th>Incomplete Searches</th>
<th>Type of User</th>
<th>Status </th>
</thead>
<tbody>
<?php
$count = 1;
$us = new User();
$results = $us->getUserList();
foreach($results as $res){
$completed = $us->getNbCompletedSearches($res['UserID']);
$incomplete = $us->getNbIncompleteSearches($res['UserID']);
if($res['TypeOfUser']==1){ $usertype = 'Appraiser';} else if($res['TypeOfUser']==2){ $usertype="Loan Officer"; }else{continue;}
if($res['Active']==1){ $status = "<span class='btn btn-info'> Active </span>";} else if($res['Active']==0) { $status = "<span class='btn btn-danger'>Inactive</span>"; }
echo '<tr><td>'.$count.'</td><td><a href="viewuser.php?id='.$res['UserID'].'">'.$res['UserName'].'</a></a></td><td>'.$res['Name'].'</td><td>'.$res['Address'].'</td>';
if($completed>0){
echo '<td><a href="viewcompleted.php?id='.$res['UserID'].'" style="text-decoration:underline;">'.$completed.'</a></td>';
}else{
echo '<td>'.$completed.'</td>';
}
echo '<td>'.$incomplete.'</td><td>'.$usertype.'</td><td>'.$status.'</td></tr>';
$count++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
<?php include('includes/footer.php'); ?>