GIF89a php
Current File : /home/hencockfreshchic/public_html/erp/savePropImage.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'];

$total_image=totalPropImage($conn,$prop);

if($total_image>=5)
{
	echo '<script>alert("UMaximum 5 Images allowed");</script>';
 	echo '<script>window.location.href="propertyImg.php";</script>';
}
else
{
	$img=uploadImg($_FILES["image"]["name"],$_FILES["image"]["tmp_name"],"1");
	$sql="INSERT INTO `property_img`(`prop_id`, `image`) VALUES ('".$prop."','".$img."')";
	$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>';
	}
}


?>