<h4 class="mb-4"><i class="fas fa-clipboard-list me-2"></i><?= lang('admin.audit_log') ?></h4>
<div class="card mb-3"><div class="card-body">
    <div class="row g-2" data-filter-table="audit-table">
        <div class="col-md-2"><select name="user_filter" class="form-select form-select-sm"><option value="">All Users</option><?php foreach ($users as $u): ?><option value="<?= $u['id'] ?>"><?= e($u['full_name_en']) ?></option><?php endforeach; ?></select></div>
        <div class="col-md-2"><select name="module_filter" class="form-select form-select-sm"><option value="">All Modules</option><?php foreach ($modules as $m): ?><option value="<?= e($m['module']) ?>"><?= e($m['module']) ?></option><?php endforeach; ?></select></div>
        <div class="col-md-2"><select name="action_filter" class="form-select form-select-sm"><option value="">All Actions</option><option value="create">Create</option><option value="update">Update</option><option value="delete">Delete</option><option value="login">Login</option><option value="logout">Logout</option></select></div>
        <div class="col-md-2"><input type="date" name="date_from" class="form-control form-control-sm" placeholder="From"></div>
        <div class="col-md-2"><input type="date" name="date_to" class="form-control form-control-sm" placeholder="To"></div>
        <div class="col-md-2"><button type="button" class="btn btn-sm btn-primary w-100" onclick="DataTableHelper.reload('audit-table')"><i class="fas fa-filter me-1"></i>Filter</button></div>
    </div>
</div></div>
<div class="card"><div class="card-body">
    <table id="audit-table" class="table table-striped table-sm w-100" data-url="/admin/audit-log/datatable"
           data-columns='[{"data":"id"},{"data":"datetime"},{"data":"user"},{"data":"action"},{"data":"module"},{"data":"entity"},{"data":"description"},{"data":"ip"},{"data":"actions","orderable":false}]'>
        <thead><tr><th>#</th><th>Time</th><th>User</th><th>Action</th><th>Module</th><th>Entity</th><th>Description</th><th>IP</th><th></th></tr></thead>
    </table>
</div></div>
<?php $__view->push('scripts') ?><script>DataTableHelper.init('audit-table',{order:[[0,'desc']],pageLength:50});</script><?php $__view->endPush() ?>