<?php
include "connect.php"; // تأكد من اسم ملف الاتصال عندك

$specialty_id = $_POST['specialty_id'];
$name_ar      = $_POST['name_ar'];
$name_en      = $_POST['name_en'];

$stmt = $con->prepare("INSERT INTO `sub_specialties` (`specialty_id`, `name_ar`, `name_en`) VALUES (?, ?, ?)");
$stmt->execute([$specialty_id, $name_ar, $name_en]);

if ($stmt->rowCount() > 0) {
    echo json_encode(array("status" => "success"));
} else {
    echo json_encode(array("status" => "fail"));
}
?>