<?php
include 'db.php';

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $category_name = $_POST['category_name'];
    $description = $_POST['description'] ?? '';

    $stmt = $conn->prepare("INSERT INTO customer_categories (category_name, description) VALUES (?, ?)");
    $stmt->bind_param("ss", $category_name, $description);
    $stmt->execute();

    header("Location: customer_category_list.php?success=1");
    exit;
}
?>
