<!DOCTYPE html>
<html>

@include('includes.head')
<!-- ADD THE CLASS fixed TO GET A FIXED HEADER AND SIDEBAR LAYOUT -->
<!-- the fixed layout is not compatible with sidebar-mini -->

<body class="hold-transition skin-blue fixed sidebar-mini">
    <!-- Site wrapper -->
    <div class="wrapper">

        @include('includes.header')
        <!-- =============================================== -->

        <!-- Left side column. contains the sidebar -->
        @include('includes.side-nav')

        <!-- =============================================== -->

        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                    Roles &amp; Priviledges
                    <small>Manage System User Roles</small>
                </h1>
                <ol class="breadcrumb">
                    <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                    <li><a href="#">System Users</a></li>
                    <li class="active">Roles &amp; Priviledges</li>
                </ol>
            </section>

            <!-- Main content -->
            <section class="content">

                <!-- Default box -->
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">Roles &amp; Priviledges</h3>

                        <div class="box-tools pull-right">
                            <a class="btn btn-block btn-primary btn-flat" data-toggle="tooltip" title="Create New Role"
                                href="{{route('hr.roles.create')}}">
                                <i class="fa fa-plus"></i> Create Role</a>

                        </div>
                    </div>
                    <div class="row">


                        <div class="col-md-12">

                            <div class="box-body">
                                @include('includes.messages')
                                <table class="table table-bordered table-hover">
                                    <tr>
                                        <th style="width: 180px">Sl No.</th>
                                        <th style="width: 180px">Role Reference</th>
                                        <th>Role Name</th>
                                        <th>No of Staffs</th>
                                        <th style="width: 180px">Action</th>
                                    </tr>
                                    @foreach($records as $index=>$record)
                                    <tr>

                                        <td>{{$index + $records->firstItem()}}</td>
                                        <td>{{$record->ref}}</td>
                                        <td>{{$record->name}}</td>
                                        <td>{{$record->users_count}}</td>



                                        <td>
                                            <div class="btn-group">
                                                <a href="{{route('hr.roles.update',$record->id)}}" type="button"
                                                    class="btn btn-info btn-flat">Update</a>
                                                <button type="button" class="btn btn-info btn-flat dropdown-toggle"
                                                    data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                    <span class="sr-only">Toggle Dropdown</span>
                                                </button>
                                                <ul class="dropdown-menu" role="menu">
                                                    <li><a href="{{route('hr.roles.update',$record->id)}}">Update</a>
                                                    </li>
                                                    <li class="divider"></li>
                                                    <li><a href="{{route('hr.roles.delete',$record->id)}}">Remove</a>
                                                    </li>

                                                </ul>
                                            </div>
                                        </td>



                                    </tr>
                                    @endforeach


                                </table>
                                {{ $records->appends(request()->input())->links() }}
                            </div>



                        </div>

                    </div>

                </div>
                <!-- /.box -->

            </section>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->

        @include('includes.footer')

    </div>
    <!-- ./wrapper -->

    @include('includes.scripts')
</body>

</html>
