@extends('_version_02.commons.layouts.admin') @section('content') @include('_version_02.commons.layouts.partials._alert')
@php $priority_counter = 1 ; @endphp @foreach($cols as $col) @if($col != 'store_id') @if($col == 'leaf_id_user') @elseif($col == 'id') @elseif(str_contains($col, '_id')) @else @endif @endif @php $priority_counter ++ ; @endphp @endforeach @php $priority_counter = 1 ; @endphp @foreach($model as $index => $row) @php $check_in_user = App\PowerMeterModel\VisitLog::getUserByLeafIdUser($row['leaf_id_user']); $duration = date_diff(date_create($row['check_in_at']), date_create($row['check_out_at'])); @endphp @foreach($cols as $key) @if($key == 'leaf_id_user') @if(isset($check_in_user['fullname'])) @else @endif @elseif($key == 'duration') @elseif($key == 'status') @elseif(str_contains($key, '_id')) @elseif(str_contains($key, 'device')) @php $device_arr = (array) json_decode($row[$key]); @endphp @elseif($key != 'id') @endif @endforeach @endforeach
{{App\Language::trans('Name')}} {{App\Language::trans('Email')}}#{{App\Language::trans(ucwords(str_replace('_id', '', $col)))}}{{App\Language::trans(ucwords(str_replace('_', ' ', $col)))}}
{{$index+1}}{{$check_in_user['fullname']}} {{$check_in_user['email']}}- -{{$duration->format('%d day(s) %h hour(s) %s second(s)') }}{{$row->display_status_string($key)}}{{$row->display_relationed($key, 'name')}} @if(count($device_arr) > 0 ) @foreach($device_arr as $device_key => $device_value) {{ $device_key }} : {{ $device_value }}
@endforeach @endif
{{$row[$key]}}
@endsection @section('script') @endsection