<?php session_start();
if($_SESSION){
?>

<?php





     $conn = new mysqli("localhost","root","","event");
	$id = ($_POST['id']);
	$place = ($_POST['place']);
	$type = ($_POST['type']);
	$date = ($_POST['date']);
	$eqi1 = ($_POST['eqi1']);
	$budget = ($_POST['budget']);
	$guests = ($_POST['guests']);
	$eqi2 = ($_POST['eqi2']);
	
	//$Date = test_input($_POST['Date']);
	//$joining  = test_input($_POST['joining']);


	function test_input($data) {
  $data = trim($data);
  $data = stripslashes($data);
  $data = htmlspecialchars($data);
  $data = mysql_real_escape_string($data);
  return $data;
}
	$insert = "insert into book_event (id, types, date, place, eui1, eui2, budget, guests)  
	values ('".$id."','".$type."','".$date."','".$place."','".$eqi1."','".$eqi2."','".$budget."','".$guests."')";
	$confirmation = mysqli_query($conn,$insert);
			if($confirmation){
				echo "  complete the form process";
			}
		
	else{
		echo "Kindly click on Register button to complete the form process";
	}
	


?><? ob_flush(); ?>
<?php
  }
  else{
    echo "<script>
   alert('You have to  login first...!');
   window.location.href='event2.php';
   </script>";
  }
  
?>