<?php
require_once __DIR__.'/../includes/functions.php';
$admin=require_admin(); $adminTitle='SEO Center';
$count=table_exists('mj_pages') ? safe_count('SELECT COUNT(*) c FROM mj_pages') : 0;
$rows=[];
if(table_exists('mj_pages')) { try { $rows=all_rows('SELECT * FROM mj_pages ORDER BY id DESC LIMIT 200'); } catch(Throwable $e) { $rows=[]; } }
include __DIR__.'/_header.php';
?>
<div class="row"><div class="col-lg-3 col-6"><div class="small-box bg-primary"><div class="inner"><h3><?=number_format($count)?></h3><p>Total Records</p></div><div class="icon"><i class="fas fa-search"></i></div></div></div><div class="col-lg-3 col-6"><div class="small-box bg-info"><div class="inner"><h3>Ready</h3><p>Module Status</p></div><div class="icon"><i class="fas fa-check-circle"></i></div></div></div><div class="col-lg-3 col-6"><div class="small-box bg-warning"><div class="inner"><h3>CSV</h3><p>Import/Export Ready</p></div><div class="icon"><i class="fas fa-file-export"></i></div></div></div><div class="col-lg-3 col-6"><div class="small-box bg-success"><div class="inner"><h3>Admin</h3><p>Manage Together</p></div><div class="icon"><i class="fas fa-cogs"></i></div></div></div></div>
<div class="card card-primary card-outline"><div class="card-header"><h3 class="card-title"><i class="fas fa-search mr-2"></i>SEO Center</h3></div><div class="card-body"><p class="lead">SEO title, description, schema, sitemap and country/category SEO tools.</p><div class="alert alert-info">This module is included as an advanced MJ Stable Admin management screen. Connect payment gateways, SMS/WhatsApp, email queue or AI providers from Settings/Modules when ready.</div><?php if(!$rows): ?><div class="text-muted">No records yet.</div><?php else: ?><div class="table-responsive"><table class="table table-striped mj-data-table"><thead><tr><?php foreach(array_keys($rows[0]) as $col): ?><th><?=e($col)?></th><?php endforeach; ?></tr></thead><tbody><?php foreach($rows as $r): ?><tr><?php foreach($r as $v): ?><td><?=e((strlen((string)$v)>80 ? substr((string)$v,0,80).'...' : (string)$v))?></td><?php endforeach; ?></tr><?php endforeach; ?></tbody></table></div><?php endif; ?></div></div>
<?php include __DIR__.'/_footer.php'; ?>
