<?php 

ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);

include("config.php"); 
include 'inc/header.php'; 
include("functions.php"); 

$all_admins = get_all_admins("all");

?>


    <!--== BODY CONTNAINER ==-->
    <div class="container-fluid sb2">
        <div class="row">
            <?php include 'inc/sidebar.php';?>
            <div class="sb2-2">
                <div class="sb2-2-2">
                    <ul>
                        <li><a href="dashboard.php"><i class="fa fa-home" aria-hidden="true"></i> Home</a>
                        </li>
                        <li class="active-bre"><a href="#"> All Admins</a>
                        </li>
                    </ul>
                </div>
                <div class="sb2-2-3">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="box-inn-sp">
                                <div class="inn-title">
                                    <h4>All Admins</h4>
                                    <!-- <p>They are operator of the app and can add/delete/update feedbacks.</p> -->
                                    <a class="dropdown-button drop-down-meta" href="#" data-activates="dr-users"><i class="material-icons">more_vert</i></a>
                                    <ul id="dr-users" class="dropdown-content">
                                        <li><a href="add-new-admin.php">Add New</a>
                                        </li>
                                        <li><a href="all-admins.php">View All</a>
                                        </li>
                                    </ul>

                                    <!-- Dropdown Structure -->

                                </div>
                                <div class="tab-inn">
                                    <div class="table-responsive table-desi">
                                        <table class="table table-hover">
                                            <thead>
                                                <tr>
                                                    <th>ID</th>
                                                    <th>Name</th>
                                                    <th>Email</th>
                                                    <!-- <th>View</th> -->
                                                    <th>Edit</th>
                                                    <th>Delete</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <?php
                                                     $ccc=1;
                                                     while($row=mysqli_fetch_assoc($all_admins)){
                                                  ?>
                                                <tr>
                                                    <td><?=$ccc;?></td>
                                                    <td><?=$row['fname'].' '.$row['lname'];?></td>
                                                    <td><?=$row['email'];?></td>
                                                    <!-- <td>
                                                        <a href="listing-edit.html"><i class="fa fa-eye" aria-hidden="true"></i></a>
                                                    </td> -->
                                                    <td>
                                                        <a href="add-new-admin.php?user_id=<?=$row['id'];?>"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a>
                                                    </td>
                                                    <td>
                                                        <a href="ajax-request.php?user-delete-request=1&user_id=<?=$row['id'];?>"><i class="fa fa-trash-o" aria-hidden="true"></i></a>
                                                    </td>
                                                </tr>
                                                <?php
                                                 $ccc++;
                                                 }
                                                ?>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php include 'inc/footer.php';?>