<?php

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

    $empId = $_GET['empId'];

    $sql = "UPDATE  `empHoliday` SET `salarystatus` = 'paid' WHERE empId=$empId and `salarystatus` = 'unpaid' ";

    if($link->query($sql) === TRUE){
        header("Location: ../allemployees.php?status=5"); 
    } 
    else{
        echo "Error Paying: " . $link->error;
    }
?>