관리-도구
편집 파일: form.php
<?php include('include/connection.php'); if (isset($_POST['newsletter'])) { $email = $_POST['email']; $sql = "INSERT INTO `newsletter`(`email`) VALUES ('$email')"; $res = mysqli_query($con, $sql); echo "<script> alert('Thank you for applying. Application Submitted. We will reach back to you soon.'); window.location.href='" . $_SERVER["HTTP_REFERER"] . "'; </script>"; } if (isset($_POST['enquiry'])) { // Retrieve form data $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $subject = $_POST['subject']; $message = $_POST['message']; // Insert into the database $sql = "INSERT INTO `query`(`name`, `email`, `phone`, `subject`, `message`) VALUES ('$name','$email','$phone','$subject','$message')"; $res = mysqli_query($con, $sql); if ($res) { echo "<script> alert('Thank you for applying. Application Submitted. We will reach back to you soon.'); window.location.href='" . $_SERVER["HTTP_REFERER"] . "'; </script>"; } } if (isset($_POST['popup_query'])) { // Retrieve form data $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; // Insert into the database $sql = "INSERT INTO `popup_query`(`name`, `email`, `phone`) VALUES ('$name','$email','$phone')"; $res = mysqli_query($con, $sql); if ($res) { echo "<script> alert('Thank you for applying. Application Submitted. We will reach back to you soon.'); window.location.href='" . $_SERVER["HTTP_REFERER"] . "'; </script>"; } } if (isset($_POST['reservation'])) { // Retrieve form data $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $subject = $_POST['subject']; $date = $_POST['date']; $message = $_POST['message']; // Insert into the database $sql = "INSERT INTO `reservation`(`name`, `email`, `phone`, `subject`, `date`, `message`) VALUES ('$name','$email','$phone','$subject','$date','$message')"; $res = mysqli_query($con, $sql); if ($res) { echo "<script> alert('Thank you for applying. Application Submitted. We will reach back to you soon.'); window.location.href='" . $_SERVER["HTTP_REFERER"] . "'; </script>"; } } if (isset($_POST['admission'])) { $f_name = mysqli_real_escape_string($con, $_POST['f_name']); $m_name = mysqli_real_escape_string($con, $_POST['m_name']); $l_name = mysqli_real_escape_string($con, $_POST['l_name']); $dob = mysqli_real_escape_string($con, $_POST['dob']); $gender = mysqli_real_escape_string($con, $_POST['gender']); $blood_group = mysqli_real_escape_string($con, $_POST['blood_group']); $father_name = mysqli_real_escape_string($con, $_POST['father_name']); $father_qualification = mysqli_real_escape_string($con, $_POST['father_qualification']); $father_occupation = mysqli_real_escape_string($con, $_POST['father_occupation']); $residential_address = mysqli_real_escape_string($con, $_POST['residential_address']); $mother_name = mysqli_real_escape_string($con, $_POST['mother_name']); $mother_qualification = mysqli_real_escape_string($con, $_POST['mother_qualification']); $mother_occupation = mysqli_real_escape_string($con, $_POST['mother_occupation']); $family_income = mysqli_real_escape_string($con, $_POST['family_income']); $phone = mysqli_real_escape_string($con, $_POST['phone']); $phone2 = mysqli_real_escape_string($con, $_POST['phone2']); $email = mysqli_real_escape_string($con, $_POST['email']); $permanent_address = mysqli_real_escape_string($con, $_POST['permanent_address']); $nationality = mysqli_real_escape_string($con, $_POST['nationality']); $mother_toungue = mysqli_real_escape_string($con, $_POST['mother_toungue']); $religion = mysqli_real_escape_string($con, $_POST['religion']); $caste = mysqli_real_escape_string($con, $_POST['caste']); $adhar_no = mysqli_real_escape_string($con, $_POST['adhar_no']); $class = mysqli_real_escape_string($con, $_POST['class']); $medium = mysqli_real_escape_string($con, $_POST['medium']); $last_school = mysqli_real_escape_string($con, $_POST['last_school']); $pre_avg_grade = mysqli_real_escape_string($con, $_POST['pre_avg_grade']); $added_on = date('Y-m-d'); if (isset($_GET['id']) && $_GET['id'] == 0) { if ($_FILES['image']['type'] != 'image/png' && $_FILES['image']['type'] != 'image/jpg' && $_FILES['image']['type'] != 'image/jpeg' && $_FILES['image']['type'] != 'image/webp') { $msg = "Please select only png, jpg, webp and jpeg image format"; } } else { if ($_FILES['image']['type'] != '') { if ($_FILES['image']['type'] != 'image/png' && $_FILES['image']['type'] != 'image/jpg' && $_FILES['image']['type'] != 'image/jpeg' && $_FILES['image']['type'] != 'image/jpeg') { $msg = "Please select only png, jpg, webp and jpeg image format"; } } } $msg = ""; if ($msg == '') { $image = rand(111111111, 999999999) . '_' . $_FILES['image']['name']; move_uploaded_file($_FILES['image']['tmp_name'], "media/admision/" . $image); $sql = "INSERT INTO `admision`(`f_name`, `m_name`, `l_name`, `dob`, `gender`, `blood_group`, `father_name`, `father_qualification`, `father_occupation`, `residential_address`, `mother_name`, `mother_qualification`, `mother_occupation`, `family_income`, `phone`, `phone2`, `email`, `permanent_address`, `nationality`, `mother_toungue`, `religion`, `caste`, `adhar_no`, `image`, `class`, `medium`, `last_school`, `pre_avg_grade`, `added_on`) VALUES ('$f_name','$m_name','$l_name','$dob','$gender','$blood_group','$father_name','$father_qualification','$father_occupation','$residential_address','$mother_name','$mother_qualification','$mother_occupation','$family_income','$phone','$phone2','$email','$permanent_address','$nationality','$mother_toungue','$religion','$caste','$adhar_no','$image','$class','$medium','$last_school','$pre_avg_grade','$added_on')"; $res = mysqli_query($con, $sql); echo "<script> alert('Thank you for submitting your query, Our management will contact you soon'); window.location.href='" . $_SERVER["HTTP_REFERER"] . "'; </script>"; } } if (isset($_POST['career'])) { $position_applied = mysqli_real_escape_string($con, $_POST['position_applied']); $interested_subject = mysqli_real_escape_string($con, $_POST['interested_subject']); $teaching_upto = mysqli_real_escape_string($con, $_POST['teaching_upto']); $f_name = mysqli_real_escape_string($con, $_POST['f_name']); $l_name = mysqli_real_escape_string($con, $_POST['l_name']); $residential_address = mysqli_real_escape_string($con, $_POST['residential_address']); $permanent_address = mysqli_real_escape_string($con, $_POST['permanent_address']); $father_husband_name = mysqli_real_escape_string($con, $_POST['father_husband_name']); $family_income = mysqli_real_escape_string($con, $_POST['family_income']); $gender = mysqli_real_escape_string($con, $_POST['gender']); $dob = mysqli_real_escape_string($con, $_POST['dob']); $medium = mysqli_real_escape_string($con, $_POST['medium']); $blood_group = mysqli_real_escape_string($con, $_POST['blood_group']); $nationality = mysqli_real_escape_string($con, $_POST['nationality']); $mother_toungue = mysqli_real_escape_string($con, $_POST['mother_toungue']); $religion = mysqli_real_escape_string($con, $_POST['religion']); $caste = mysqli_real_escape_string($con, $_POST['caste']); $phone = mysqli_real_escape_string($con, $_POST['phone']); $phone2 = mysqli_real_escape_string($con, $_POST['phone2']); $adhar_no = mysqli_real_escape_string($con, $_POST['adhar_no']); $email = mysqli_real_escape_string($con, $_POST['email']); $pre_school_name = mysqli_real_escape_string($con, $_POST['pre_school_name']); $pre_address = mysqli_real_escape_string($con, $_POST['pre_address']); $teach_exp = mysqli_real_escape_string($con, $_POST['teach_exp']); $teachi_interested_subject = mysqli_real_escape_string($con, $_POST['teachi_interested_subject']); $language_known = mysqli_real_escape_string($con, $_POST['language_known']); $teaching_medium = mysqli_real_escape_string($con, $_POST['teaching_medium']); $previous_profession = mysqli_real_escape_string($con, $_POST['previous_profession']); $qualification = mysqli_real_escape_string($con, $_POST['qualification']); $added_on = date('Y-m-d'); if (isset($_GET['id']) && $_GET['id'] == 0) { if ($_FILES['image']['type'] != 'image/png' && $_FILES['image']['type'] != 'image/jpg' && $_FILES['image']['type'] != 'image/jpeg' && $_FILES['image']['type'] != 'image/webp') { $msg = "Please select only png, jpg, webp and jpeg image format"; } } else { if ($_FILES['image']['type'] != '') { if ($_FILES['image']['type'] != 'image/png' && $_FILES['image']['type'] != 'image/jpg' && $_FILES['image']['type'] != 'image/jpeg' && $_FILES['image']['type'] != 'image/jpeg') { $msg = "Please select only png, jpg, webp and jpeg image format"; } } } $msg = ""; if ($msg == '') { $image = rand(111111111, 999999999) . '_' . $_FILES['image']['name']; move_uploaded_file($_FILES['image']['tmp_name'], "media/career/" . $image); $sql = "INSERT INTO `career`(`position_applied`, `interested_subject`, `teaching_upto`, `f_name`, `l_name`, `residential_address`, `permanent_address`, `father_husband_name`, `family_income`, `gender`, `dob`, `medium`, `blood_group`, `nationality`, `mother_toungue`, `religion`, `caste`, `phone`, `phone2`, `adhar_no`, `email`, `pre_school_name`, `pre_address`, `image`, `teach_exp`, `teachi_interested_subject`, `language_known`, `teaching_medium`,`previous_profession`, `qualification`, `added_on`) VALUES ('$position_applied','$interested_subject','$teaching_upto','$f_name','$l_name','$residential_address','$permanent_address','$father_husband_name','$family_income','$gender','$dob','$medium','$blood_group','$nationality','$mother_toungue','$religion','$caste','$phone','$phone2','$adhar_no','$email','$pre_school_name','$pre_address','$image','$teach_exp','$teachi_interested_subject','$language_known','$teaching_medium','$previous_profession','$qualification','$added_on')"; $res = mysqli_query($con, $sql); echo "<script> alert('Thank you for submitting your query, Our management will contact you soon'); window.location.href='" . $_SERVER["HTTP_REFERER"] . "'; </script>"; } }