<?PHP
	include './conn.php';

	$staff_id = $_POST['staff_id'];
	$status = $_POST['approve_recall'];
	$no_of_days = $_POST['no_of_days'];
	$leave_type = $_POST['leave_type'];
	$leave_applied = $_POST['date_applied_on'];
	$start_date = $_POST['start_date'];
	$end_date = $_POST['end_date'];
	
	$sql = "SELECT * FROM staff WHERE staff_id = '".$staff_id."'";
    $sql1 = "UPDATE lms.leave_requests SET leave_status = '".$status."' WHERE staff_id = '".$staff_id."'";	
	$result = mysqli_query($conn, $sql);
	mysqli_query($conn,$sql1);

	while($row1 = mysqli_fetch_array($result))
	{
		$first_name = $row1['first_name'];
		$middle_name = $row1['middle_name'];
		$last_name = $row1['last_name'];
		$branch = $row1['branch'];

	}

    echo "<script>alert(\"Leave ".$status." for ".$first_name." ".$last_name."  Staff ID ".$staff_id." from ".$branch."\"); window.location=\"search_staff_for_recall.php\";</script>";

?>
