Manage Treatment Categories
You have not added any treatment categories yet.
exec("CREATE TABLE IF NOT EXISTS `treatment_categories` ( `id` INT AUTO_INCREMENT PRIMARY KEY, `hospital_id` INT NOT NULL, `name` VARCHAR(255) NOT NULL, `description` TEXT, FOREIGN KEY (`hospital_id`) REFERENCES `hospitals`(`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"); // Handle form submission if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['category_name'])) { $categoryName = trim($_POST['category_name']); $description = trim($_POST['description']); if (!empty($categoryName)) { $stmt = $pdo->prepare("INSERT INTO treatment_categories (hospital_id, name, description) VALUES (:hospital_id, :name, :description)"); $stmt->bindParam(':hospital_id', $hospitalId, PDO::PARAM_INT); $stmt->bindParam(':name', $categoryName, PDO::PARAM_STR); $stmt->bindParam(':description', $description, PDO::PARAM_STR); if ($stmt->execute()) { $message = '
You have not added any treatment categories yet.