<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
include_once 'db_connect.php';

if (isset($_POST['id'])) {
    try {
        $stmt = $conn->prepare("DELETE FROM doctors WHERE id = ?");
        $stmt->execute([$_POST['id']]);
        echo json_encode(["status" => "success"]);
    } catch (PDOException $e) {
        echo json_encode(["status" => "error", "message" => $e->getMessage()]);
    }
}
?>