<div class="col-sm-12  " align="right">

    <div class="tool-bar margin">
        <div class="row">
            <a href="<?php echo $this->url('staff', array('action' => 'add-staff')); ?>" class="back_btn_link btn btn-primary pull-right"><i class="fa fa-plus"></i> Add</a>

        </div>
    </div>
</div>
<section class="content">
    <div class="row">
        <div class="col-sm-12">


            <div class="panel panel-default">
                <div class="panel-headingnew"> View/Update Records </div>
                <div id="faq-1-3" class="panel-collapse collapse in" aria-expanded="false">
                    <div class="box">

                        <table id="myTable" class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th>S.No</th>
                                    <th>First Name</th>
                                    <th>Last Name</th>
                                    <th>Email</th>
                                    <th>Assign Module Name</th>
                                    <th>Mobile</th>
                                    <th>Role</th>
                                    <th>Department</th>
                                    <th>Status</th>
                                    <th>Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                  <?php if(!empty($result)){

                                      $i=1;
                                            foreach($result as $key=>$val){

                                        ?>
                                <tr>
                                    <td><?php echo $i; ?></td>
                                    <td><?php echo $val['first_name']; ?></td>
                                    <td><?php echo $val['last_name']; ?></td>
                                    <td><?php echo $val['email']; ?></td>
                                    <td><?php echo $val['module_name']; ?></td>
                                    <td><?php echo $val['mobile']; ?></td>
                                    <td><?php echo $val['role_name']; ?></td>
                                    <td><?php echo $val['department_name']; ?></td>
                                     <td><div id="changestatus1" class="<?php if($val['is_active']==1){echo "aprovestatus";}else{ echo "unaprovestatus";} ?> iconsize" name="ChangeStatus"> </div></td>
                                    <td>

               <div class="hidden-sm hidden-xs action-buttons">
                            <ul class="icons-list" style="list-style:none;">
                                <li class="dropdown text-muted">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></a>
                                    <ul class="dropdown-menu dropdown-menu-right">

<li><a href="<?php echo $this->url('staff', array('action'=>'edit-staff'),['query'=>['id'=>$val['user_id']]]);?>"><i class="ace-icon fa fa-edit bigger-130"></i> Edit</a></li>

<li class="updatestatus" user_id="<?php echo $val['user_id']; ?>" user_status="<?php echo $val['is_active']; ?>"><a href="#" data-toggle="modal" data-target="#statuspopup" ><i class="ace-icon fa fa-user bigger-130"></i> Status</a></li>

                                    </ul>
                                </li>
                            </ul>
                        </div>



                                    </td>
                                </tr>
                                 <?php $i++; }} ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<!--popup for status-->

<div id="statuspopup" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Staff Status</h4>
      </div>
      <div class="modal-body">
         <div class="col-sm-12 no-padding">
                                                                    <div class="form-group clearfix margintopbottom20">
                                                                      <?php

                                                                     if($userstatus['status']==1){

                                                                      foreach ($userstatus['data'] as $id=>$val)
                                                                      {?>

                                                                             <?php if($id==1 || $id==4){?>
                                                                        <div class="col-sm-4">

                                                                            <div class="carbooking">
                                            <input type="radio" name="driver_sataus" id="<?php echo $val; ?>" value="<?php echo $id; ?>">
                                            <label for="<?php echo $val; ?>"><span class="radio"><?php echo $this->translate($val); ?></span></label>
                                        </div>

                                                                        </div>

                                                                             <?php }} }?>


                                                                    </div>


                                                                    </div>
      </div>
      <div class="modal-footer">
           <input type="hidden" id="user_id" value="" name="userid">

         <input type="button" class="btn btn-danger" value="Save" name="save" id="savestatus"  />
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>

  </div>
</div>