<?php include 'includes/header.php'; $promo=file_exists(__DIR__.'/data/promo.json')?json_decode(file_get_contents(__DIR__.'/data/promo.json'),true):[]; if(!is_array($promo))$promo=[]; $sent=!empty($_GET['sent']); ?>
<div class="container content-box mt-5"><div class="text-center mb-5"><h1>Events & Promotions</h1><p class="subtext">What is happening around Home Time Radio</p></div><?php if(empty($promo['enabled'])): ?><div class="bg-light p-4 rounded">No active events or promotions right now.</div><?php else: ?><div class="bg-light p-4 rounded mb-4"><h3><?= htmlspecialchars($promo['title']??'Promotion') ?></h3><p><?= nl2br(htmlspecialchars($promo['description']??'')) ?></p><?php if(!empty($promo['prizes'])&&is_array($promo['prizes'])): ?><ul><?php foreach($promo['prizes'] as $prize): ?><li><?= htmlspecialchars($prize) ?></li><?php endforeach; ?></ul><?php endif; ?></div><div class="bg-light p-4 rounded"><?php if($sent): ?><div class="alert alert-success">Entry received. Good luck!</div><?php endif; ?><form method="post" action="send_promo_entry.php"><div class="mb-3"><input class="form-control" name="name" placeholder="Your name" required></div><div class="mb-3"><input class="form-control" name="email" type="email" placeholder="Your email" required></div><div class="mb-3"><textarea class="form-control" name="message" rows="5" placeholder="Message"></textarea></div><button class="btn btn-dark">Submit Entry</button></form></div><?php endif; ?></div><?php include 'includes/footer.php'; ?>
