GIF89a php
Current File : /home/hencockfreshchic/public_html/erp/updatePropImage.php
<?php
ob_start();
ini_set('error_reporting', E_STRICT);
include("connect.php");
include("libs.php");
mysqli_set_charset($conn,'utf8');
date_default_timezone_set('Asia/Kolkata');

$prop=$_POST['prop'];
$srr=$_POST['srr'];
	if($_FILES["image"]["name"]=="")
	{
		$sql="UPDATE `property_img` SET `prop_id`='".$prop."' WHERE `sr`='".$srr."'";
		$rs=mysqli_query($conn,$sql);
		if($rs>0)
		{
	 		echo '<script>window.location.href="propertyImg.php";</script>';
		}
		else
		{
			echo '<script>alert("Unable to save data.");</script>';
	 		echo '<script>window.location.href="propertyImg.php";</script>';
		}
	}
	else
	{
		$img=uploadImg($_FILES["image"]["name"],$_FILES["image"]["tmp_name"],"1");
		$sql="UPDATE `property_img` SET `prop_id`='".$prop."',`image`='".$img."' WHERE `sr`='".$srr."'";
		$rs=mysqli_query($conn,$sql);
		if($rs>0)
		{
	 		echo '<script>window.location.href="propertyImg.php";</script>';
		}
		else
		{
			echo '<script>alert("Unable to save data.");</script>';
	 		echo '<script>window.location.href="propertyImg.php";</script>';
		}
	}
	

?>