📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
admission
Dosya Düzenle: ExamFormFill.php
<?php session_start(); if (!isset($_SESSION['collegeroll'])) { header("Location: index.html"); exit; } // NEW CONDITION → Only allow 25xxxx students $loginRoll = $_SESSION['collegeroll']; $firstTwoDigits = substr($loginRoll, 0, 2); if ($firstTwoDigits == "25") { header("Location: ExamForm1stSem.php"); exit; } ?> <?php include("connect.php"); // Get session data $guroll = $_SESSION['guroll']; $collegeroll = $_SESSION['collegeroll']; $guroll = isset($_SESSION['guroll']) ? $_SESSION['guroll'] : ''; $prefix = strtoupper(substr($guroll, 0, 2)); // Get UA, US, UT, UV $selectedStream = ''; $enabledStreams = []; switch ($prefix) { case 'UA': $selectedStream = 'Arts'; $enabledStreams = ['Arts']; break; case 'US': $selectedStream = 'Science'; $enabledStreams = ['Science']; break; case 'UT': $selectedStream = 'BCA'; $enabledStreams = ['BCA']; break; case 'UV': $selectedStream = 'MLMDT'; // or 'FPT' if you prefer $enabledStreams = ['MLMDT', 'FPT']; break; } $yearx = $_SESSION['admissionfor']; $amountx; if ($yearx == "5th Semester"){ $amountx = 7000; } else{ $amountx = 8000; } /// Step 1: Check if the form is already submitted and get form number $sql = "SELECT registrationformno, status FROM form_status WHERE guroll = ? AND collegeroll = ? LIMIT 1"; $stmt = $con->prepare($sql); $stmt->bind_param("ss", $guroll, $collegeroll); $stmt->execute(); $result = $stmt->get_result(); $formSubmitted = false; $formno = ''; $admitted = 'no'; if ($row = $result->fetch_assoc()) { $formno = $row['registrationformno']; if ($row['status'] === 'Submitted') { $formSubmitted = true; } elseif ($row['status'] === 'Verified') { $formSubmitted = true; $admitted = 'yes'; } echo $formno; // Output the form number } $stmt->close(); // Step 2: If form is submitted, retrieve the fees associated with the form number if ($formSubmitted) { $sqlFees = "SELECT fees, payment_status FROM fee_details WHERE challan_no = ?"; $stmtFees = $con->prepare($sqlFees); $stmtFees->bind_param("s", $formno); $stmtFees->execute(); $resultFees = $stmtFees->get_result(); $fees = null; $paymentStatus = null; if ($rowFees = $resultFees->fetch_assoc()) { $fees = $rowFees['fees']; $paymentStatus = $rowFees['payment_status']; } else { $fees = "Not found"; $paymentStatus = "Not found"; } $stmtFees->close(); // Use JS alert for popup // Optional: Also show fees info on page echo "Fees: " . htmlspecialchars($fees) . "<br>"; } else { } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Admission Form 2025-26</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Bootstrap 4 CSS --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> <!-- Font Awesome --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <style> body { font-family: 'Segoe UI', sans-serif; background-color: #f4f6f9; } .sidebar { height: 100vh; background-color: #343a40; color: white; position: fixed; width: 220px; top: 0; left: 0; padding-top: 60px; } .sidebar a { color: #cfd8dc; text-decoration: none; display: block; padding: 12px 20px; transition: 0.3s; } .sidebar a:hover { background-color: #495057; color: white; } .content { margin-left: 220px; padding: 40px 20px; } .card { box-shadow: 0 0 20px rgba(0,0,0,0.05); transition: 0.3s; } .card:hover { transform: translateY(-5px); } .form-section-title { font-weight: bold; font-size: 1.2rem; margin-top: 20px; margin-bottom: 10px; color: #343a40; } .card { max-width: 700px; margin: 80px auto; border-radius: 16px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); } .card-header { background: linear-gradient(135deg, #007bff, #6610f2); color: white; font-weight: 600; } .form-section { display: none; margin-top: 20px; animation: fadeIn 0.5s ease-in-out; } @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } } .btn-group .btn { border-radius: 8px; font-weight: 500; transition: all 0.3s ease; } .btn-group .btn:hover { transform: scale(1.05); } </style> </head> <body> <?php include 'sidebar.php'; ?> <!-- Main Content --> <div class="content"> <?php include 'topbar.php'; ?> <?php $collegeroll = $_SESSION['collegeroll']; $status = 'Verified'; // SQL query to fetch verified student $query1 = "SELECT * FROM form_status WHERE collegeroll = '$collegeroll' AND status = '$status'"; $result1 = mysqli_query($con, $query1); if($rw1= mysqli_fetch_array($result1)) { $gurl = $rw1['guroll']; } // replace with actual value, e.g., from $_SESSION['collegeroll'] // Extract first two digits $firstTwo = substr($collegeroll, 0, 2); // Determine semester if ($firstTwo === "24") { $sem = "4th Semester"; } elseif ($firstTwo === "23") { $sem = "6th Semester"; } else { $sem = "Unknown Semester"; } ?> <div class="card"> <div class="card-header text-center"> Exam Form Fill-up Portal </div> <div class="card-body text-center"> <h4 class="mb-3">Exam Form Challan Generation for <span class="text-primary"><?php echo $_SESSION['name']; ?></span></h4> <p align="justify">Students are required to generate their exam form challans carefully. While filling the form, please ensure the following: <br><br> <b>1. <font color="#2f58fa">Regular Students:</font></b> Select the Regular option only.<br> <b>2. <font color="#fa2f40">Arrear Students: </font></b>Select the Arrear option only.<br> <b>3. Students with Both <font color="#2f58fa"> Regular</font> and <font color="#fa2f40">Arrear</font> Exams:</b> If you have both regular and arrear papers, you must fill both Regular and Arrear forms separately, one after another.<br><br> <i>Please double-check your selection before submission to avoid any discrepancies.</i></p> <div class="btn-group mt-4" role="group"> <button type="button" id="regularBtn" class="btn btn-primary me-2"> Regular Form </button> <button type="button" id="arrearBtn" class="btn btn-danger"> Arrear Form </button> </div> <!-- Regular Form Section --> <div id="regularForm" class="text-start" style="display:block;"> <form action="regular_submit.php" method="POST" class="mt-4"> <div class="mb-3"> <b>For Regular Students only</b><br> <label class="form-label">Name</label> <input type="text" name="name" class="form-control" value="<?php echo $_SESSION['name']; ?>" readonly> </div> <div class="mb-3"> <label class="form-label">GU ROLL No</label> <input type="text" name="gu" class="form-control" value="<?php echo $guroll; ?>" readonly> </div> <div class="mb-3"> <label class="form-label">Semester</label> <input type="text" name="sem" class="form-control" value="<?php echo $sem; ?>" readonly> </div> <div class="mb-3"> <label class="form-label">College Roll</label> <input type="text" name="college_roll" class="form-control" value="<?php echo $collegeroll; ?>" readonly> </div> <!-- ✅ Paper Type Section --> <div class="mb-4 p-3 border rounded-3 shadow-sm bg-light"> <h6 class="mb-3 text-primary fw-bold">Select Paper Type</h6> <div class="d-flex flex-column flex-sm-row gap-3"> <div class="form-check"> <input class="form-check-input" type="radio" name="paper_type" id="withoutPractical" value="without" required> <label class="form-check-label" for="withoutPractical"> Without Practical Paper </label> </div> <div class="form-check"> <input class="form-check-input" type="radio" name="paper_type" id="withPractical" value="with"> <label class="form-check-label" for="withPractical"> I have Practical Paper </label> </div> <div class="form-check"> <input class="form-check-input" type="radio" name="paper_type" id="withPracticalbca" value="with"> <label class="form-check-label" for="withPracticalbca"> BCA 4th/BCA 6th </label> </div> </div> <!-- ✅ Practical Count Section --> <div class="mb-4 p-3 border rounded-3 shadow-sm bg-light" id="practicalCountSection" style="display: none;"> <label for="practicalCount" class="form-label fw-semibold"> How many Practical Papers do you have? </label> <select id="practicalCount" name="practical_count" class="form-select"> <option value="">Select number</option> <option value="1">1 Paper</option> <option value="2">2 Papers</option> <option value="3">3 Papers</option> <option value="4">4 Papers</option> </select> </div> <!-- ✅ Amount Section --> <div class="mb-4 p-3 border rounded-3 shadow-sm bg-light"> <label for="amount" class="form-label fw-semibold">Amount (₹)</label> <input type="text" id="amount" name="amount" class="form-control text-center fw-bold fs-5 bg-white" readonly placeholder="Amount will appear here"> </div> <!-- ✅ Script --> <script> document.addEventListener('DOMContentLoaded', function () { var withoutPractical = document.getElementById('withoutPractical'); var withPractical = document.getElementById('withPractical'); var withPracticalbca = document.getElementById('withPracticalbca'); var practicalCountSection = document.getElementById('practicalCountSection'); var practicalCount = document.getElementById('practicalCount'); var amount = document.getElementById('amount'); withoutPractical.addEventListener('change', function () { if (this.checked) { practicalCountSection.style.display = 'none'; practicalCount.value = ''; amount.value = '500'; } }); withPracticalbca.addEventListener('change', function () { if (this.checked) { practicalCountSection.style.display = 'none'; practicalCount.value = ''; amount.value = '1100'; } }); withPractical.addEventListener('change', function () { if (this.checked) { practicalCountSection.style.display = 'block'; amount.value = ''; } }); practicalCount.addEventListener('change', function () { var count = parseInt(this.value); if (isNaN(count)) { amount.value = ''; return; } switch (count) { case 1: amount.value = '800'; break; case 2: amount.value = '1100'; break; case 3: amount.value = '1400'; break; case 4: amount.value = '1700'; break; default: amount.value = ''; } }); }); </script> <button type="submit" class="btn btn-success w-100">Submit Regular Form</button> </form> </div> </div> <!-- ✅ Script --> <script> document.addEventListener('DOMContentLoaded', function () { var withoutPractical = document.getElementById('withoutPractical'); var withPractical = document.getElementById('withPractical'); var practicalCountSection = document.getElementById('practicalCountSection'); var practicalCount = document.getElementById('practicalCount'); var amount = document.getElementById('amount'); // When user selects paper type withoutPractical.addEventListener('change', function () { if (this.checked) { practicalCountSection.style.display = 'none'; practicalCount.value = ''; amount.value = '500'; } }); withPractical.addEventListener('change', function () { if (this.checked) { practicalCountSection.style.display = 'block'; amount.value = ''; } }); // When user selects number of practical papers practicalCount.addEventListener('input', function () { var count = parseInt(this.value); if (isNaN(count)) { amount.value = ''; return; } switch (count) { case 1: amount.value = '800'; break; case 2: amount.value = '1100'; break; case 3: amount.value = '1400'; break; case 4: amount.value = '1700'; break; default: amount.value = ''; } }); }); </script> <!-- Arrear Form Section --> <div id="arrearForm" class="form-section text-start"> <form action="arrear_submit.php" method="POST" class="mt-4"> <div class="mb-3"> <b>For Arrear Students only</b><br> <label class="form-label">Name</label> <input type="text" name="name" class="form-control" value="<?php echo $_SESSION['name']; ?>" readonly> </div> <div class="mb-3"> <label class="form-label">GU ROLL No</label> <input type="text" name="gu" class="form-control" value="<?php echo $guroll; ?>" readonly> </div> <div class="mb-3"> <label class="form-label">Semester</label> <!--input type="text" name="sem" class="form-control" value="3rd Semester" readonly--> <select name="sem" class="form-control" required> <option value="">Select Semester</option> <option value="2nd Semester">2nd Semester</option> <option value="4th Semester">4th Semester</option> </select> </div> <div class="mb-3"> <label class="form-label">College Roll</label> <input type="text" name="college_roll" class="form-control" value="<?php echo $collegeroll; ?>" readonly> </div> <!-- Paper Type Section --> <div class="mb-4 p-3 border rounded-3 shadow-sm bg-light"> <h6 class="mb-3 text-primary fw-bold">Select Paper Type</h6> <div class="d-flex flex-column flex-sm-row gap-3"> <div class="form-check"> <input class="form-check-input" type="radio" name="paper_type_arrear" id="withoutPracticalArrear" value="without" required> <label class="form-check-label" for="withoutPracticalArrear"> Without Practical Paper </label> </div> <div class="form-check"> <input class="form-check-input" type="radio" name="paper_type_arrear" id="withPracticalArrear" value="with"> <label class="form-check-label" for="withPracticalArrear"> I have Practical Paper </label> </div> </div> </div> <!-- Practical Count Section --> <div class="mb-4 p-3 border rounded-3 shadow-sm bg-light" id="practicalCountSectionArrear" style="display: none;"> <label for="practicalCountArrear" class="form-label fw-semibold"> How many Practical Papers do you have? </label> <select id="practicalCountArrear" name="practical_count_arrear" class="form-select"> <option value="">Select number</option> <option value="1">1 Paper</option> <option value="2">2 Papers</option> <option value="3">3 Papers</option> <option value="4">4 Papers</option> </select> </div> <div class="mb-4 p-3 border rounded-3 shadow-sm bg-light"> <div class="form-check"> <input class="form-check-input" type="checkbox" id="aecPaper" name="aecPaper" value="Yes"> <label class="form-check-label" for="aecPaper"> AEC / MDC / SEC Arrear Paper Available (+ ₹100) </label> </div> </div> <!-- Amount Section --> <div class="mb-4 p-3 border rounded-3 shadow-sm bg-light"> <label for="amountArrear" class="form-label fw-semibold">Amount (₹)</label> <input type="text" id="amountArrear" name="amount_arrear" class="form-control text-center fw-bold fs-5 bg-white" readonly placeholder="Amount will appear here"> </div> <button type="submit" class="btn btn-warning w-100">Submit Arrear Form</button> </form> </div> <!-- Arrear Form Script --> <script> document.addEventListener('DOMContentLoaded', function () { var withoutArrear = document.getElementById('withoutPracticalArrear'); var withArrear = document.getElementById('withPracticalArrear'); var practicalCountArrearSection = document.getElementById('practicalCountSectionArrear'); var practicalCountArrear = document.getElementById('practicalCountArrear'); var amountArrear = document.getElementById('amountArrear'); var aecPaper = document.getElementById('aecPaper'); let baseAmount = 0; function updateAmount() { let total = baseAmount; if (aecPaper.checked) { total += 100; } amountArrear.value = total > 0 ? total : ''; } withoutArrear.addEventListener('change', function () { if (this.checked) { practicalCountArrearSection.style.display = 'none'; practicalCountArrear.value = ''; baseAmount = 400; updateAmount(); } }); withArrear.addEventListener('change', function () { if (this.checked) { practicalCountArrearSection.style.display = 'block'; baseAmount = 0; amountArrear.value = ''; } }); practicalCountArrear.addEventListener('change', function () { switch(parseInt(this.value)) { case 1: baseAmount = 700; break; case 2: baseAmount = 1000; break; case 3: baseAmount = 1300; break; case 4: baseAmount = 1600; break; default: baseAmount = 0; } updateAmount(); }); aecPaper.addEventListener('change', updateAmount); }); </script> <script> document.addEventListener("DOMContentLoaded", function () { let regularBtn = document.getElementById("regularBtn"); let arrearBtn = document.getElementById("arrearBtn"); let regularForm = document.getElementById("regularForm"); let arrearForm = document.getElementById("arrearForm"); // Default regularForm.style.display = "block"; arrearForm.style.display = "none"; regularBtn.addEventListener("click", function(e){ e.preventDefault(); regularForm.style.display = "block"; arrearForm.style.display = "none"; regularBtn.classList.add("btn-primary"); arrearBtn.classList.remove("btn-danger"); arrearBtn.classList.add("btn-secondary"); }); arrearBtn.addEventListener("click", function(e){ e.preventDefault(); regularForm.style.display = "none"; arrearForm.style.display = "block"; arrearBtn.classList.remove("btn-secondary"); arrearBtn.classList.add("btn-danger"); }); }); </script> <!-- Printable Challan --> <div id="printableChallan" style="display: none;"> <div class="challan-container"> <h2 class="text-center">Exam Form Challan 2025-26</h2> <p><strong>Name:</strong> <span id="challanName"></span></p> <p><strong>GU Roll No:</strong> <span id="challanGU"></span></p> <p><strong>College Roll:</strong> <span id="challanCollegeRoll"></span></p> <p><strong>Semester:</strong> <span id="challanSemester"></span></p> <p><strong>Paper Type:</strong> <span id="challanPaperType"></span></p> <p><strong>Practical Papers:</strong> <span id="challanPracticalCount"></span></p> <p><strong>Amount (₹):</strong> <span id="challanAmount"></span></p> <hr> <div class="challan-sections"> <div class="challan-copy"> <h5>Student Copy</h5> </div> <div class="challan-copy"> <h5>Office Copy</h5> </div> <div class="challan-copy"> <h5>Bank Copy</h5> </div> </div> </div> </div> </body> </html>
💾 Kaydet
İptal