<?php
include '../auth.php';
include '../../koneksi.php';

$user_id = $_SESSION['user_id']; 

if ($_SERVER["REQUEST_METHOD"] == "POST") {
  $id = $_POST['id'];
  $namakeunggulan = $_POST['namakeunggulan'];
  $ulasan = $_POST['ulasan'];

  $query = "UPDATE detail_keunggulan SET deskripsi_keunggulan = '$namakeunggulan' WHERE id_detailkeunggulan = '$id'";

  if (mysqli_query($conn, $query)) {
    $_SESSION['success'] = "Data  keunggulan berhasil diperbarui!";
    header("Location: ../keunggulan");
  } else {
    $_SESSION['error'] = "Gagal memperbarui  keunggulan!";
    header("Location: ../keunggulan");
    exit();
  }
}
?>