<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>Status </th> </thead> <tbody> <?php $count = 1; $us = new User(); $results = $us->getAppraiserList($_GET['id']); 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>'.$completed.'</td>'; }else{ echo '<td>'.$completed.'</td>'; } echo '<td>'.$incomplete.'</td><td>'.$status.'</td></tr>'; $count++; } ?>