<?php require_once __DIR__.'/../includes/functions.php'; $admin=require_admin(); $adminTitle='Health / Backup';
$health=['PHP Version'=>PHP_VERSION,'Database'=> 'Connected','Upload Folder'=>is_writable(__DIR__.'/../assets/uploads')?'Writable':'Not writable','Storage Folder'=>is_writable(__DIR__.'/../storage')?'Writable':'Not writable','Timezone'=>date_default_timezone_get(),'Server Time'=>date('Y-m-d H:i:s'),'Memory Limit'=>ini_get('memory_limit'),'Upload Max'=>ini_get('upload_max_filesize')];
$logs=all_rows('SELECT * FROM mj_cron_logs ORDER BY id DESC LIMIT 20'); include __DIR__.'/_header.php'; ?>
<div class="row"><?php foreach($health as $k=>$v): ?><div class="col-md-6 col-xl-3"><div class="info-box"><span class="info-box-icon bg-info"><i class="fas fa-heartbeat"></i></span><div class="info-box-content"><span class="info-box-text"><?=e($k)?></span><span class="info-box-number"><?=e($v)?></span></div></div></div><?php endforeach; ?></div>
<div class="row"><div class="col-lg-6"><div class="card card-primary card-outline"><div class="card-header"><h3 class="card-title">Backup Notes</h3></div><div class="card-body"><p>Use cPanel/WHM backup, MySQL dump, or your MJ server backup app for production backup. This project includes database tables for cron logs and backup integration placeholders.</p><ul><li>Backup database daily.</li><li>Backup <code>assets/uploads</code> folder.</li><li>Test restore before production launch.</li></ul></div></div></div><div class="col-lg-6"><div class="card"><div class="card-header"><h3 class="card-title">Recent Cron Logs</h3></div><div class="card-body"><table class="table table-striped"><thead><tr><th>Job</th><th>Status</th><th>Started</th></tr></thead><tbody><?php foreach($logs as $l): ?><tr><td><?=e($l['job_name'])?></td><td><?=e($l['status'])?></td><td><?=e($l['started_at'])?></td></tr><?php endforeach; ?></tbody></table></div></div></div></div>
<?php include __DIR__.'/_footer.php'; ?>
