<?php
include "../config/config.php";
$ids = $_GET['id'];
    $statement = $pdo->prepare("SELECT e.*,tbl_role.role_name FROM tbl_users e 
                                LEFT JOIN tbl_role ON e.role=tbl_role.id 
                                WHERE e.id=".$ids);
    $statement->execute();
    $datas = $statement->fetchAll(PDO::FETCH_ASSOC);
    $totalData = $statement->rowCount();

if($totalData==1){
    
    if($datas[0]['status']==1){
        $status = "<span class='btn btn-success btn-xs'>Active</span>";
    }else if($datas[0]['status']==0){
        $status = "<span class='btn btn-danger btn-xs'>In-Active</span>";
    }
    
?>   
<style>
.modal-open .modal {
    overflow-x: hidden;
    overflow-y: hidden;
}
</style>
<style>
  #user_table {
  max-width: 960px;
  margin: 10px auto;
}

caption {
  font-size: 1.6em;
  font-weight: 400;
  padding: 10px 0;
}

.user_tr {
    background: bisque;
    border-bottom: 1px solid #FFF;
    margin-bottom: 5px;
    border: 1px solid #e5cfcf;
}

tr:nth-child(even) {
  background: #e8eeef;
}

th, td {
    text-align: center;
    padding: 10px;
    font-weight: 800;
}

tfoot tr {
  background: none;
}

tfoot td {
  padding: 10px 2px;
  font-size: 0.8em;
  font-style: italic;
  color: #8a97a0;
}

</style>

 
    <link href='https://fonts.googleapis.com/css?family=Nunito:400,300' rel='stylesheet' type='text/css'>
   

<div class="modal-dialog modal-lg" role="document" id="add_modal" style="overflow-x: hidden; overflow-y: hidden;">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title mt-0" id="myLargeModalLabel"><b>View Users Details</b></h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-top: -25px;"><i class="fa fa-times"></i></button>
            </div>
            
            <form id="add_form" method="post">
            <input type="hidden" name="ids" value="<?=$ids?>">
            <div id="content-div">
            
            
            
            
            <div class="modal-body" style="padding: 20px 40px 20px 40px;">
    <table style="width: 100%;" id="user_table">
            <tbody>
                <tr class="user_tr">
                  <td scope="row">Name</td>
                  <td><?=$datas[0]['name']?></td>
                </tr>
                <tr class="user_tr">
                  <td scope="row">Mobile Number</td>
                  <td><?=$datas[0]['mobile']?></td>
                </tr>
                <tr class="user_tr">
                  <td scope="row">Employee Code</td>
                  <td><?=$datas[0]['emp_code']?></td>
                </tr>
                <tr class="user_tr">
                  <td scope="row">Role</td>
                  <td><?=$datas[0]['role_name']?></td>
                </tr>
                <tr class="user_tr">
                  <td scope="row">Email</td>
                  <td><?=$datas[0]['email']?></td>
                </tr>
                <tr class="user_tr">
                  <td scope="row">Username</td>
                  <td><?=$datas[0]['username']?></td>
                </tr>
                <tr class="user_tr">
                  <td scope="row">Password</td>
                  <td><?=$datas[0]['password']?></td>
                </tr>
                <tr class="user_tr">
                  <td scope="row">Status</td>
                  <td><?=$status?></td>
                </tr>
            </tbody>
    </table>

            </div>
            
            <div class="modal-footer">
                <button class="btn btn-primary" data-dismiss="modal">Close</button>
            </div>
            
            
            </div>
            </form>
            
            
            
            <div id="loading-div" style="display: none; padding-bottom: 80px;">
                    <center> <img src="img/loading.gif" style="width: 250px;"><br><b class="blinking">Processing Please Wait...</b></center>
            </div>
            
            
            
        </div>
    </div>
<?php } ?>
