<?php
include_once 'shikanisha.kts.php';

// Get the salary ID from the AJAX request
$salaryId = $_POST['salaryId'];

// Delete the record from the database
$sql = "DELETE FROM employee_salary WHERE salary_id = $salaryId";

if ($conn->query($sql) === TRUE) {
    // If the query was successful, return success
    $response['success'] = true;
    $response['message'] = 'Record deleted successfully';
} else {
    // If there was an error, return the error message
    $response['success'] = false;
    $response['message'] = 'Error deleting record: ' . $conn->error;
}

// Return the response as JSON
header('Content-Type: application/json');
echo json_encode($response);
?>