



 <!-- End of Topbar -->

                <!-- Begin Page Content -->
                <div class="container-fluid">

                    @if(Session::has('error_message'))
                    <div class="alert alert-danger">{{ Session::get('error_message') }}</div>
                     @endif

                      @if(Session::has('success_message'))
                    <div class="alert alert-success">{{ Session::get('success_message') }}</div>
                     @endif

                    
                    <div class="row"> 

                        <!-- Earnings (Monthly) Card Example -->
                       
                        <div class="col-xl-3 col-md-6 mb-4">
                            <div class="card border-left-primary shadow h-100 py-2">
                                <div class="card-body">
                                    <div class="row no-gutters align-items-center">
                                        <div class="col mr-2">
                                            <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
                                                Today</div>
                                            <div class="h5 mb-0 font-weight-bold text-gray-800">
                                                {{ $day }}
                                            </div>
                                        </div>
                                        <div class="col-auto">
                                            <i class="fas fa-calendar fa-2x text-gray-300"></i>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                      

                        <!-- Earnings (Monthly) Card Example -->
                        
                         <div class="col-xl-3 col-md-6 mb-4">
                            <div class="card border-left-primary shadow h-100 py-2">
                                <div class="card-body">
                                    <div class="row no-gutters align-items-center">
                                        <div class="col mr-2">
                                            <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
                                                This Week</div>
                                            <div class="h5 mb-0 font-weight-bold text-gray-800">
                                                {{ $week }}
                                            </div>
                                        </div>
                                        <div class="col-auto">
                                            <i class="fas fa-calendar fa-2x text-gray-300"></i>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                       

                        <!-- Earnings (Monthly) Card Example -->
                       
                        <div class="col-xl-3 col-md-6 mb-4">
                            <div class="card border-left-primary shadow h-100 py-2">
                                <div class="card-body">
                                    <div class="row no-gutters align-items-center">
                                        <div class="col mr-2">
                                            <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
                                                This Month</div>
                                            <div class="h5 mb-0 font-weight-bold text-gray-800">
                                                {{ $month }}
                                            </div>
                                        </div>
                                        <div class="col-auto">
                                            <i class="fas fa-calendar fa-2x text-gray-300"></i>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                       
                        <!-- Pending Requests Card Example -->
                        
                         <div class="col-xl-3 col-md-6 mb-4">
                            <div class="card border-left-primary shadow h-100 py-2">
                                <div class="card-body">
                                    <div class="row no-gutters align-items-center">
                                        <div class="col mr-2">
                                            <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
                                                This Year</div>
                                            <div class="h5 mb-0 font-weight-bold text-gray-800">
                                                {{ $year }}
                                            </div>
                                        </div>
                                        <div class="col-auto">
                                            <i class="fas fa-calendar fa-2x text-gray-300"></i>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <br>
                    <br>

                    <div  >
                            
                            <div  style="width: 100%;">
                                <h2 class="text-lg font-medium truncate mr-5">
                                    Account Login History
                                </h2>
                                <div>Listing last 10 login attempts for this account</div>

                                <div class="table-responsive">
                                    <table class="table mt-5" style="background: white;">
                                        <thead>
                                        <tr class="bg-gray-200 text-gray-700">
                                            <th class="whitespace-nowrap">Email</th>
                                            <th class="whitespace-nowrap">Date</th>
                                            <th class="whitespace-nowrap">Ip Address</th>
                                            <th class="whitespace-nowrap">Result</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @foreach($histories as $history)
                                        <tr>
                                            <td class="border-b">{{ optional($history->user)->email }}</td>
                                            <td class="border-b">{{ Carbon\Carbon::parse($history->date)->format('Y F d   h:i A') }}</td>
                                            <td class="border-b">{{ $history->ip_address }}</td>
                                            <td class="border-b">{{ $history->result }}</td>
                                        </tr>
                                            @endforeach

                                        </tbody>
                                    </table>
                                    
                                    <br>
		<br>
		<div class="container">
			<div class="row justify-content-center">
			{{ $histories->links() }}
		</div>
		</div>

		<br>
		<br>
		<br>
		
                                </div>
                            </div>
                        </div>
                 

                   
                    

                </div>