@extends('main') @section('content')

Last Two QR Scan Report

@foreach($scans as $i => $records) @php $first = $records[0]; $second = $records->count() > 1 ? $records[1] : null; $firstLat = $firstLng = '-'; if (!empty($first->latlong) && strpos($first->latlong, ',') !== false) { $p = explode(',', $first->latlong); $firstLat = trim($p[0] ?? '-'); $firstLng = trim($p[1] ?? '-'); } $secondLat = $secondLng = '-'; if ($second && !empty($second->latlong) && strpos($second->latlong, ',') !== false) { $p2 = explode(',', $second->latlong); $secondLat = trim($p2[0] ?? '-'); $secondLng = trim($p2[1] ?? '-'); } @endphp @php $cleanQrcode = basename($first->qrcode); @endphp {{-- Longitude Column --}} @endforeach
Carpet Code Weaver Name Last Scan Time Second Last Scan Time Latitude Longitude Action
{{ $first->carpet_code ?? '-' }} {{ $first->weaver_name ?? '-' }} {{ $first->scan_time ?? '-' }} {{ $second->scan_time ?? '-' }}
1st: {{ $firstLat }}
2nd: {{ $secondLat }}
1st: {{ $firstLng }}
2nd: {{ $secondLng }}
View Details
@endsection @section('script') @endsection