<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>Referral Key</th>
            <th>Assign Module Name</th>
            <th>Mobile</th>
            <th>Role</th>
            <th>Department</th>
            <th>Status</th>
            <th>Login 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['referral_key']; ?></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 id="changestatus-<?php echo $val['user_id']; ?>" status="<?php echo $val['login_status']; ?>"  class="iconsize <?php echo ($val['login_status'] == '1' ? 'aprovestatus' : 'unaprovestatus'); ?>" name="ChangeStatus" onclick="changeRecordStatus('<?php echo $val['user_id']; ?>', 'staff', 'change-record-status', '<?php echo $val['login_status']; ?>')">
                            </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>