<?php 
include('includes/config.php');

?>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $holiday_date = $_POST['holiday_date'];
    $description = $_POST['description'];

 

    $stmt = $conn->prepare("INSERT INTO holidays (holiday_date, description) VALUES (?, ?)");
    $stmt->bind_param("ss", $holiday_date, $description);
    $stmt->execute();

    $stmt->close();
    $conn->close();

    
    $extra="attendance.php";
	$host  = $_SERVER['HTTP_HOST'];
	$uri  = rtrim(dirname($_SERVER['PHP_SELF']),'/\\');
		$_SESSION['mess']='Holiday successfully stored';
	echo "<script type='text/javascript'> document.location = 'https://$host$uri/$extra'; </script>";
}
?>