<?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 = "DELETE FROM `employee` WHERE empId=$empId";

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