<?php

session_start(); 
    $u_uname = '';
    if (isset($_COOKIE['auth_token']))
    {
        $u_uname = $_COOKIE['auth_token'];
    }else{
        header("location:../login.php");
    }
    
    
    include('../include/connection.php');

    $holidayName = $_POST['holidayName'];
    $holidayDate = $_POST['holidayDate'];

    $id = $_GET['id'];

    $sql = "UPDATE `holiday` SET `holidayName`='$holidayName',`holidayDate`='$holidayDate' WHERE id=$id";

    $result = mysqli_query($link,$sql);
    
    if($result){
        header('Location:../allholidays.php?status=3');
    }
?>