<ul class="breadcrumb">
    <li><a href="<?= site_url('admin/dashboard') ?>">Home</a></li>
   <li class="active"><?php echo $breadcum ?></li> 
</ul>
<div class="page-content-wrap">                
                  <div class="row">
                        <div class="col-md-12">
                            <div class="panel panel-default">
                                <?php if ($this->session->flashdata('AdminSuccess')) { ?>  
                                    <div class="alert alert-success"> <?= $this->session->flashdata('AdminSuccess') ?></div>
                                <?php } if ($this->session->flashdata('AdminError')) { ?>  
                                    <div class="alert alert-danger"> <?= $this->session->flashdata('AdminError') ?></div>
                                <?php } ?>
                                <div class="panel-heading">
                                    <h3 class="panel-title">Manage Admin</h3>
                                    <ul class="panel-controls" style="margin-top: 2px;">                                     
                                        <li class="dropdown">
                                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="fa fa-cog"></span></a>                                        
                                            <ul class="dropdown-menu">
                                                <li><a href="<?= base_url()?>admin/admin-add"><span class="fa fa-plus-square"></span>Add New</a></li>
                                             
                                            </ul>                                        
                                        </li>                                        
                                    </ul>
                                </div>

                               <div class="panel-body">
                    <div class="table-responsive">
                        <table class="table datatable">
                                            <thead>
                                                <tr>
                                                    <th>User Name</th>
                                                    <th>Phone</th>
                                                    <th>Email</th>
                                                    <th>Department</th>
                                                    <th>Status</th>
                                                    <th>actions</th>
                                                </tr>
                                            </thead>
                                            <tbody>   
                                                 <?php                                            
                                                    foreach ($admin_data as $key=>$admin) {
                                                        ?>
                                                <tr id="trow">
                                                    <td><strong><?php echo (isset($admin['username'])) ? $admin['username'] : '-'; ?></strong></td>
                                                    <td><?php echo (isset($admin['phone'])) ? $admin['phone'] : '-'; ?></td>
                                                    <td><?php echo (isset($admin['email'])) ? $admin['email'] : '-'; ?></td>
                                                    <td><?php echo (isset($admin['department'])) ? $admin['department'] : '-'; ?></td>
                                                    <td><?php echo (isset($admin['status'])) && $admin['status'] == 'active' ? "<span class='label label-success'>Active" : "<span class='label label-danger'>Inactive"; ?></td>
                                                    <td>
                                            <?php echo anchor(base_url() . 'admin/admin-edit/' . $admin['id'], '<span class="fa fa-pencil" title="Edit"></span>', 'class="btn btn-default btn-rounded btn-condensed btn-sm"'); ?>                                                       
                                                 <?php if ($admin['id'] != '1') { ?>
                                                <?php if ($admin['status'] == 'active') { ?>
                                                      <a href="javascript:" data-href="<?= base_url() . 'admin/admin-status/' . $admin['id'] . '/inactive' ?>" class="btn btn-default btn-rounded btn-condensed btn-sm changestatus"><span class="fa fa-ban" title="Inactive"></span></a>
                                                <?php } else { ?>    
                                                    <a href="javascript:" data-href="<?= base_url() . 'admin/admin-status/' . $admin['id'] . '/active' ?>" class="btn btn-default btn-rounded btn-condensed btn-sm changestatus"><span class="fa fa-check-circle-o" title="Active"></span></a>
                                                <?php } ?>
                                                <a href="javascript:" data-href="<?= base_url() . 'admin/admin-delete/' . $admin['id'] ?>" class="btn btn-danger btn-rounded btn-condensed btn-sm delete"><span class="fa fa-times" title="delete"></span></a>
                                          <?php } ?>
                                           </td>                                              
                                    </tr>    
                                                  <?php }?>
         
                                            </tbody>
                                        </table>
                                    </div>                                

                                </div>
                            </div>                                                

                        </div>
                    </div>
</div>

                        