  <h3><i class="fa fa-inbox"></i> <?php echo $this->translate('Recent Users'); ?></h3>
  <div>
<div class="nav-tabs-custom">
    <!--<ul class="nav nav-tabs pull-right">
        <li class="pull-left header"><i class="fa fa-inbox"></i> <?php echo $this->translate('Recent Users'); ?></li>
    </ul>-->
    <div class="tab-content">
        <div>
            <div class="listingTableContainer">
                <div class="table-responsive">
                    <table id="recent-users-tbl" class="table table-bordered with-pager table-striped" style="color:#333;">
                        <thead>
                            <tr>
                                <th>S.No</th>
                                <th>User Id</th>
                                <th>User Type</th>
                                <th>Name</th>
                                <th>Company Name</th>
                                <th>Vehicle</th>
                                <th>City</th>
                                <th>Pending Doc</th>
                                <th>Marketplace</th>
                                <th>User<br>Status</th>
                                <th>Login <br>Status</th>
                                <th>Signup <br>Status</th>
                                <th>Created at</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            if ($userListing) {

                                $i = 1;
                                foreach ($userListing as $listing) {
                                    $loginStatus = $listing['login_status'];
                                    $docs   =   $this->mainMenu()->getUserPendingDoc($listing['user_id']);
                                    ?>
                                    <tr>
                                        <td><?php echo $i; ?></td>
                                        <td><a href="<?php echo '/usermanagement/personal-detail/' . $listing['user_id']; ?>"><?php echo $listing['user_id'] ?></a></td>
                                        <td><?php echo $listing['user_type']; ?></td>
                                        <td><?php echo $listing['name']; ?><br>
                                            <small><?php echo $listing['mobile']; ?></small><br><small><?php echo $listing['email']; ?></small>
                                        </td>
                                        <td><?php echo $listing['company_name']; ?></td>
                                        <td><?php //echo $listing['company_name'];   ?></td>
                                        <td><?php echo $listing['city_name']; ?></td>
                                        <td style="white-space:nowrap;">
                                        <ul class="pending-doc">
                                            <?php foreach($docs as $doc){ ?>
                                            <li><i class="fa fa-angle-double-right" aria-hidden="true"></i> <?php echo $doc['document_name']; ?></li>
                                            <?php }?>
                                        </ul>
                                        </td>
                                        <td>
                                            <div style="float:left;">
                                                <div id="changestatus1" class="iconsize publish-marketplace" title="Publish"> </div>
                                            </div>
                                        </td>
                                        <td>
                                            <?php //echo $listing['status']; ?>
                                            <!--                   <br>-->
                                            <div style="float:left;">
                                                <div  class="iconsize <?php echo $listing['status_class']; ?>" name="ChangeStatus">
                                                </div></div>
                                        </td>

                                        <td>
                                            <div style="float:left;">
                                                <div id="changestatus1" class="<?php echo ($loginStatus == 0) ? 'unaprovestatus' : 'aprovestatus'; ?> iconsize" name="ChangeStatus" title="<?php echo ($loginStatus == 0) ? 'Log-out' : 'Log-In'; ?>"> </div>
                                            </div>
                                        </td>
                                        <td><div style="float:left;">
                                                <div class="iconsize <?php echo $listing['signup_status_class']; ?>">
                                                </div></div><br/><?php echo $listing['status_name']; ?></td>
                                        <td><?php echo $listing['created_date']; ?><!--<br><small>3 bookings</small>--></td>
                                        <td><div class="hidden-sm hidden-xs action-buttons">
                                                <ul class="icons-list margin-left0" 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 '/usermanagement/personal-detail/' . $listing['user_id']; ?>"><i class="ace-icon fa fa-edit bigger-130"></i> Edit</a></li>
                                                            <li><a href="<?php echo '/usermanagement/personal-detail/' . $listing['user_id']; ?>"><i class="ace-icon fa fa-user bigger-130"></i> Profile</a></li>

                                                            <li class="updatestatus" user_id="<?php echo $listing['user_id']; ?>" user_status="<?php echo $listing['is_active']; ?>"><a href="#" data-toggle="modal" data-target="#statuspopup" ><i class="ace-icon fa fa-user bigger-130"></i> Status</a></li>
                                                            <li class="relationmanager" user_id="<?php echo $listing['user_id']; ?>" relation_id="<?php echo $listing['relation_manager_id']; ?>"><a href="#" data-toggle="modal" data-target="#relationpopup" ><i class="ace-icon fa fa-user bigger-130"></i> Relation Manager</a></li>
                                                            <li><a href="/credit"><i class="ace-icon fa  fa-history bigger-130"></i> Credit Limit</a></li>
                                                        </ul>
                                                    </li>
                                                </ul>
                                            </div></td>

                                    </tr>
                                    <?php
                                    $i++;
                                }
                            } else {
                                ?>
                                <tr><th colspan="14" style="text-align: center;">No Record Found</th></tr>
                            <?php } ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

    </div>
    <span style="float: right;"><a href="<?php echo $this->url('usermanagement', array('action' => 'vendor')); ?>" style="background: #0066cc; color: #fff; font-size: 13px; padding: 5px 10px;">More</a></span>
</div>

<!--Pop-up For Vendor Status Start-->

<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">User 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) {
                                ?>

                                <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>

<!--Pop-up For Vendor Status End-->



<!--Pop-up For Vendor Relation management Start-->

<div id="relationpopup" 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">Relation Manager </h4>
            </div>
            <div class="modal-body">
                <div class="col-sm-12 no-padding">
                    <div class="form-group clearfix margintopbottom20">

                        <table id="relation-manager-tbl" class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th>S.No</th>
                                    <th>Name</th>
                                    <th>Roll</th>
                                    <th>Department</th>
                                    <th>Action</th>
                                </tr>

                            </thead>
                            <tbody>

                                <?php
                                if ($relatinaldata) {
                                    $i = 1;
                                    foreach ($relatinaldata as $list) {
                                        ?>
                                        <tr>
                                            <td><?php echo $i; ?></td>
                                            <td><?php echo $list['first_name'] . ' ' . $list['last_name']; ?></td>
                                            <td><?php echo $list['role_name']; ?></td>
                                            <td><?php echo $list['department_name']; ?></td>
                                            <td><input type="button" class="btn btn-danger add-relation" value="Add" name="add" id="<?php echo $list['user_id']; ?>"></td>
                                        </tr>
                                        <?php
                                        $i++;
                                    }
                                } else {
                                    ?>
                                    <tr><th colspan="12" style="text-align: center;">No Record Found</th></tr>
<?php } ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <input type="hidden" id="relational-user-id" value="" name="relational_user_id">
                <input type="hidden" id="relational-manager-id" value="" name="relational-manager-id">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
<!--Pop-up For Vendor Relation management End-->
  </div>