<?php
session_start();
if (!isset($_SESSION['user'])) {
    header("Location: login.php");
    exit;
}
$success = $_SESSION['success'] ?? '';
unset($_SESSION['success']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Summer Training Programme – 2026</title>
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link rel="icon" href="assets/img/logo.png" type="image/png">
<style>
body { font-family: "Noto Sans", sans-serif; background-color: #f8f9fa; padding-top: 30px; }
.table th, .table td { vertical-align: middle !important; }
</style>
</head>
<body class="container">

<?php include 'header.php'; ?>

<h2 class="text-center">Summer Training Programme – 2026</h2>
<p class="text-center"><strong>10<sup>th</sup> February – 10<sup>th</sup> March 2026</strong></p>
<h2 class="text-center">Summer Training Programme – 2026</h2>
<h3 class="text-center">Application Form</h3>

<?php if(!empty($success)): ?>
<div class="alert alert-success text-center"><?= $success ?></div>
<script>setTimeout(()=>{document.querySelector('.alert-success').style.display='none';},5000);</script>
<?php endif; ?>

<form method="post" action="application_save.php" enctype="multipart/form-data">
<table class="table table-bordered">

<!-- Application Details -->

<tr>
    <td><strong>Are you pursuing Masters from Mumbai University?</strong></td>
    <td>
        <select name="mumbai_univ" class="form-control" required>
            <option value="">--select--</option>
            <option value="Yes">Yes</option>
            <option value="No">No</option>
        </select>
    </td>
</tr>

<tr>
    <td><strong>Training duration required:</strong></td>
    <td>
        <select name="training_duration" class="form-control" required>
            <option value="">--select--</option>
            <option value="3 months">3 months</option>
            <option value="5 months">5 months</option>
            <option value="6 months">6 months</option>
        </select>
    </td>
</tr>

<!-- Personal Info -->
<tr><td>Name</td><td><input type="text" name="nam" class="form-control" required></td></tr>
<tr><td>Father / Mother / Husband Name</td><td><input type="text" name="guardian_name" class="form-control" required></td></tr>
<tr><td>Upload Photograph (&lt;2MB)</td><td><input type="file" name="file" accept="image/*" class="form-control" required></td></tr>
<tr><td>Address</td><td><textarea name="address_co" class="form-control" required></textarea></td></tr>
<tr><td>State/UT</td><td><input type="text" name="states" class="form-control" required></td></tr>
<tr><td>Mobile</td><td><input type="number" name="mob_no" class="form-control" required></td></tr>
<tr><td>Email</td><td><input type="email" name="email_id" class="form-control" required></td></tr>
<tr><td>Date of Birth</td><td><input type="date" name="dob" class="form-control" required></td></tr>
<tr><td>Gender</td><td><select name="gender" class="form-control" required><option value="">--select--</option><option>Male</option><option>Female</option><option>Other</option></select></td></tr>
<tr><td>Category</td><td><select name="category" class="form-control" required><option value="">--select--</option><option>General</option><option>OBC</option><option>SC</option><option>ST</option></select></td></tr>
<tr><td>Nationality</td><td><input type="text" name="nationality" value="India" class="form-control" required></td></tr>

<!-- 12th -->
<tr><td colspan="2"><strong>Academic Record – 12th</strong></td></tr>
<tr><td>Board</td><td><input type="text" name="twelfth_board" class="form-control" required></td></tr>
<tr><td>Year</td><td><input type="number" name="twelfth_year" class="form-control" required></td></tr>
<tr><td>Subjects</td><td><textarea name="twelfth_subjects" class="form-control" required></textarea></td></tr>
<tr><td>Division</td><td><input type="text" name="twelfth_division" class="form-control" required></td></tr>
<tr><td>Percentage</td><td><input type="text" name="twelfth_percentage" class="form-control" required></td></tr>
<tr><td>Upload 12th Marksheet</td><td><input type="file" name="twoth_d" accept=".pdf" class="form-control" required></td></tr>

<!-- Graduation -->
<tr><td colspan="2"><strong>Graduation Details</strong></td></tr>
<tr><td>Degree</td><td><input type="text" name="grad_degree" class="form-control" required></td></tr>
<tr><td>Subject</td><td><input type="text" name="grad_subject" class="form-control" required></td></tr>
<tr><td>University</td><td><input type="text" name="grad_university" class="form-control" required></td></tr>
<tr><td>Year</td><td><input type="number" name="grad_year" class="form-control" required></td></tr>
<tr><td>Division</td><td><input type="text" name="grad_division" class="form-control" required></td></tr>
<tr><td>Percentage</td><td><input type="text" name="grad_percentage" class="form-control" required></td></tr>
<tr><td>Upload Highest Degree</td><td><input type="file" name="highest_d" accept=".pdf" class="form-control" required></td></tr>

<!-- PG -->
<tr><td colspan="2"><strong>PG Course</strong></td></tr>
<tr><td>Course</td><td><input type="text" name="pg_course" class="form-control" required></td></tr>
<tr><td>Year</td><td><input type="number" name="pg_year" class="form-control" required></td></tr>
<tr><td>Subject</td><td><input type="text" name="pg_subject" class="form-control" required></td></tr>
<tr><td>University</td><td><input type="text" name="pg_university" class="form-control" required></td></tr>
<tr><td>Division</td><td><input type="text" name="pg_division" class="form-control" required></td></tr>
<tr><td>Percentage</td><td><input type="text" name="pg_percentage" class="form-control" required></td></tr>
<tr><td>Upload PG Marksheet</td><td><input type="file" name="pg_marksheet" accept=".pdf" class="form-control" required></td></tr>

<!-- College -->
<tr><td>College Name</td><td><input type="text" name="college_name" class="form-control" required></td></tr>
<tr><td>College Address</td><td><textarea name="college_address" class="form-control" required></textarea></td></tr>
<tr><td>HOD Name</td><td><input type="text" name="hod_name" class="form-control" required></td></tr>
<tr><td>HOD Contact</td><td><input type="text" name="hod_contact" class="form-control" required></td></tr>

<tr><td>Training Period</td><td><div class="row"><div class="col"><input type="month" name="training_from" class="form-control" required></div><div class="col"><input type="month" name="training_to" class="form-control" required></div></div></td></tr>
<tr><td>COVID Status</td><td><select name="covid_status" class="form-control" required><option value="">--select--</option><option>Fully</option><option>Partially</option><option>Not Vaccinated</option></select></td></tr>
<tr><td>Forwarded by HOD</td><td><select name="hod_approval" class="form-control" required><option value="">--select--</option><option value="Yes">Yes</option><option value="Not Applicable">Not Applicable</option></select></td></tr>
<tr><td>Recommendation Letter</td><td><input type="file" name="reco" accept=".pdf" class="form-control"></td></tr>

<tr><td colspan="2"><input type="checkbox" required> I declare information is correct</td></tr>
<tr><td colspan="2" class="text-center"><button class="btn btn-success">Submit</button></td></tr>

</table>
</form>

<?php include 'footer.php'; ?>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
</body>
</html>