<?php
include_once 'shikanisha.kts.php'; // Include your database connection file

$sql = "SELECT * FROM employees";
$result = mysqli_query($conn, $sql);

$response = array();

if (mysqli_num_rows($result) > 0) {
    while ($row = mysqli_fetch_assoc($result)) {
        $response[] = array(
            'employee_id' => $row['employee_id'],
            'name' => $row['name'],
            'phone_number' => $row['phone_number'],
            'salary_amount' => $row['salary_amount'],
            'username' => $row['username'],
            'registration_date' => $row['registration_date']
        );
    }
}

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

