<?php
require_once __DIR__.'/../includes/functions.php';
require_once __DIR__.'/../includes/v292_admin_portal_helpers.php';
$admin=require_admin(); mj292_ensure_schema();
$adminTitle='Migration Status'; $adminSubtitle='Check important tables/settings for current version.';
$checks=['mj_users','mj_listings','mj_companies','mj_payment_batches','mj_payment_batch_items','mj_invoices','mj_invoice_items','mj_receipts','mj_wallets','mj_wallet_transactions','mj_admin_reset_logs','mj_admin_notes','mj_support_tickets','mj_lead_events'];
include __DIR__.'/_header.php';
?>
<div class="card mj-v292-card"><div class="card-header"><h3 class="card-title">Schema Check</h3></div><div class="table-responsive"><table class="table mb-0"><thead><tr><th>Table</th><th>Status</th><th class="text-right">Rows</th></tr></thead><tbody><?php foreach($checks as $t): $ok=table_exists($t); ?><tr><td><code><?=e($t)?></code></td><td><?=$ok?'<span class="badge badge-success">Installed</span>':'<span class="badge badge-danger">Missing</span>'?></td><td class="text-right"><?=e($ok?mj292_count($t):0)?></td></tr><?php endforeach; ?></tbody></table></div><div class="card-footer"><code>install/migration_v2.9.12_admin_portal_ux_safe_reset_reports_clean_menu_invoice_print_automation.sql</code></div></div>
<?php include __DIR__.'/_footer.php'; ?>
