<?php

include '../config/koneksi.php';
include '../session.php';

if($_SESSION['role'] != 'admin'){
    die("Akses ditolak");
}

if(isset($_GET['id'])){

    $id = (int)$_GET['id'];

    mysqli_query($conn,"
        DELETE FROM users
        WHERE id_user='$id'
    ");
}

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