[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: makepayment.php
<?php // ini_set('display_errors', 1); // ini_set('display_startup_errors', 1); // error_reporting(E_ALL); include("functions.php"); if (!isset($_SESSION['index_no78897498'])) { header("Location: index"); exit(); } else { $index = $_SESSION['index_no78897498']; // Fetch school details $indexx = mysqli_query($new, "SELECT * FROM enrol_generic WHERE indexNo = '$index'"); $fetchsch = mysqli_fetch_array($indexx); $school_code = $fetchsch['s_code']; $student_name = $fetchsch['stud_name']; // Fetch school logo $getlogo = mysqli_query($new, "SELECT * FROM schools WHERE school_code = '$school_code'"); $logocon = mysqli_fetch_array($getlogo); $logoo = $logocon['logo']; $school_name = $logocon['school_name']; $school_name = $logocon['school_name']; // Check payment using prepared statement $stmt = mysqli_prepare($new, "SELECT COUNT(*) AS c FROM stud_payment WHERE s_code = ? AND indexNumber = ? LIMIT 1"); mysqli_stmt_bind_param($stmt, "ss", $school_code, $index); // ✅ Must execute before fetching mysqli_stmt_execute($stmt); // Bind result mysqli_stmt_bind_result($stmt, $count); mysqli_stmt_fetch($stmt); mysqli_stmt_close($stmt); if ($count > 0) { header("Location: dashboard"); exit(); } } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Makepayment | Online Admission Portal</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta content="elisof" name="author" /> <!-- App favicon --> <!-- preloader css --> <link rel="stylesheet" href="assets/css/preloader.min.css" type="text/css" /> <script src="https://js.paystack.co/v1/inline.js"></script> <!-- Bootstrap Css --> <link href="assets/css/bootstrap.min.css" id="bootstrap-style" rel="stylesheet" type="text/css" /> <!-- Icons Css --> <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" /> <!-- App Css--> <link href="assets/css/app.min.css" id="app-style" rel="stylesheet" type="text/css" /> </head> <body> <!-- <body data-layout="horizontal"> --> <div class="bg-light min-vh-100 d-flex align-items-center py-5"> <div class="container"> <div class="row justify-content-center"> <div class="col-lg-8"> <div class="card shadow-lg border-0 rounded-4 p-4 p-md-5"> <div class="text-center mb-4"> <h4 class="text-uppercase fw-bold text-dark mb-3"> Dear <?php echo $student_name; ?>, </h4> <h5 class="text-secondary fw-semibold"> You have been successfully placed in <span class="text-primary"><?php echo $school_name; ?></span>. </h5> <p class="mt-3 text-muted"> Please proceed to pay in order to complete your enrolment form. </p> </div> <!-- Payment Form --> <form id="paymentForm" class="needs-validation" novalidate> <div class="row g-3 mb-3"> <div class="col-md-6"> <label class="form-label fw-semibold">Amount (45 GHS)</label> <input type="number" name="amount" class="form-control form-control-lg shadow-sm" readonly value="45"> <div class="invalid-feedback">Please enter the amount.</div> </div> <div class="col-md-6"> <label class="form-label fw-semibold">Payment Method</label> <select name="payment_method" class="form-select form-select-lg shadow-sm" required> <option value="">-- Select Method --</option> <option value="MOMO">Mobile Money</option> <option value="CARD">Card</option> </select> <div class="invalid-feedback">Please choose a payment method.</div> </div> </div> <div class="text-center mt-4"> <button type="submit" class="btn btn-primary btn-lg px-5 shadow-sm" id="submitBtn"> 💳 Pay Now </button> </div> </form> <!-- End Payment Form --> </div> </div> </div> </div> </div> <!-- Optional: Custom styles --> <style> body { background: linear-gradient(to bottom right, #eef6f8, #ffffff); } .card { background: #fff; transition: transform 0.3s ease, box-shadow 0.3s ease; } .card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); } .btn-primary { border-radius: 12px; font-weight: 600; font-size: 1.1rem; transition: transform 0.2s ease, box-shadow 0.2s ease; } .btn-primary:hover { transform: scale(1.03); box-shadow: 0 6px 18px rgba(0, 123, 255, 0.3); } </style> <!-- Optional: Bootstrap 5 validation JS --> <!-- <script> (() => { 'use strict' const forms = document.querySelectorAll('.needs-validation') Array.from(forms).forEach(form => { form.addEventListener('submit', event => { if (!form.checkValidity()) { event.preventDefault() event.stopPropagation() } form.classList.add('was-validated') }, false) }) })() </script> --> <!-- end --> <!-- JAVASCRIPT --> <script src="assets/libs/jquery/jquery.min.js"></script> <script src="assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="assets/libs/metismenu/metisMenu.min.js"></script> <script src="assets/libs/simplebar/simplebar.min.js"></script> <script src="assets/libs/node-waves/waves.min.js"></script> <script src="assets/libs/feather-icons/feather.min.js"></script> <!-- pace js --> <script src="assets/libs/pace-js/pace.min.js"></script> <script> document.getElementById('paymentForm').addEventListener('submit', async function(e) { e.preventDefault(); // stop normal form submission // ✅ Check HTML5 form validity if (!this.checkValidity()) { this.classList.add('was-validated'); // show validation styles return; // stop script if form invalid } let formData = new FormData(this); let submitBtn = document.getElementById('submitBtn'); submitBtn.disabled = true; submitBtn.innerText = "Please wait, the form is rocessing..."; try { let response = await fetch("init-payment.php", { method: "POST", body: formData }); let result = await response.json(); if (!result.error && result.redirect) { window.location.href = result.redirect; // ✅ instant redirect } else { alert("Error: " + result.message); submitBtn.disabled = false; submitBtn.innerText = "Pay Now"; } } catch (error) { alert("Network error: " + error); submitBtn.disabled = false; submitBtn.innerText = "Pay Now"; } }); </script> </body> </html>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.81 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002