<?php
session_start();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $judge_id = intval($_POST['judge_id']);
    $_SESSION['user'] = 'judge_' . $judge_id;
    $_SESSION['role'] = 'judge';
    $_SESSION['judge_id'] = $judge_id;
    header('Location: score.php');
    exit;
}
?>
<?php
if(!isset($_SESSION)) { session_start(); }
?>
<!DOCTYPE html>
<html>
<head>
    <title>Freestyle Scoring App</title>
    <?php include_once '../includes/stylesheets.php'; ?>

</head>
<body class="body-bg-aurora-bright">
    <?php include '../menu.php'; ?>

<div class="container-fluid container-StyleScore p-4">
    
<h2>Judge Login</h2>
<form method="post">
    <div class="mb-3">
        <label for="judge_id" class="form-label">Judge ID</label>
        <input type="number" class="form-control" name="judge_id" required>
    </div>
    <button type="submit" class="btn btn-primary">Login</button>
</form>

</div>
</body>
</html>