
            <div class="row">
                <div class="col-md-12">
                    <?php if(isset($success_msg) && $success_msg!=NULL){ ?>
                    <div class="alert alert-success"><?php echo $success_msg; ?></div>
                    <?php } ?>
                    <div id="response_msg"></div>
                
                    <div class="tabbable tabbable-custom boxless">
                        <ul class="nav nav-tabs">
                            <li class="<?php echo $active; ?>">
                                <a href="#tab_1" data-toggle="tab"> Active Users </a>
                            </li>
                            <li class="<?php echo $inactive; ?>">
                                <a href="#tab_2" data-toggle="tab"> Inactive Users </a>
                            </li>
                            <li>
                                <a href="#tab_3" data-toggle="tab"> Inactive Privileged Users </a>
                            </li>
                        </ul>
                        <div class="tab-content">
                            
                            <div class="tab-pane <?php echo $active; ?>" id="tab_1">
                                <script type="text/javascript" language="javascript" >
                                    $(document).ready(function () {
                                        var dataTable = $('#active_users').DataTable({
                                            select: true,
                                            pageLength: 10,
                                            processing: true,
                                            serverSide: true,
                                            ajax: {
                                                url: "Json_data/json_data_records?json_type=system_users&user_status=1&privilege_status=1", // json datasource
                                                type: "post", // method  , by default get
                                                error: function () {  // error handling
                                                    $(".employee-grid-error").html("");
                                                    $("#employee-grid").append('<tbody class="employee-grid-error"><tr><th colspan="6">No data found in the server</th></tr></tbody>');
                                                    $("#employee-grid_processing").css("display", "none");

                                                }
                                            }, "aoColumns": [
                                                {"sTitle": "", "sClass": "hidden"},
                                                {"sTitle": "ID"},
                                                {"sTitle": "Contact Name"},
                                                {"sTitle": "Contact Number"},
                                                {"sTitle": "User Privilege"},
                                                {"sTitle": "Username"},
                                                {"sTitle": "User Status"},
                                                {"sTitle": "Privilege Status"},
                                                {"sTitle": "Actions", "sClass": "actionWidthMembers"}
                                            ], "fnCreatedRow": function (nRow, aData, iDataIndex) {
                                                $(nRow).attr('id', '' + aData[0]);

                                            }
                                        });

                                    });
                                </script>
                                
                                <div id="add_new_user" class="modal fade" tabindex="-1" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                                                <h4 class="modal-title">Add New User</h4>
                                            </div>
                                            <form id="add_user" class="form-horizontal" method="post">
                                                <div class="modal-body">
                                                    <div id="response_msg_modal"></div>
                                                    <div class="scroller" style="height:300px" data-always-visible="1" data-rail-visible1="1">
                                                        <div class="row">
                                                            <div class="col-md-12">
                                                                <div class="form-body">
                                                                    <div class="row form-group">
                                                                        <label class="col-md-3 control-label pull-left">Contact Name</label>
                                                                        <div class="col-md-6">
                                                                            <input type="text" name="contact_name" id="contact_name" placeholder="Shafraz Jiffry" class="form-control"/>
                                                                        </div>
                                                                    </div>
                                                                    <div class="row form-group">
                                                                        <label class="col-md-3 control-label pull-left">Contact Number</label>
                                                                        <div class="col-md-6">
                                                                            <input type="number" name="contact_num" id="contact_num" placeholder="0777123456" class="form-control"/>
                                                                        </div>
                                                                    </div>
                                                                    <div class="row form-group">
                                                                        <label class="col-md-3 control-label pull-left">Username</label>
                                                                        <div class="col-md-6">
                                                                            <input type="text" name="username" id="add_username" placeholder="mj.shaf" class="form-control"/>
                                                                            <p id="add_username_status"></p>
                                                                        </div>
                                                                    </div>
                                                                    <div class="row form-group">
                                                                        <label class="col-md-3 control-label pull-left">Password</label>
                                                                        <div class="col-md-6">
                                                                            <input type="text" name="password" id="password" placeholder="******" class="form-control"/>
                                                                        </div>
                                                                    </div>
                                                                    <div class="row form-group">
                                                                        <label class="col-md-3 control-label pull-left">User Privilege</label>
                                                                        <div class="col-md-6">
                                                                            <select class="form-control" name="user_type" id="user_type" >
                                                                                <option value="">Select User Type</option>
                                                                                <?php
                                                                                    $user_types = $this->admin_db->get_user_types();
                                                                                    foreach ($user_types as $user_type) {
                                                                                        $sel = '';
                                                                                ?>

                                                                                <option value="<?php echo $user_type['id']; ?>" <?php echo $sel; ?> ><?php echo $user_type['user_privilege']; ?></option>

                                                                                <?php } ?>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" data-dismiss="modal" class="btn default">Close</button>
                                                    <button type="submit" class="btn green" id="save_add_user_details">Save changes</button>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                                
                                <div class="modal fade" id="success_modal" tabindex="-1" role="basic" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                                                <h4 class="modal-title">Success!</h4>
                                            </div>
                                            <div class="modal-body">
                                                User Added Successfully
                                            </div>
                                            <div class="modal-footer">
                                                <button type="button" class="btn green" data-dismiss="modal" onclick="window.location.reload()">Ok</button>
                                            </div>
                                        </div>
                                        <!-- /.modal-content -->
                                    </div>
                                    <!-- /.modal-dialog -->
                                </div>
                                <!-- /.modal -->

                                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                                <div class="portlet box grey-cascade">
                                    <div class="portlet-title">
                                        <div class="caption">
                                            <i class="fa fa-user"></i>Active Users
                                        </div>
                                    </div>
                                    <div class="portlet-body">
                                        <div class="table-toolbar">
                                            <div class="btn-group">
                                                <a class="btn green" data-toggle="modal" href="#add_new_user">
                                                    Add New <i class="fa fa-plus"></i>
                                                </a>
                                            </div>
                                            <div class="btn-group pull-right hidden">
                                                <button class="btn dropdown-toggle" data-toggle="dropdown">Tools <i class="fa fa-angle-down"></i>
                                                </button>
                                                <ul class="dropdown-menu pull-right">
                                                    <li>
                                                        <a href="#">
                                                        Print </a>
                                                    </li>
                                                    <li>
                                                        <a href="#">
                                                        Save as PDF </a>
                                                    </li>
                                                    <li>
                                                        <a href="#">
                                                        Export to Excel </a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                        <table id="active_users" class="table table-striped table-bordered table-hover"></table>
                                    </div>
                                </div>
                            </div>
                            <div class="tab-pane <?php echo $inactive; ?>" id="tab_2">
                                <script type="text/javascript" language="javascript" >
                                    $(document).ready(function () {
                                        var dataTable = $('#inactive_users').DataTable({
                                            select: true,
                                            pageLength: 10,
                                            processing: true,
                                            serverSide: true,
                                            ajax: {
                                                url: "Json_data/json_data_records?json_type=system_users&user_status=2&privilege_status=1", // json datasource
                                                type: "post", // method  , by default get
                                                error: function () {  // error handling
                                                    $(".employee-grid-error").html("");
                                                    $("#employee-grid").append('<tbody class="employee-grid-error"><tr><th colspan="6">No data found in the server</th></tr></tbody>');
                                                    $("#employee-grid_processing").css("display", "none");

                                                }
                                            }, "aoColumns": [
                                                {"sTitle": "", "sClass": "hidden"},
                                                {"sTitle": "ID"},
                                                {"sTitle": "Contact Name"},
                                                {"sTitle": "Contact Number"},
                                                {"sTitle": "User Privilege"},
                                                {"sTitle": "Username"},
                                                {"sTitle": "User Status"},
                                                {"sTitle": "Privilege Status"},
                                                {"sTitle": "Actions", "sClass": "actionWidthMembers"}
                                            ], "fnCreatedRow": function (nRow, aData, iDataIndex) {
                                                $(nRow).attr('id', '' + aData[0]);

                                            }
                                        });

                                    });
                                </script>

                                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                                <div class="portlet box grey-cascade">
                                    <div class="portlet-title">
                                        <div class="caption">
                                            <i class="fa fa-user"></i>Inactive Users
                                        </div>
                                    </div>
                                    <div class="portlet-body">
                                        <table id="inactive_users" class="table table-striped table-bordered table-hover"></table>
                                    </div>
                                </div>
                            </div>
                            <div class="tab-pane" id="tab_3">
                                <script type="text/javascript" language="javascript" >
                                    $(document).ready(function () {
                                        var dataTable = $('#inactive_previlege_users').DataTable({
                                            select: true,
                                            pageLength: 10,
                                            processing: true,
                                            serverSide: true,
                                            ajax: {
                                                url: "Json_data/json_data_records?json_type=system_users&user_status=1&privilege_status=2", // json datasource
                                                type: "post", // method  , by default get
                                                error: function () {  // error handling
                                                    $(".employee-grid-error").html("");
                                                    $("#employee-grid").append('<tbody class="employee-grid-error"><tr><th colspan="6">No data found in the server</th></tr></tbody>');
                                                    $("#employee-grid_processing").css("display", "none");

                                                }
                                            }, "aoColumns": [
                                                {"sTitle": "", "sClass": "hidden"},
                                                {"sTitle": "ID"},
                                                {"sTitle": "Contact Name"},
                                                {"sTitle": "Contact Number"},
                                                {"sTitle": "User Privilege"},
                                                {"sTitle": "Username"},
                                                {"sTitle": "User Status"},
                                                {"sTitle": "Privilege Status"},
                                                {"sTitle": "Actions", "sClass": "actionWidthMembers"}
                                            ], "fnCreatedRow": function (nRow, aData, iDataIndex) {
                                                $(nRow).attr('id', '' + aData[0]);

                                            }
                                        });

                                    });
                                </script>

                                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                                <div class="portlet box grey-cascade">
                                    <div class="portlet-title">
                                        <div class="caption">
                                            <i class="fa fa-user"></i>Inactive Privileged Users
                                        </div>
                                    </div>
                                    <div class="portlet-body">
                                        <table id="inactive_previlege_users" class="table table-striped table-bordered table-hover"></table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div> 
            </div>
            <!-- END DASHBOARD STATS -->
        </div>
    </div>
    <!-- END CONTENT -->
</div>
<!-- END CONTAINER -->