@extends('layouts.dashboard')

@section('page_title')
	 Logs
@endsection





@section('page_body')
{{ Breadcrumbs::render('logs') }}
<div class="row row-cards row-deck">
              <div class="col-12">
                <div class="card">
                	  <div class="card-header">

					 
                <div class = "col-md-2">
					     <h3 class="card-title">Logs Detail&nbsp;&nbsp;&nbsp;</h3>
             </div>
             <div class = "col-md-4">
					     <select class="logs_date form-control form-control-sm" onchange="getLogsByDate(event,this,'logs_type')" >
					     	@foreach($file_list as $rows)
					     	<option @if($loop->last) selected="true" @endif value="{{str_replace('.json','',$rows->getFileName())}}">{{str_replace('.json','',$rows->getFileName())}}</option>

					     	@endforeach
					     </select>
             </div>
                 <div class = "col-md-4">
               <select class="logs_date form-control form-control-sm logs_type" onchange="getLogsByDate(event,'logs_date',this)" >
                  @foreach(EF::getLogType() as $rows)
                    <option @if($loop->last) selected="true" @endif  value="{{$rows}}">{{ucwords($rows)}} Logs</option>
                  @endforeach
               </select>
             </div>
           
					  </div>

                	<div class="card-status card-status-left bg-blue"></div>
                  <div class="table-responsive table-height">
                    <table class="table table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
                      <thead>
                        <tr>
                          
                          <th>#</th>
                          <th>User</th>
                          <th>Branch</th>
                          <th>Date</th>
                          <th>Time</th>

                          <th>Logs Detail</th>
                        </tr>
                      </thead>
                      <tbody id="td_logs_list">
                      	@isset($logs_list)
                          
                      		@foreach($logs_list as $rows)

                      			<tr>
                      				<td>{{(int)($loop->iteration)}}</td>

                      				<td>{{$rows->name}}</td>

                      				<td>{{$rows->branch}}</td>

                      				<td>{{EF::dateFormat($rows->log_date)}} </td>
                              <td>{{$rows->log_time}}</td>

                      				<td>{{$rows->message}}</td>

                      				

                      			</tr>


                      		@endforeach
                      	@endisset	
                        
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
          </div>
@endsection



@section('page_script')
@include('scripts.logs')
@endsection

  