<?php require_once __DIR__.'/../includes/functions.php'; $admin=require_admin(); mj_ensure_listing_module_schema(true); $adminTitle='Listing Logs'; $id=(int)($_GET['listing_id']??0); $rows=$id?all_rows('SELECT * FROM mj_listing_logs WHERE listing_id=? ORDER BY id DESC LIMIT 500',[$id]):all_rows('SELECT * FROM mj_listing_logs ORDER BY id DESC LIMIT 500'); include __DIR__.'/_header.php'; ?>
<div class="card card-primary card-outline"><div class="card-header"><h3 class="card-title"><i class="fas fa-history mr-2"></i>Listing Audit Logs</h3></div><div class="card-body table-responsive"><table class="table table-striped mj-data-table"><thead><tr><th>ID</th><th>Listing</th><th>Action</th><th>User</th><th>Admin</th><th>IP</th><th>Date</th></tr></thead><tbody><?php foreach($rows as $r): ?><tr><td><?=e($r['id'])?></td><td><a href="listing-edit.php?id=<?=e($r['listing_id'])?>">#<?=e($r['listing_id'])?></a></td><td><span class="badge badge-info"><?=e($r['action'])?></span></td><td><?=e($r['user_id'])?></td><td><?=e($r['admin_id'])?></td><td><?=e($r['ip_address'])?></td><td><?=e($r['created_at'])?></td></tr><?php endforeach; ?></tbody></table></div></div><?php include __DIR__.'/_footer.php'; ?>
