
 <?php

	session_start();
	
 
 	include('../config/database_connection.php');
 
 
 
 	if($_REQUEST['page_id'] == 'apply')
	{
		$query = "EXEC [usp_execute_biting] " ;
		$query .= "'" .$_REQUEST['emp_id']."', ";
		$query .= "'" .$_REQUEST['id']."', ";
		$query .= "'" .$_REQUEST['left']."', ";
		$query .= "'" .$_REQUEST['right']."' ";
	}
	else
	{
		$query = "EXEC [usp_execute_answer] " ;
		$query .= "'" .$_REQUEST['emp_id']."', ";
		$query .= "'" .$_REQUEST['id']."', ";
		$query .= "'" .$_REQUEST['left']."', ";
		$query .= "'" .$_REQUEST['right']."' ";
	}
 
 echo $query;
 
	$connecttion = getSQLConection();
	
	$result = sqlsrv_query($connecttion, $query);
 
	$row = sqlsrv_fetch_array($result);
 
	closeSQLConnection($connecttion);
 
 	echo $row[0];
 
 ?>