<?php session_start();
if(empty($_SESSION['id'])):
header('Location:../index.php');
endif;

include('../dist/includes/dbcon.php');
	$id = $_POST['id'];
	$name =$_POST['prod_name'];
	$price1 = $_POST['prod_price1'];
	$price2 = $_POST['prod_price2'];
	$price3 = $_POST['prod_price3'];
	
			
	mysqli_query($con,"update roof set product='$name',reg='$price1',free='$price2',special='$price3' where id='$id'")or die(mysqli_error($con));
	
	echo "<script type='text/javascript'>alert('Successfully updated product details!');</script>";
	echo "<script>document.location='productroof.php'</script>";  

	
?>
