@extends('backend.layouts.master')
@section('title')Manage User
@endsection
@push('css')
    <style>
        span.st_active {
            color: green;
        }
    </style>
@endpush
<!-- page content -->
@section('content')
    <div class="right_col" role="main">
        <div class="">
            <div class="clearfix"></div>
            @if(Session::has('success_message'))
                <div class="alert alert-success">
                    {{ Session::get('success_message') }}
                </div>
            @endif
            @if(Session::has('error_message'))
                <div class="alert alert-danger">
                    {{ Session::get('error_message') }}
                </div>
            @endif
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <h2>Manage User
                                <a href="{{route('user.register')}}" class="btn btn-xs btn-primary">New User</a>
                            </h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                                    <ul class="dropdown-menu" role="menu">
                                        <li><a href="#">Settings 1</a>
                                        </li>
                                        <li><a href="#">Settings 2</a>
                                        </li>
                                    </ul>
                                </li>
                                <li><a class="close-link"><i class="fa fa-close"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content table-responsive">
                            <table class="table table-bordered table-condensed">
                                <thead>
									<tr>
										<th>SL</th>
										<th>Name</th>
                                        <th>Roles</th>
                                        <th>Date:Times</th>
										<th>IP</th>
										<th>Url</th>
										<th>Browser</th>
									</tr>
								</thead>
								<tbody>
									@foreach($logs as $key=>$log)
										<tr>
											<td>{{$key + 1}}</td>
											<td >
                                                <a href="{{route('admin.users.user_activities',$log->user_id)}}">{{$log->user->name}}</a>
                                            </td>
                                            <td>{{$log->ro->role->name}}</td>
                                            <td>{{$log->created_at->diffForHumans()}}</td>
											<td>{{$log->ip}}</td>
											<td>{{$log->url}}</td>
											<td>{{$log->agent,50}}</td>
										</tr>
									@endforeach
								</tbody>
                            </table>
                            <div class="text-center">
                                {{$logs->links()}}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /page content -->
@endsection

@section('script')

@endsection