<?php
if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
include '../../config.php';

$id = $_POST['id'];
$nama = $_POST['nama'];

$query = "INSERT INTO kategori_produk (nama) VALUES ('$nama')";
if (mysqli_query($conn, $query)) {
    $_SESSION['alert'] = ['type' => 'success', 'message' => 'Kategori berhasil diupdate.'];
} else {
    $_SESSION['alert'] = ['type' => 'danger', 'message' => 'Gagal mengupdate kategori.'];
}

header("Location: daftar_kategori.php");
exit;
