<?php
session_start(); 

	if(!isset($_SESSION['linkarisecrm']))
	{
		header('Location: index.php');
		return;
	}
	
	
	$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));
	
	
	include("connect.php");
include("mylibrary.php");


	$spotmid=$_POST['spotmid'];
	
		$spotname=$_POST['spotname'];
		$spotaddress=$_POST['spotaddress'];
		$cpname=$_POST['cpname'];
		$cpmobile=$_POST['cpmobile'];
		$spotcapacity=$_POST['spotcapacity'];
		$spotfacility=$_POST['spotfacility'];
		$cmpmid=$_SESSION['linkarisecmpmid'];
	

	 $eve = "update res_spot_master set spotname='$spotname',spotaddress='$spotaddress',spotcpname='$cpname',cpmobile='$cpmobile',spotcapacity='$spotcapacity',spotfacility='$spotfacility' where spotmid=$spotmid and cmpmid='$cmpmid'";	
	if ($conn->query($eve) === TRUE)
	{			
		$_SESSION['msg'] = "Record has been updated successfully";			
	}
	
	header('Location: hall.php');
?>