<?php
require_once dirname(__DIR__) . '/bootstrap/chairman_bootstrap.php';
$raceDate = isset($_GET['race_date']) ? chairman_safe_date($_GET['race_date']) : date('Y-m-d');
$venue = isset($_GET['venue']) ? $_GET['venue'] : '';
$raceNum = isset($_GET['race_num']) ? intval($_GET['race_num']) : 0;
$result = $Chairman->buildCache($raceDate,$venue,$raceNum);
header('Content-Type: text/html; charset=utf-8');
?>
<!doctype html><html lang="zh-Hant"><head><meta charset="utf-8"><title>Chairman Cache Builder</title>
<style>body{background:#050914;color:#e7fbff;font-family:Arial;padding:25px}.box{border:1px solid #283c59;background:#0c1423;padding:18px;border-radius:12px}.ok{color:#32ffa7}.gold{color:#ffc107}pre{white-space:pre-wrap;color:#9ed9ff}</style></head>
<body><h1>Chairman Cache Builder v1.4</h1><div class="box"><p class="ok">Cache Built OK</p><p>File: <span class="gold"><?=chairman_h($result['public_file'])?></span></p><p>Bytes: <?=chairman_h($result['bytes'])?></p><pre><?=chairman_h(json_encode($result['payload'],JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT))?></pre></div></body></html>
