@extends('layouts.dashboard')
@section('page-title')
    {{__('Last Login')}}
@endsection
@section('content')
    <div class="main-content">
        <section class="section">
            <div class="section-header">
                <h1>{{__('Last Login')}}</h1>
                <div class="section-header-breadcrumb">
                    <div class="breadcrumb-item active"><a href="{{route('home')}}">{{__('Dashboard')}}</a></div>
                    <div class="breadcrumb-item">{{__('Last Login')}}</div>
                </div>
            </div>
            <div class="section-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table class="table table-striped mb-0" id="dataTable">
                                        <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>{{__('Name')}}</th>
                                            <th>{{__('Last Login')}}</th>
                                            <th>{{__('Role')}}</th>
                                        </tr>
                                        </thead>
                                        <tbody class="font-style">
                                        @foreach ($users as $user)
                                            <tr>
                                                @if($user->type=='employee')
                                                    <td>{{ \Auth::user()->employeeIdFormat($user->id) }}</td>
                                                @else
                                                    <td>--</td>
                                                @endif
                                                <td>{{ $user->name }}</td>
                                                <td>{{$user->last_login}}</td>
                                                <td>{{$user->type}}</td>
                                            </tr>
                                        @endforeach
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
@endsection


