<?php
$session_data = $this->session->userdata('session_data');

 $role = $session_data['role'];
$profileImage = $session_data['profileImage'];
$name = $session_data['name'];
$email=$session_data['email'];
?>

<!-- Begin Page Content -->
<div class="container-fluid">
    <div class="row column_title">
        <div class="col-md-12">
            <div class="page_title">
                <h2>Admin Users</h2>
            </div>
        </div>
    </div>

    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <!-- <h6 class="m-0 font-weight-bold text-primary">DataTables Example</h6> -->
            <button type="button" style="float:right" onclick="location.href='<?= base_url() . 'admin/addAdmin' ?>'" class="btn btn-primary">Add Admin</button>
        </div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-bordered" id="songTable" width="100%" cellspacing="0">
                    <thead class="thead-dark">
                        <tr>
                            <th>Role</th>
                            <th>Name</th>
                            <th>Email</th>
                            <th>Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        if (!empty($admins)) {
                            $count = 1;
                            foreach ($admins as $id => $admin) {
                                 if($admin['email'] ==$email){
                                     continue;
                                 }
                        ?>
                        <tr>
                            <td><?php echo output($admin['role']); ?></td>
                            <td> <?php echo output($admin['name']); ?></td>
                            <td><?php echo output($admin['email']); ?></td>



                            <td>
                                <!-- <?php if ($customerlists["isActive"] == false) {
                                                ?>
                                            <a class="icon" style="text-decoration: none;" href="<?php echo base_url(); ?>customer/unSuspendCustomer/<?php echo output($id); ?>">
                                                <button class="btn btn-success btn-block mt-2">Activate</button>
                                            </a>
                                        <?php
                                                } else {
                                        ?>
                                            <a class="icon" style="text-decoration: none;" href="<?php echo base_url(); ?>customer/suspendCustomer/<?php echo output($id); ?>">
                                                <button class="btn btn-warning btn-block mt-2">Suspend</button>
                                            </a>
                                        <?php
                                                } ?> -->
                                <a class="icon" style="text-decoration: none;" href="<?php echo base_url(); ?>admin/editAdmin/<?php echo output($id); ?>">
                                    <button class="btn btn-info btn-block mt-2">Edit</button>
                                </a>
                                <a class="icon" style="text-decoration: none;" href="<?php echo base_url(); ?>admin/deleteAdmin/<?php echo output($id); ?>">
                                    <button class="btn btn-danger btn-block mt-2">Delete</button>
                                </a>
                            </td>
                        </tr>
                        <?php }
                        } ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

</div>
<!-- /.container-fluid -->