<?php
session_start();
include 'koneksi.php';

$id_user = $_SESSION['id_user'] ?? 1;
$id_lelang = $_GET['id_lelang'] ?? 0;

if (!$id_lelang) {
    header('Location: data_lelang.php');
    exit;
}

// Hapus data lelang
$delete_query = mysqli_query($conn, "DELETE FROM lelang WHERE id_lelang = $id_lelang");

if ($delete_query) {
    header('Location: data_lelang.php?deleted=1');
} else {
    header('Location: data_lelang.php?error=1');
}
exit;
?>

