HEX
Server: nginx/1.24.0
System: Linux webserver-one 6.8.0-101-generic #101-Ubuntu SMP PREEMPT_DYNAMIC Mon Feb 9 10:15:05 UTC 2026 x86_64
User: www-data (33)
PHP: 8.4.18
Disabled: NONE
Upload Files
File: /srv/www/rectt-csmcri.res.in/public_html/success.php
<?php
session_start();

if (!isset($_SESSION['registered'])) {
    header("location:login.php");
}


if (!isset($_SESSION['application_id'])) {
    header("location:login.php");
}

// Check if application_id is available from the redirect
$application_id = isset($_GET['app_id']) ? intval($_GET['app_id']) : ($_SESSION['last_application_id'] ?? 0);
// $application_id = $_SESSION["application_id"];


// Clear the session variable after use if desired
// unset($_SESSION['last_application_id']);

// You might want to add a check here to ensure the user is logged in
// and that the application_id is valid and belongs to the user

?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Application Submitted Successfully</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background-color: #f8f9fa;
        }

        .success-container {
            text-align: center;
            padding: 40px;
            background-color: #ffffff;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .success-container h1 {
            color: #28a745;
            margin-bottom: 20px;
        }

        .success-container p {
            color: #6c757d;
            margin-bottom: 30px;
        }

        .btn-download {
            background-color: #007bff;
            border-color: #007bff;
            color: white;
            padding: 10px 20px;
            font-size: 18px;
            border-radius: 5px;
            text-decoration: none;
            /* Remove underline from link */
        }

        .btn-download:hover {
            background-color: #0056b3;
            border-color: #004085;
            color: white;
        }
    </style>
</head>

<body>
    <div class="success-container">
        <h1>Application Submitted Successfully!</h1>
        <p>Thank you for submitting your application.</p>
        <?php if ($application_id > 0): ?>
            <a href="generate_pdf.php" class="btn btn-download" target="_blank">Download Application PDF</a>
        <?php else: ?>
            <p class="text-danger">Could not retrieve application details for download.</p>
        <?php endif; ?>
        <br><br>
        <a href="logout.php" class="btn btn-secondary">Logout</a>
    </div>
</body>

</html>