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

if ($_SESSION['peran'] != 'admin') {
  exit('Akses ditolak.');
}

$id = $_GET['id'];
mysqli_query($conn, "DELETE FROM diskon WHERE id=$id");

header("Location: daftar_diskon.php");
