<?php
require_once '../config/database.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $name = $_POST['product_name'];
    $price = $_POST['selling_price'];

    $stmt = $pdo->prepare("INSERT INTO products (product_name, selling_price) VALUES (?, ?)");
    $stmt->execute([$name, $price]);

    header("Location: ../modules/admin/dashboard.php?status=produk_ok");
}