<?php
// Check if employee_id parameter is set
if (isset($_POST['employee_id'])) {
  // Get the employee ID from the parameter
  $employee_id = $_POST['employee_id'];
  // Create database connection
 include_once('shikanisha.kts.php');
  // Check if connection is successful
  if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
  }
  // Prepare SQL statement to delete employee record
  $sql = "DELETE FROM employees WHERE employee_id = $employee_id";
  // Execute SQL statement
  if (mysqli_query($conn, $sql)) {
    // Return success message
    echo "Employee deleted successfully.";
  } else {
    // Return error message
    echo "Error deleting employee: " . mysqli_error($conn);
  }
  // Close database connection
  mysqli_close($conn);
} else {
  // Return error message if employee_id parameter is not set
  echo "Employee ID not provided.";
}
?>
