<!-- begin:: Subheader -->
<div class="kt-subheader   kt-grid__item" id="kt_subheader">
<div class="kt-container  kt-container--fluid ">
    <div class="kt-subheader__main">
        <div class="kt-subheader__breadcrumbs">
            <a class="kt-subheader__breadcrumbs-link">
                Users </a>
            <span class="kt-subheader__breadcrumbs-separator"></span>
            <a  class="kt-subheader__breadcrumbs-link">
                All Users </a>
            <span class="kt-subheader__breadcrumbs-separator"></span>
            
        </div>
    </div>
    <div class="kt-subheader__toolbar">
        <?php $user_type = session()->get('user_type');  
          if($user_type==1){
          ?>
        <a href="<?=base_url();?>admin/add_center" class="btn btn-label-brand btn-bold">
            Add User </a>
         <?php } ?>
         <a href="<?=base_url();?>scripts/exportUserData" class="btn btn-label-brand btn-bold">
            <i class="flaticon-download"></i> Export to Excel</a>
    </div>                                        
</div>
</div>
<!-- end:: Subheader -->
<!-- begin:: Content -->
<div class="kt-container  kt-container--fluid  kt-grid__item kt-grid__item--fluid">
   <div class="kt-portlet">
      <div class="kt-portlet__body kt-portlet__body--fit">
       <div class="kt-portlet__body">
        <!--begin: Datatable -->        
          <table class="table table-striped- table-bordered table-hover table-checkable" id="kt_table_1">
                <thead>
                    <tr>                                                    
                        <th>S No.</th>                        
                        <th> Name </th>
                        <th> Mobile</th> 
                        <th> User Name</th>
                        <th> User Email</th>                        
                        <th> University</th>                        
                        <th> Status</th>               
                        <th> Actions</th>                                                  
                    </tr>
                </thead>
                <tbody>
                  <?php $i=1; foreach ($centers_list as $key):?>
                    <tr>
                        <td><?=$i;?></td>                       
                        <td><?=ucfirst($key->name);?></td>
                        <td><?=$key->mobile;?></td>
                        <td><?=$key->user_name;?></td>                        <
                        <td><?=$key->email;?></td>
                        <td><?=$key->work_for;?></td>
                        <td>
                          <?php $user_type = session()->get('user_type'); 
                            if($user_type==1){
                            ?>
                            <?php if($key->status==1){ ?>   
                            <a href="<?=base_url();?>admin/center_status/<?=$key->uid; ?>/2"><p class="kt-badge kt-badge--brand kt-badge--inline kt-badge--pill">Active</p></a>
                            <?php } else { ?>
                                <a href="<?=base_url();?>admin/center_status/<?=$key->uid; ?>/1"><p class="kt-badge  kt-badge--danger kt-badge--inline kt-badge--pill">Inactive</p></a>
                            <?php }} ?>  
                          </td>
                          <td>    
                           <?php if($user_type==1){ ?>                        
                              <a href="<?=base_url();?>admin/edit_user/<?=$key->uid; ?>" class="btn btn-sm btn-clean btn-icon btn-icon-md">
                                  <i class="la la-edit"></i>
                              </a>
                              <a href="javascript:confirmDelete('<?=base_url();?>admin/delete_user/<?=$key->uid; ?>')" class="btn btn-sm btn-clean btn-icon btn-icon-md">                                                                       
                                  <i class="kt-nav__link-icon flaticon2-trash"></i>
                              </a> 
                            <?php } ?>                          
                          </td>
                      </tr>
                      <?php $i++; endforeach ?>                                              
                    </tbody>
            </table>

            <!--end: Datatable -->
        </div>
      </div>
   </div>
</div>
