<?php $is_owner = $this->db->get_where('admin' , array('admin_id' => $this->session->userdata('login_user_id')))->row()->owner_status;
$client_id=$this->db->get_where('admin', array('admin_id' => $this->session->userdata('login_user_id')))->row()->client_id;
//$id=$this->db->get_where('admin', array('admin_id' => $this->session->userdata('login_user_id')))->row()->admin_id;
?>
<div class="content-w">
	<ul class="breadcrumb hidden-xs-down hidden-sm-down">
		<div class="back">
			<a href="<?php echo base_url();?>admin/admins/"><i class="os-icon os-icon-common-07"></i></a>
		</div>
	</ul>
  <div class="content-i">
    <div class="content-box">
    <div class="row">


<div class="tab-pane active" id="admins">
    <div class="col-lg-12">
    <div class="element-wrapper">
      <div class="element-box shadow lined-primary">
        <div class="table-responsive">
        <table id="dataTable1" width="100%" class="table table-striped table-lightfont">
          <thead>
            <tr>
              <th><?php echo get_phrase('name');?></th>
              <th><?php echo get_phrase('username');?></th>
              <th><?php echo get_phrase('email');?></th>
            
              <th><?php echo get_phrase('account_type');?></th>
              <th><?php echo get_phrase('options');?></th>
            </tr>
          </thead>
          <tbody>
          <?php //$admins = $this->db->get('admin')->result_array();
          $admins = $this->db->get_where('admin', array('client_id' =>$client_id))->result_array();
          foreach($admins as $row):
          ?>
            <tr>
              <td><img alt="" src="<?php echo base_url();?>uploads/admin_image/<?php echo $row['client_id'];?>.jpg" width="25px" style="border-radius: 10px;margin-right:5px;"> <?php echo $row['name']; ?></td>
              <td style="text-align: center;"><?php echo $row['username']; ?></td>
              <td style="text-align: center;"><?php echo $row['email']; ?></td>
             
              <td style="text-align: center;">
              <?php if($row['owner_status'] == 1):?>
                <div class="pt-btn">
                  <a class="btn nc btn-secondary btn-sm btn-rounded"><font color="white"><?php echo get_phrase('super_admin');?></font></a>
                </div>
              <?php endif;?>
              <?php if($row['owner_status'] == 3):?>
                <div class="pt-btn">
                  <a class="btn nc btn-success btn-sm btn-rounded"><font color="white"><?php echo "Customer User";?></font></a>
                </div>
              <?php endif;?>
              </td>
              <td>
              <?php if($this->session->userdata('login_user_id') != $row['admin_id']):?>
                <a href="<?php echo base_url();?>admin/admin_profile/<?php echo $row['admin_id'];?>/"><button class="btn btn-primary btn-rounded btn-sm"><i class="os-icon os-icon-user-male-circle"></i> <?php echo get_phrase('profile');?></button></a>
              <?php endif;?></td>
              <td>
              <?php if($this->db->get_where('admin', array('admin_id' => $this->session->userdata('login_user_id')))->row()->owner_status == 1):?>
                <a onClick="return confirm('<?php echo get_phrase('confirm_delete');?>')" href="<?php echo base_url();?>admin/admins/delete/<?php echo $row['admin_id'];?>"><button class="btn btn-danger btn-sm btn-rounded"><i class="picons-thin-icon-thin-0056_bin_trash_recycle_delete_garbage_empty"></i> <?php echo get_phrase('delete');?></button></a>
              <?php endif;?>
              </td>
            </tr>
          <?php endforeach;?>
          </tbody>
        </table>
        </div>
      </div>
      </div>
    </div>
    </div>
      </div>
    </div>
  </div>
</div>