2025-01-01 17:14:46 +07:00
|
|
|
@extends('layouts.app')
|
|
|
|
|
|
2026-06-01 15:01:03 +07:00
|
|
|
@section('title', $pageInfo['title'])
|
2025-01-01 17:14:46 +07:00
|
|
|
|
|
|
|
|
@section('admin-content')
|
|
|
|
|
<section class="content-header">
|
|
|
|
|
<div class="container-fluid">
|
2026-06-01 15:01:03 +07:00
|
|
|
<div class="row mb-3">
|
2025-01-01 17:14:46 +07:00
|
|
|
<div class="col-sm-6">
|
2026-06-01 15:01:03 +07:00
|
|
|
<h1 class="fw-bold text-dark">{{ $pageInfo['title'] }}</h1>
|
2025-01-01 17:14:46 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="col-sm-6">
|
2026-06-01 15:01:03 +07:00
|
|
|
<!-- Tombol Aksi Global (Kanan Atas) -->
|
|
|
|
|
<div class="float-sm-right d-flex align-items-center" style="gap: 10px;">
|
|
|
|
|
<a href="{{ route('admin.audit-trail.clear-cache') }}"
|
|
|
|
|
class="btn btn-outline-info btn-sm shadow-sm"
|
|
|
|
|
onclick="return confirm('Apakah Anda yakin ingin mereset cache sistem?')">
|
|
|
|
|
<i class="fa fa-sync"></i> Reset Cache
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<form action="{{ route('admin.audit-trail.clear') }}" method="POST" onsubmit="return confirm('PERINGATAN! Semua log audit akan dihapus permanen. Lanjutkan?')">
|
|
|
|
|
@csrf
|
|
|
|
|
@method('DELETE')
|
|
|
|
|
<button type="submit" class="btn btn-outline-danger btn-sm shadow-sm">
|
|
|
|
|
<i class="fa fa-trash"></i> Clear All Logs
|
|
|
|
|
</button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
2025-01-01 17:14:46 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class="content">
|
|
|
|
|
<div class="container-fluid">
|
2026-06-01 15:01:03 +07:00
|
|
|
|
|
|
|
|
<!-- CARD FILTER -->
|
|
|
|
|
<div class="card shadow-sm mb-4" style="border-radius: 12px; border: none; border-top: 3px solid #007bff;">
|
|
|
|
|
<div class="card-header bg-white py-3">
|
|
|
|
|
<h6 class="m-0 font-weight-bold text-primary"><i class="fa fa-filter mr-1"></i> Panel Pencarian & Filter</h6>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<form action="{{ route('admin.audit-trail.index') }}" method="GET">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<!-- Filter User -->
|
|
|
|
|
<div class="col-md-3 mb-3">
|
|
|
|
|
<label class="small font-weight-bold text-muted text-uppercase">Berdasarkan User</label>
|
|
|
|
|
<select name="admin_id" class="form-control select2 shadow-none">
|
|
|
|
|
<option value="">-- Semua User --</option>
|
|
|
|
|
@foreach($admins as $admin)
|
|
|
|
|
<option value="{{ $admin->id }}" {{ request('admin_id') == $admin->id ? 'selected' : '' }}>
|
|
|
|
|
{{ $admin->name }}
|
|
|
|
|
</option>
|
|
|
|
|
@endforeach
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Filter Region -->
|
|
|
|
|
<div class="col-md-3 mb-3">
|
|
|
|
|
<label class="small font-weight-bold text-muted text-uppercase">Berdasarkan Region</label>
|
|
|
|
|
<select name="region" class="form-control shadow-none">
|
|
|
|
|
<option value="">-- Semua Region --</option>
|
|
|
|
|
@foreach($regions as $reg)
|
|
|
|
|
<option value="{{ $reg->code }}" {{ request('region') == $reg->code ? 'selected' : '' }}>
|
|
|
|
|
{{ $reg->name }}
|
|
|
|
|
</option>
|
|
|
|
|
@endforeach
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Filter Rentang Waktu -->
|
|
|
|
|
<div class="col-md-4 mb-3">
|
|
|
|
|
<label class="small font-weight-bold text-muted text-uppercase">Rentang Waktu</label>
|
|
|
|
|
<div class="input-group">
|
|
|
|
|
<input type="date" name="start_date" class="form-control shadow-none" value="{{ request('start_date') }}">
|
|
|
|
|
<div class="input-group-append">
|
|
|
|
|
<span class="input-group-text bg-light border-left-0 border-right-0">s/d</span>
|
|
|
|
|
</div>
|
|
|
|
|
<input type="date" name="end_date" class="form-control shadow-none" value="{{ request('end_date') }}">
|
2025-01-02 18:21:03 +07:00
|
|
|
</div>
|
2025-01-01 17:14:46 +07:00
|
|
|
</div>
|
2026-06-01 15:01:03 +07:00
|
|
|
|
|
|
|
|
<!-- Tombol Eksekusi Filter -->
|
|
|
|
|
<div class="col-md-2 mb-3 text-right d-flex align-items-end justify-content-end" style="gap: 5px;">
|
|
|
|
|
<button type="submit" class="btn btn-primary btn-block mb-0 shadow-sm">
|
|
|
|
|
<i class="fa fa-search"></i> Cari
|
|
|
|
|
</button>
|
|
|
|
|
<a href="{{ route('admin.audit-trail.index') }}" class="btn btn-light border shadow-sm px-3" title="Reset Filter">
|
|
|
|
|
<i class="fa fa-undo"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
2025-01-01 17:14:46 +07:00
|
|
|
</div>
|
2026-06-01 15:01:03 +07:00
|
|
|
|
|
|
|
|
<hr class="my-3">
|
|
|
|
|
|
|
|
|
|
<!-- Tombol Export Excel -->
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<a href="{{ route('admin.audit-trail.export', request()->all()) }}" class="btn btn-success shadow-sm">
|
|
|
|
|
<i class="fa fa-file-excel"></i> Export Hasil Pencarian ke Excel
|
|
|
|
|
</a>
|
|
|
|
|
<span class="text-muted small ml-2 mt-2 d-inline-block">
|
|
|
|
|
* Menampilkan <strong>{{ $data->firstItem() }}</strong> sampai <strong>{{ $data->lastItem() }}</strong> dari <strong>{{ $data->total() }}</strong> log.
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- TABEL DATA -->
|
|
|
|
|
<div class="card shadow-sm" style="border-radius: 12px; border: none;">
|
|
|
|
|
<div class="card-body p-0">
|
|
|
|
|
@include('backend.layouts.partials.messages')
|
|
|
|
|
<div class="table-responsive">
|
|
|
|
|
<table id="dataTable" class="table table-hover mb-0">
|
|
|
|
|
<thead class="bg-light">
|
|
|
|
|
<tr>
|
|
|
|
|
<th class="border-top-0" width="10%">User</th>
|
|
|
|
|
<th class="border-top-0" width="10%">IP Address</th>
|
|
|
|
|
<th class="border-top-0" width="10%">Aksi</th>
|
|
|
|
|
<th class="border-top-0" width="35%">Aktivitas</th>
|
|
|
|
|
<th class="border-top-0" width="10%">Browser</th>
|
|
|
|
|
<th class="border-top-0" width="15%">Waktu</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
@foreach ($data as $item)
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="align-middle">
|
|
|
|
|
<span class="text-primary font-weight-bold">{{ $item->user->username ?? 'System' }}</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="align-middle text-muted small">{{ $item->ip_address }}</td>
|
|
|
|
|
<td class="align-middle text-center">
|
|
|
|
|
@php
|
|
|
|
|
$badge = match($item->action) {
|
|
|
|
|
'Insert', 'Create' => 'success',
|
|
|
|
|
'Update' => 'warning',
|
|
|
|
|
'Delete', 'Reject', 'Error' => 'danger',
|
|
|
|
|
'Approve' => 'primary',
|
|
|
|
|
default => 'info'
|
|
|
|
|
};
|
|
|
|
|
@endphp
|
|
|
|
|
<span class="badge badge-{{ $badge }} px-2 py-1 text-white shadow-xs">{{ $item->action }}</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="align-middle text-left"><small class="text-dark">{{ $item->activity }}</small></td>
|
|
|
|
|
<td class="align-middle"><small class="text-muted">{{ $item->browser }}</small></td>
|
|
|
|
|
<td class="align-middle">
|
|
|
|
|
<div style="line-height: 1.1;">
|
|
|
|
|
<small class="d-block font-weight-bold">{{ $item->created_at->format('d M Y') }}</small>
|
|
|
|
|
<small class="text-muted" style="font-size: 10px;">{{ $item->created_at->format('H:i') }} ({{ $item->created_at->diffForHumans() }})</small>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
@endforeach
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- FOOTER CARD UNTUK PAGINATION -->
|
|
|
|
|
<div class="card-footer bg-white py-3 border-top-0">
|
|
|
|
|
<div class="d-flex justify-content-center">
|
|
|
|
|
{{ $data->links() }}
|
2025-01-01 17:14:46 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
2026-06-01 15:01:03 +07:00
|
|
|
@endsection
|