Files
expense/resources/views/backend/pages/audit_trail/index.blade.php
T

105 lines
4.1 KiB
PHP
Raw Normal View History

2025-01-01 17:14:46 +07:00
@extends('layouts.app')
@section('title')
{{ $pageInfo['title'] }}
@endsection
@section('admin-content')
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>{{ $pageInfo['title'] }}</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">{{ __('Dashboard') }}</a></li>
<li class="breadcrumb-item active"><a href="{{ $pageInfo['path'] }}">{{ $pageInfo['title'] }}</a>
</li>
</ol>
</div>
</div>
</div>
</section>
<section class="content">
<div class="container-fluid">
<div class="row">
2025-01-01 23:59:49 +07:00
<div class="col-12">
2025-01-01 17:14:46 +07:00
<div class="card">
<div class="card-body">
<h4 class="header-title float-left">{{ $pageInfo['title'] }}</h4>
<div class="clearfix"></div>
<div class="data-tables">
@include('backend.layouts.partials.messages')
<table id="dataTable" class="text-center">
<thead class="bg-light text-capitalize">
<tr>
<th width="5%">{{ __('User') }}</th>
<th width="5%">{{ __('Ip Address') }}</th>
2025-01-01 17:20:37 +07:00
<th width="5%">{{ __('Action') }}</th>
<th width="15%">{{ __('Activity') }}</th>
2025-01-01 17:14:46 +07:00
<th width="5%">Browser</th>
<th width="15%">User Agent</th>
2025-01-02 17:59:33 +07:00
<th width="5%">Tanggal</th>
<th width="5%">Waktu</th>
2025-01-01 17:14:46 +07:00
</tr>
</thead>
<tbody>
@foreach ($data as $item)
<tr>
<td>
2025-01-01 17:22:17 +07:00
{{ $item->user ? $item->user->username : preg_replace('/\).*$/', '', explode('(', $item->activity)[1]) }}
2025-01-01 17:14:46 +07:00
</td>
<td>{{ $item->ip_address }}</td>
2025-01-01 17:20:37 +07:00
<td>
@php
$color = 'info';
if ($item->action == 'Create') {
$color = 'success';
} elseif ($item->action == 'Update') {
$color = 'warning';
} elseif ($item->action == 'Delete') {
$color = 'danger';
}
@endphp
<div class="badge badge-{{ $color }} text-white">
{{ $item->action }}
</div>
</td>
2025-01-01 17:14:46 +07:00
<td>{{ $item->activity }}</td>
<td>{{ $item->browser }}</td>
<td>{{ $item->user_agent }}</td>
2025-01-02 17:59:33 +07:00
<td>{{ $item->created_at }}</td>
2025-01-01 23:59:49 +07:00
<td>{{ $item->created_at->diffForHumans() }}</td>
2025-01-01 17:14:46 +07:00
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
@endsection
@section('scripts')
<script>
$(document).ready(function () {
if ($('#dataTable').length) {
$('#dataTable').DataTable({
responsive: true,
dom: 'Bfrtip',
buttons: [
'excel', 'pdf', 'print'
2025-01-02 17:59:33 +07:00
],
order: [[6, 'desc']]
2025-01-01 17:14:46 +07:00
});
}
});
</script>
@endsection