<?php
include 'DBConnection.php';

$id = $_POST['id'];
$user_role = $_POST['role'];



if($_POST['option'] == 'approve')
{
	$sql = "UPDATE user_access SET `status` = '1' where emp_id = $id";
	$sql1 = "UPDATE user_access SET `user_role` = '$user_role' where emp_id = $id";
	 mysqli_query($connection, $sql);
	 mysqli_query($connection, $sql1);

}else if($_POST['option'] == 'reject')
{
	$sql = "UPDATE user_access SET `status` = '0' where emp_id = $id";
	$sql1 = "UPDATE user_access SET `user_role` = 'user' where emp_id = $id";
	 mysqli_query($connection, $sql);
	 mysqli_query($connection, $sql1);
}

echo $id;
echo $user_role;

?>