<?php
session_start();
require_once(__DIR__ . '/../config.php');
include(__DIR__ . '/../header/header.php');
?>
<?php
$id = $_GET['course_id'];
$course = mysqli_fetch_assoc(mysqli_query($conn,"SELECT * FROM courses_events WHERE id='$id'"));
?>

<div class="container py-5">
    <h2>Apply for <?= $course['title']; ?></h2>

    <form action="save_application.php" method="POST">
        <input type="hidden" name="course_id" value="<?= $id; ?>">

        <input type="text" name="name" placeholder="Full Name" class="form-control mb-3" required>
        <input type="email" name="email" placeholder="Email" class="form-control mb-3" required>
        <input type="text" name="phone" placeholder="Phone" class="form-control mb-3" required>

        <button class="btn btn-success">Apply Now</button>
    </form>
</div>