@extends(\Auth::user()->role != 10 ? 'layout' : 'layoutfrontdesk') @section('title', 'Log') @section('css') @endsection @section('content')
{{-- --}} {{-- --}} @foreach ($logs as $log) @php // Decode json_from and json_after $json_from = json_decode($log->json_from, true); $json_after = json_decode($log->json_after, true); // Remove common keys with the same values if ($json_from && $json_after) { removeCommonKeys($json_from, $json_after); } // Encode back to JSON format $json_from = $json_from ? json_encode($json_from) : null; $json_after = $json_after ? json_encode($json_after) : null; @endphp @endforeach
NoUser Datetime Activity Before AfterAction
{{@$log->user->nama}} {{($log->created_at->format('d-m-Y H:i:s'))}} {{$log->modul}} @php $data_from = json_decode($json_from, true); if ($json_from != 'null') { if(strlen($json_from) > 10){ $singkatanBefore = str_replace( ["{", '"'], "",(substr($json_from, 0, 15))).' [more]'; } else{ $singkatanBefore = $json_from; } }else { $singkatanBefore = '-- KOSONG -- '; } @endphp
{!! $singkatanBefore !!}
@else
( --- Kosong --- )
@endif
@php $data_after = json_decode($json_after, true); if ($json_after != 'null') { if(strlen($json_after) > 10){ $singkatanAfter = str_replace( ["{", '"'], "",(substr($json_after, 0, 15))).' [more]'; } else{ $singkatanAfter = $json_after; } }else { $singkatanAfter = '-- KOSONG -- '; } @endphp
{!! $singkatanAfter !!}
@else
( --- Kosong --- )
@endif
{{-- get tanggal --}} @php $tanggal = explode(' - ', \Request::get('tanggal') ?? date('Y-m-d').' - '. date('Y-m-d')); $tanggal[0] = formatDate($tanggal[0]); $tanggal[1] = formatDate($tanggal[1]); @endphp {{-- closing get tanggal --}} @endsection @section('js') @endsection