File "users.php"

Full Path: /home/sasslijg/public_html/admin/users.php
File size: 9.78 KB
MIME-type: text/x-php
Charset: utf-8

<?php
include("header.php");

$query="SELECT * from signup ";
$users=db::getRecords($query);
?>

<section id="breadcrumb-alignment">
    <div class="row">
        <div class="col-sm-12">
            <div class="card">
                <div class="card-body">
                    <div class="d-flex justify-content-between breadcrumb-wrapper">
                        <nav aria-label="breadcrumb ">
                            <ol class="breadcrumb mt-2">
                                <li class="breadcrumb-item"><a href="javascript:void(0)"><i class='bx bx-home-alt mx-1'></i>Dashboard</a></li>
                                <li class="breadcrumb-item"><a href="javascript:void(0)">Users</a></li>
                            </ol>
                        </nav>

                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!-- Breadcrumb Alignment Ends -->

<div class="card">
    <div class="card-body">
        <!-- Row grouping -->
        <section id="row-grouping-datatable">
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-title">
                            <h2 class="mb-0 text-center h1 text-primary uppercase">Users</h2>
                        </div>
                        <hr>
                        <div class="card-datatable">
                            <div class="table-responsive">
                                <table id="example" class="table table-bordered" style="width:100%">
                                    <thead>
                                        <tr>
                                             <th class="text-center">Id</th>
                                             <th class="text-center">User Name</th>
                                             <th class="text-center">Email</th>
                                             <th class="text-center">Phone</th>
                                             <th class="text-center">Status</th>
                                             <th class="text-center">Actions</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php
                                        $counter=0;
                                        if($users!=NULL)
                                        {
                                             foreach($users as $user)     
                                             {
                                                 $counter++;
                                                 
                                                ?>
                                        <tr>
                                            <td class="text-center" ><?php echo $counter; ?> </td>

                                            <td class="text-center" ><?php echo $user['name']?> </td>

                                            <td class="text-center"><?php echo $user['email']?></td>
                                            
                                            <td class="text-center"><?php echo $user['phone']?></td>

                                            <?php
                                                    $status=$user['status'];
                                                 if($status==1){
                                                     
                                                 
                                                    ?>
                                            <td class="text-center"><div class=" badge badge-glow badge-pill badge-success">Authorized</div> </td>
                                            <?php
                                                 }else{
                                                     ?>
                                            <td class="text-center"><div class=" badge badge-glow badge-pill badge-danger">UnAuthorized</div> </td>
                                                     <?php
                                                 }
                                                 
                                                     ?>
                                            <td class="text-center ">
                                                <div class="btn-group" role="group" aria-label="Basic example">
                                                    <span data-toggle="modal"  data-target="#edit_status_modal<?php echo $user['id']?>">
                                                        <button data-toggle="popover" data-trigger="hover" data-original-title="Edit User Status" type="button"  class="btn btn-linkedin text-center bg-danger bg-darken-2 mr-1 text-white  float-left" ><i class="fa fa-edit "></i></button>
                                                    </span>
                                                </div>

                                                <!-- Modal -->
                                                <div id="edit_status_modal<?php echo $user['id']?>" class="modal fade" data-backdrop="false" tabindex="-1" role="dialog" aria-hidden="true">
                                                    <div class="modal-dialog modal-dialog-centered" role="document">
                                                        <div class="modal-content radius-30">
                                                            <div class="modal-header bg-info border-bottom-0">
                                                                <h4 class="modal-title my-1" >Details</h4>
                                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                                    <span aria-hidden="true">&times;</span>
                                                                </button>
                                                            </div>
                                                            <div class="modal-body p-5">
                                                                <form action="action.php" method="post" enctype="multipart/form-data">
                                                                    <div class="form-group">
                                                                        <label class="h4">Access Revoked</label>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <div class="custom-control custom-control-success custom-switch mb-3">
                                                                            <?php
                                                         $status = $user['status'];
                                                 if ($status == 1) {
                                                                            ?>
                                                                            <input type="checkbox" name="status" value="1" checked class="custom-control-input" id="<?php echo $user['id']; ?>">
                                                                            <label class="h4 custom-control-label" data-label-off="NO" data-label-on="YES" for="<?php echo $user['id']; ?>">Status</label>
                                                                            <?php } else {
                                                                            ?>
                                                                            <input type="checkbox" name="status" value="1"  class="custom-control-input" id="<?php echo $user['id']; ?>">
                                                                            <label class="h4 custom-control-label" data-label-off="NO" data-label-on="YES" for="<?php echo $user['id']; ?>">Status</label>
                                                                            <?php } ?>
                                                                        </div>
                                                                    </div>
                                                                    <input type="text" value="<?php echo $user['id']?>" name="id" hidden>
                                                                    <hr/>
                                                                    <div class="form-group">
                                                                        <button type="submit" class="btn btn-primary float-right  btn-lg " name="edit_customer_access">Update Access</button>
                                                                    </div>
                                                                </form>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>


                                                
                                            </td>
                                        </tr>
                                        <?php
                                             }
                                        }
                                            ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!--/ Row grouping -->

    </div>
</div>




<?php

include("footer.php");

?>