[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: paystackmakepayment.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-subtle min-vh-100 py-5"> <div class="py-4"> <div class="container"> <div class="row"> <div class="col-lg-12"> <div class="text-center p-5 bg-light rounded shadow-sm"> <div class="mb-4"> <h4 class="text-uppercase text-dark font-weight-bold"> Dear <?php echo $student_name; ?>, </h4> <h5 class="text-muted mt-3"> You have been successfully placed in <span class="text-primary font-weight-semibold"><?php echo $school_name; ?></span>.<br> Please proceed to pay in order to complete your enrolment form. </h5> </div> <br /><br /> <!-- Payment Form --> <form id="paymentForm" class="text-start mx-auto" style="max-width:400px;"> <!-- <div class="mb-3"> <label for="email" class="form-label fw-bold">Email Address</label> <input type="email" id="email" name="email" class="form-control" required placeholder="Enter your email"> </div> --> <div class="mb-3"> <label for="phone" class="form-label fw-bold">Phone Number</label> <input type="tel" id="phone" name="phone" class="form-control" required placeholder="Enter your phone number"> </div> <button type="button" onclick="payWithPaystack()" class="btn btn-success btn-lg w-100 mt-3"> Click to Make Payment </button> </form> <!-- End Payment Form --> </div> </div> <!-- end col --> </div> <!-- end row --> </div> <!-- end container --> </div> </div> <!-- 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> function payWithPaystack() { // const email = document.getElementById("email").value.trim(); const phone = document.getElementById("phone").value.trim(); if (phone === "") { alert("Please enter Phone number before proceeding."); return false; } const amount = 40 * 100; // Amount in pesewas (for GHS) // Attach phone to reference const reference = 'BBCAS_' + phone + '_' + Math.floor(Math.random() * 1000000000 + 1); const handler = PaystackPop.setup({ key: 'pk_test_d559cefe97a82c09fd8aaf9d519c087f6f3955a8', // Replace with your Paystack public key email: 'afoakwastephen80@gmail.com', amount: amount, currency: 'GHS', ref: reference, callback: function(response) { // Redirect to success page with reference window.location.href = 'paymentsuccess.php?reference=' + response.reference; }, onClose: function() { alert('Transaction was not completed, window closed.'); } }); handler.openIframe(); } </script> <!-- <script> function payWithPaystack() { const email = "afoakwastephen80@gmail.com"; const amount = 45 * 100; // Amount in kobo (for NGN) or pesewas (for GHS) const handler = PaystackPop.setup({ key: 'pk_test_d559cefe97a82c09fd8aaf9d519c087f6f3955a8', // Replace with your Paystack public key email: email, amount: amount, currency: 'GHS', // Ghanaian Cedi ref: 'BBCAS_' + Math.floor(Math.random() * 1000000000 + 1), // Unique transaction reference callback: function(response) { window.location.href = 'paymentsuccess.php?reference=' + response.reference; }, onClose: function() { alert('Transaction was not completed, window closed.'); } }); handler.openIframe(); } </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