]]jkjjgdjffksdkdfdkfjgsldkfhgjkgjkhjkgjkdascxvxcvxcvjdklfgjslkdfgjlskdfgjdskfgj
במ12[aspddfsdfsdfdrxcvxcvcxvxcvxcvxcvxcvxcvxcvxcvxcvxxvxcvxcvxcv;'
/
home
/
u893294702
/
domains
/
xavierschool.org.in
/
public_html
/
admin
/
nit-odisha
/
admin
/
Upload FileeE
HOME
<?php //REGISTER LOGIN BACKEND DESIGN include('security.php'); if(isset($_POST['updatebtn'])) { $id = $_POST['edit_id']; $username = $_POST['edit_username']; $email = $_POST['edit_email']; $password = $_POST['edit_password']; $query = "UPDATE register SET username='$username', email='$email', password='$password' WHERE id='$id' "; $query_run = mysqli_query($connection, $query); if($query_run) { $_SESSION['status'] = "Your Data is Updated"; $_SESSION['status_code'] = "success"; header('Location: register.php'); } else { $_SESSION['status'] = "Your Data is NOT Updated"; $_SESSION['status_code'] = "error"; header('Location: register.php'); } } if (isset($_POST['delete_btn'])) { $id = $_POST['delete_id']; $query = "DELETE FROM register WHERE id='$id' "; $query_run = mysqli_query($connection, $query); if ($query_run) { $_SESSION['status'] = "Your Data is Deleted"; $_SESSION['status_code'] = "success"; header('Location: register.php'); } else { $_SESSION['status'] = "Your Data is NOT DELETED"; $_SESSION['status_code'] = "error"; header('Location: register.php'); } } if (isset($_POST['login_btn'])) { $email_login = $_POST['emaill']; $password_login = $_POST['passwordd']; $query = "SELECT * FROM register WHERE email='$email_login' AND password='$password_login' LIMIT 1"; $query_run = mysqli_query($connection, $query); if (mysqli_fetch_array($query_run)) { $_SESSION['username'] = $email_login; header('Location: index.php'); } else { $_SESSION['status'] = "Email / Password is Invalid"; header('Location: login.php'); } } if (isset($_POST['registerbtn'])) { $username = $_POST['username']; $email = $_POST['email']; $password = $_POST['password']; $cpassword = $_POST['confirmpassword']; $email_query = "SELECT * FROM register WHERE email='$email' "; $email_query_run = mysqli_query($connection, $email_query); if (mysqli_num_rows($email_query_run) > 0) { $_SESSION['status'] = "Email Already Taken. Please Try Another one."; $_SESSION['status_code'] = "error"; header('Location: register.php'); } else { if ($password === $cpassword) { $query = "INSERT INTO register (username,email,password) VALUES ('$username','$email','$password')"; $query_run = mysqli_query($connection, $query); if ($query_run) { // echo "Saved"; $_SESSION['status'] = "Admin Profile Added"; $_SESSION['status_code'] = "success"; header('Location: register.php'); } else { $_SESSION['status'] = "Admin Profile Not Added"; $_SESSION['status_code'] = "error"; header('Location: register.php'); } } else { $_SESSION['status'] = "Password and Confirm Password Does Not Match"; $_SESSION['status_code'] = "warning"; header('Location: register.php'); } } } //NOTICE PAGE BACKEND DESIGN if (isset($_POST['notice_save'])){ $date = $_POST['date']; $ntext = $_POST['ntext']; $nurl = $_FILES["nurl"]['name']; $query = "INSERT INTO nboard (date,ntext,nurl) VALUES ('$date','$ntext','$nurl')"; $query_run = mysqli_query($connection, $query); if ($query_run) { move_uploaded_file($_FILES["nurl"]["tmp_name"], "files/" . $_FILES['nurl']['name']); $_SESSION['status'] = "Your Notice is Added"; $_SESSION['status_code'] = "success"; header('Location: nboard.php'); } else { move_uploaded_file($_FILES["nurl"]["tmp_name"], "files/" . $_FILES['nurl']['name']); $_SESSION['status'] = "Your Notice is Not Added"; $_SESSION['status_code'] = "error"; header('Location: nboard.php'); } } if (isset($_POST['n_update_btn'])) { $id = $_POST['edit_id']; $date = $_POST['edit_date']; $ntext = $_POST['edit_ntext']; $editnurl = $_FILES["nurl"]['name']; $query = "UPDATE nboard SET date='$date', ntext = '$ntext', nurl = '$editnurl' WHERE id='$id' "; $query_run = mysqli_query($connection, $query); if ($query_run) { move_uploaded_file($_FILES["nurl"]["tmp_name"], "files/" . $_FILES['nurl']['name']); $_SESSION['status'] = "Your Data is Updated"; $_SESSION['status_code'] = "success"; header('Location: nboard.php'); } else { move_uploaded_file($_FILES["nurl"]["tmp_name"], "files/" . $_FILES['nurl']['name']); $_SESSION['status'] = "Your Data is NOT Updated"; $_SESSION['status_code'] = "error"; header('Location: nboard.php'); } } if (isset($_POST['delete_btn'])) { $id = $_POST['delete_id']; $query = "DELETE FROM nboard WHERE id='$id' "; $query_run = mysqli_query($connection, $query); if ($query_run) { $_SESSION['status'] = "Your Data is Deleted"; $_SESSION['status_code'] = "success"; header('Location: nboard.php'); } else { $_SESSION['status'] = "Your Data is NOT DELETED"; $_SESSION['status_code'] = "error"; header('Location: nboard.php'); } } //FACULTY PAGE BACKEND DESIGN if (isset($_POST['fsave'])) { $fname = $_POST['fname']; $des = $_POST['des']; $qual = $_POST['qual']; $exp = $_POST['exp']; $query = "INSERT INTO `fboard` (`fname`,`des`,`qual`,`exp`) VALUES ('$fname','$des','$qual','$exp')"; $query_run = mysqli_query($connection, $query); if ($query_run) { $_SESSION['status'] = "Faculty Added"; $_SESSION['status_code'] = "success"; header('Location: fboard.php'); } else { $_SESSION['status'] = "Faculty not Added"; $_SESSION['status_code'] = "error"; header('Location: fboard.php'); } } if(isset($_POST['f_update_btn'])){ $edit_f_id = $_POST['edit_f_id']; $edit_fname = $_POST['edit_fname']; $edit_des = $_POST['edit_des']; $edit_qual = $_POST['edit_qual']; $edit_exp = $_POST['edit_exp']; $query = "UPDATE fboard SET fname='$edit_fname',des = '$edit_des',qual ='$edit_qual',exp ='$edit_exp' WHERE id='$edit_f_id'"; $query_run = mysqli_query($connection, $query); if ($query_run) { $_SESSION['status'] = "Your Data is Updated"; $_SESSION['status_code'] = "success"; header('Location: fboard.php'); } else { $_SESSION['status'] = "Your Data is not Updated"; $_SESSION['status_code'] = "error"; header('Location: fboard.php'); } } if(isset($_POST['fdelete_btn'])){ $id = $_POST['fdelete_id']; $query1 = "SELECT * FROM fboard WHERE id = '$id'"; $query_run1 = mysqli_query($connection, $query1); $row = mysqli_fetch_assoc($query_run1); unlink("imagedata/".$row['fileimg']); $query = "DELETE FROM fboard WHERE id='$id' "; $query_run = mysqli_query($connection, $query); if ($query_run) { $_SESSION['status'] = "Your Data is Deleted"; $_SESSION['status_code'] = "success"; header('Location: fboard.php'); } else { $_SESSION['status'] = "Your Data is NOT DELETED"; $_SESSION['status_code'] = "error"; header('Location: fboard.php'); } } //GALLERY BACKEND DESIGN if (isset($_POST['imgsave'])) { $nimg = $_POST['nimg']; $fileimg = $_FILES["fileimg"]['name']; $query = "INSERT INTO `gallerytab` (`nimg`,`fileimg`) VALUES ('$nimg','$fileimg')"; $query_run = mysqli_query($connection, $query); if ($query_run) { move_uploaded_file($_FILES["fileimg"]["tmp_name"], "galleryimages/" . $_FILES['fileimg']['name']); $_SESSION['status'] = "Upload success"; $_SESSION['status_code'] = "success"; header('Location: galleryedit.php'); } else { $_SESSION['status'] = "File not uploaded"; $_SESSION['status_code'] = "error"; header('Location: galleryedit.php'); } } if (isset($_POST['delete_btn_img'])) { $id = $_POST['delete_img']; $query1 = "SELECT * FROM gallerytab WHERE id = '$id'"; $query_run1 = mysqli_query($connection, $query1); $row = mysqli_fetch_assoc($query_run1); unlink("galleryimages/" . $row['fileimg']); $query = "DELETE FROM gallerytab WHERE id='$id' "; $query_run = mysqli_query($connection, $query); if ($query_run) { $_SESSION['status'] = "Your Data is Deleted"; $_SESSION['status_code'] = "success"; header('Location: galleryedit.php'); } else { $_SESSION['status'] = "Your Data is NOT DELETED"; $_SESSION['status_code'] = "error"; header('Location: galleryedit.php'); } } //CAREER CONTACT FORM BACKEND DESIGN if (isset($_POST['delete_btn_ca'])) { $id = $_POST['delete_ca_form']; $query = "DELETE FROM careercontact WHERE id='$id' "; $query_run = mysqli_query($connection, $query); if ($query_run) { $_SESSION['status'] = "Your Data is Deleted"; $_SESSION['status_code'] = "success"; header('Location: viewcareer.php'); } else { $_SESSION['status'] = "Your Data is NOT DELETED"; $_SESSION['status_code'] = "error"; header('Location: viewcareer.php'); } } // CONTACT FORM BACKEND DESIGN if (isset($_POST['delete_btn_co'])) { $id = $_POST['delete_co_form']; $query = "DELETE FROM contacttab WHERE id='$id' "; $query_run = mysqli_query($connection, $query); if ($query_run) { $_SESSION['status'] = "Your Data is Deleted"; $_SESSION['status_code'] = "success"; header('Location: viewcontact.php'); } else { $_SESSION['status'] = "Your Data is NOT DELETED"; $_SESSION['status_code'] = "error"; header('Location: viewcontact.php'); } } //ADMISSION CONTACT FORM BACKEND DESIGN if (isset($_POST['delete_btn_ad'])) { $id = $_POST['delete_ad_form']; $query = "DELETE FROM admission WHERE id='$id' "; $query_run = mysqli_query($connection, $query); if ($query_run) { $_SESSION['status'] = "Your Data is Deleted"; $_SESSION['status_code'] = "success"; header('Location: viewadmission.php'); } else { $_SESSION['status'] = "Your Data is NOT DELETED"; $_SESSION['status_code'] = "error"; header('Location: viewadmission.php'); } } //VIDEO TAB BACKEND DESIGN if (isset($_POST['vsave'])) { $vurl = $_POST['vurl']; $query = "INSERT INTO videotab(vurl) VALUES ('$vurl')"; $query_run = mysqli_query($connection, $query); if ($query_run) { $_SESSION['status'] = "Your Video is Added"; $_SESSION['status_code'] = "success"; header('Location: videoedit.php'); } else { $_SESSION['status'] = "Your Video is Not Added"; $_SESSION['status_code'] = "error"; header('Location: videoedit.php'); } } if (isset($_POST['delete_btn_video'])) { $id = $_POST['delete_video']; $query = "DELETE FROM videotab WHERE id='$id' "; $query_run = mysqli_query($connection, $query); if ($query_run) { $_SESSION['status'] = "Your Data is Deleted"; $_SESSION['status_code'] = "success"; header('Location: videoedit.php'); } else { $_SESSION['status'] = "Your Data is NOT DELETED"; $_SESSION['status_code'] = "error"; header('Location: videoedit.php'); } } ?>