<?php
 	session_start(); 
	if(!isset($_SESSION['atcrmsuloginsesion']))
	{
		header('Location: index.php');
		return;
	}
	if($_SESSION['atcrmsutype']!='Superuser'){
			header('Location: index.php');
		return;
	}
	if($_SERVER['REQUEST_METHOD'] === 'POST')
	{
		if(!isset($_POST['_token']) || ($_POST['_token']!==$_SESSION['_token'] ) )
		{
			header('Location: index.php');
			return;
		}
	}
	else
	{
		header('Location: index.php');
		return;
	}
	$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));
	
	include("connectp.php");
	$disposition=$_POST['disposition'];
	$brmid=1;
	$query = "INSERT INTO res_disposition_master (disposition,brmid) VALUES(:disposition,1)";
	$stmt = $db7->prepare($query);
	$stmt->bindParam(':disposition', $disposition);
	if($stmt->execute()==true)
	{
		$_SESSION['msg'] = "Record saved successfully";
	}
	else{
		$_SESSION['msg1'] = "Error!";
	}
	header('Location: disposition.php');
?>