<?php
session_start();
require "../config.php";

if($_SESSION['role'] != 'superadmin'){
    exit;
}

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

if($id != $_SESSION['id']){

    $conn->query("
    DELETE FROM admin
    WHERE id='$id'
    ");

}

header("Location:index.php");