File manager - Edit - /var/www/payraty/hris/resources/views/audit_trail/index.blade.php
Back
@extends('layouts.admin') @section('page-title') {{ __('Manage Audit') }} @endsection @section('breadcrumb') <li class="breadcrumb-item"><a href="{{ route('dashboard') }}">{{ __('Home') }}</a></li> <li class="breadcrumb-item">{{ __('Audit') }}</li> @endsection @section('content') <div class="row"> <div class="col-xl-12"> <div class="card"> <div class="card-header card-body table-border-style"> {{-- <h5></h5> --}} <div class="table-responsive"> <table class="table" id="pc-dt-simple"> <thead> <tr> <th>S/N</th> <th>Date & Time</th> <th>Action</th> <th>Module Name</th> <th>Description</th> <th>Performed By</th> <th>Role</th> <!-- <th>Action</th> --> </tr> </thead> <tbody> @foreach ($audits as $index => $audit) <tr> <td>{{ $index + 1 }}</td> <td>{{ \Carbon\Carbon::parse($audit->created_at)->format('Y-m-d, H:i') }}</td> <td>{{ ucfirst($audit->event) }}</td> <td>{{ $audit->log_name }}</td> <td>{{ $audit->description }}</td> <td> @if($audit->causer) {{ $audit->causer->email }} @else <em class="text-muted">System</em> @endif </td> <td>{{ $audit->causer->role ?? 'N/A' }}</td> <!-- <td> <i class="fa-solid fa-ellipsis cursor-pointer" onclick="openAuditModal({{ $audit->id }})"></i> <div class="modal fade" id="auditModal{{ $audit->id }}" tabindex="-1" aria-labelledby="auditModalLabel{{ $audit->id }}" aria-hidden="true"> <div class="modal-dialog modal-dialog-scrollable"> <div class="m-4 modal-content"> <div class="modal-header"> <h5 class="modal-title text-primary" id="auditModalLabel{{ $audit->id }}">Audit Attributes</h5> <button type="button" class="btn btn-close" onclick="closeAuditModal({{ $audit->id }})" aria-label="Close">x</button> </div> <div class="modal-body"> @php $props = $audit->properties->toArray(); @endphp @if(!empty($props['attributes'])) <ul class="px-2 list-group mb-3"> @foreach ($props['attributes'] as $key => $value) <li class="list-group-item d-flex justify-content-between align-items-center"> <strong>{{ $key }}</strong> {{-- <span>{{ is_array($value) ? implode(', ', $value) : $value }}</span> --}} <span> {{ is_array($value) ? implode(', ', array_map('strval', \Illuminate\Support\Arr::flatten($value))) : $value ?? '' }} </span> </li> @endforeach </ul> @else <p class="text-muted fst-italic">No attributes found.</p> @endif @if($audit->event === 'updated' && !empty($props['old'])) <h6 class="px-2 mt-3 text-primary">Changes</h6> <ul class="px-2 pb-3 list-group"> @foreach ($props['attributes'] as $key => $newVal) @if (isset($props['old'][$key]) && $props['old'][$key] !== $newVal) <li class="list-group-item d-flex justify-content-between align-items-center"> <strong>{{ $key }}</strong> <span> <del>{{ $props['old'][$key] }}</del> → {{ $newVal }} </span> </li> @endif @endforeach </ul> @endif </div> </div> </div> </div> </td> --> </tr> @endforeach </tbody> </table> @if(count($audits) === 0) <div class="text-center py-4"> <p>No audit logs found.</p> </div> @endif </div> </div> </div> </div> </div> @endsection <script> // Store modal instances const auditModals = {}; // Initialize all modals on page load document.addEventListener('DOMContentLoaded', () => { @foreach ($audits as $audit) auditModals[{{ $audit['id'] }}] = new bootstrap.Modal(document.getElementById('auditModal{{ $audit['id'] }}'), { keyboard: false }); @endforeach }); // Function to open modal manually function openAuditModal(id) { auditModals[id].show(); } // Function to close modal manually function closeAuditModal(id) { auditModals[id].hide(); } </script>
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings