
</head>
<?php include '../../conn.php'?>
<?php include '../pages/header.php'?>
<?php include '../pages/navbar.php'?>

<!--//////////////////////////////user fetch array///////////////-->
 <?php
           
    $usersql="select * from users order by id desc";
    $userresult = mysqli_query($con,$usersql);
    $usersarry=array(); 
    while($userrow = mysqli_fetch_array($userresult)){
        $usersarry[]=$userrow;
    }
             
 ?>
<!--//////////////////////////////user fetch array///////////////-->
<!-- ///////////////////delete  up funcation////////////////// -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
  function deleteuser(param1){

  $.ajax({
   url: "api/deleteusers.php",
   type: "POST",
   data: "userid=" + param1 ,

   success: function(data)
      {
    // alert(data);
    if(data == 101)
    {
      location.reload(true);
    }
    
    else{
      alert(data);
    }
      }
      ,
     error: function(e) 
      {
   $("#successmessage").html("Some thing went  worng").fadeIn().style.color.red;
      }          
    });
}
</script>
<!-- //////////////////delete   funcation//////////////////////////// -->
<div class="content-wrapper">

<div class="container-fluid">

<div class="row">
<div class="col-sm-12 p-0">
<div class="main-header">
<h4>Users Table</h4>
<ol class="breadcrumb breadcrumb-title breadcrumb-arrow">
<li class="breadcrumb-item">
<a href="#">
<i class="icofont icofont-home"></i>
</a>
</li>
<li class="breadcrumb-item"><a href="#">Users Table</a></li>
</ol>
</div>
</div>
</div>


<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-header">

<a href="addusers.php">
    <button type="button" class="btn btn-primary waves-effect waves-light add"> <i class="fa fa-user-plus"></i> Add Users
</button>
</a>
</div>
<div class="card-block">
<table id="advanced-table" class="table dt-responsive table-striped table-bordered nowrap">
<thead>
<tr>
<th>Image</th>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Image</th>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Action</th>
</tr>
</tfoot>
<tbody>
<?php foreach($usersarry as $data){ ?>    
<tr>
<td><img src='<?php echo $data['image'];?>' height=50; width=50></td>
<td><?php echo $data['name'];?></td>
<td><?php echo $data['email'];?></td>
<td><?php echo $data['phone'];?></td>
<td>
                                        <div class="tabledit-toolbar btn-toolbar" style="text-align: left;">
                                           <div class="btn-group btn-group-sm" style="float: none;">
                                          <a href="editusers.php?id=<?php echo $data['id'];?>"><button type="button" class="tabledit-edit-button btn btn-primary waves-effect waves-light" style="float: none;margin: 5px;"><span class="icofont icofont-ui-edit"></span></button></a> 
                                         <a><button type="button"  onclick="deleteuser(<?php echo $data['id'];?>)" class="tabledit-delete-button btn btn-danger waves-effect waves-light" style="float: none;margin: 5px;"><span class="icofont icofont-ui-delete"></span></button></div></a>
                                           <!--<button type="button" class="tabledit-confirm-button btn btn-sm btn-danger" style="float: none;margin: 5px; background-color:#7D23FA"><i class="fa fa-reorder"></i></span></button></div>-->
                                           
                                           <!--<button type="button" class="tabledit-save-button btn btn-sm btn-success" style="display: none; float: none;">Save</button>-->
                                           <!--<button type="button" class="tabledit-confirm-button btn btn-sm btn-danger" style="display: none; float: none;">Confirm</button>-->
                                           <!--<button type="button" class="tabledit-restore-button btn btn-sm btn-warning" style="display: none; float: none;">Restore</button>-->
                                        </div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

</div>
</div>




<?php include '../pages/footer.php'?>


