📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
admission
Dosya Düzenle: Arrear.php
<?php session_start(); ?> <?php session_start(); 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; } /// 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'; } $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> <!-- Sidebar --> </div> <!-- Main Content --> <div class="content"> <?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 = "3rd Semester"; } elseif ($firstTwo === "23") { $sem = "5th 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">Arrear Student</span></h4> <p align="justify"></p> <div class="btn-group mt-4" role="group"> <button id="regularBtn" class="btn btn-primary me-2">Arrear Form</button> </div> <!-- Regular Form Section --> <div id="regularForm" class="form-section text-start"> <form action="submit_form.php" method="POST" class="mt-4"> <div class="mb-3"> <b>For Arrear Students only (Batch 2020,2021,2022)</b><br> <label class="form-label">Name</label> <input type="text" name="name" class="form-control" value=""> </div> <div class="mb-3"> <label class="form-label">GU ROLL No</label> <input type="text" name="gu" class="form-control" placeholder="For example: UA-201-250-0001" pattern="^(UA|US)-\d{3}-\d{3}-\d{4}$" title="Format must be UA-201-250-0001 or US-xxx-xxx-xxxx" required> </div> <div class="mb-3"> <label class="form-label">Semester</label> <select name="sem" class="form-control"> <option value="">Select Semester</option> <option value="2nd Semester">2nd Semester</option> <option value="4th Semester">4th Semester</option> <option value="6th Semester">6th 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=""> </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"> I don’t have 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> </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 (₹) With fine</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 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 = '1290'; } }); 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 = '2230'; break; case 2: amount.value = '2530'; break; case 3: amount.value = '2830'; break; case 4: amount.value = '3130'; break; default: amount.value = ''; } }); }); </script> <button type="submit" class="btn btn-success w-100">Submit Arrear Form</button> </form> </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 = '1930'; } }); 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 = '700'; break; case 2: amount.value = '1000'; break; case 3: amount.value = '1300'; break; case 4: amount.value = '1700'; break; default: amount.value = ''; } }); }); </script> <!-- 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'); withoutArrear.addEventListener('change', function () { if (this.checked) { practicalCountArrearSection.style.display = 'none'; practicalCountArrear.value = ''; amountArrear.value = '1930'; } }); withArrear.addEventListener('change', function () { if (this.checked) { practicalCountArrearSection.style.display = 'block'; amountArrear.value = ''; } }); practicalCountArrear.addEventListener('change', function () { var count = parseInt(this.value); if (isNaN(count)) { amountArrear.value = ''; return; } switch (count) { case 1: amountArrear.value = '700'; break; case 2: amountArrear.value = '1000'; break; case 3: amountArrear.value = '1300'; break; case 4: amountArrear.value = '1700'; break; default: amountArrear.value = ''; } }); }); </script> <script> const regularBtn = document.getElementById('regularBtn'); const arrearBtn = document.getElementById('arrearBtn'); const regularForm = document.getElementById('regularForm'); const arrearForm = document.getElementById('arrearForm'); regularBtn.addEventListener('click', () => { regularForm.style.display = 'block'; arrearForm.style.display = 'none'; }); arrearBtn.addEventListener('click', () => { arrearForm.style.display = 'block'; regularForm.style.display = 'none'; }); </script> <!-- Printable Challan --> </body> </html>
💾 Kaydet
İptal