<?php
session_start();
require_once '../../../config.php';
load('middleware', 'user');
if ($_SESSION['user']['level'] !== "Admin") {
    header('location:' . base_url('id'));
}
$id = $_GET['id'];
if(!isset($id))
    die('No direct script access allowed!');
$query = mysqli_query($db, "SELECT * FROM users WHERE id = '$id'");
$q = mysqli_fetch_assoc($query); 
?>

<form method="POST">
<div class="row">
      <div class="col-12 mt-2">
            <blockquote class="blockquote pl-1 border-left-primary border-left-3">
                <p class="mb-0">Apakah anda yakin untuk menghapus Users ini?</p>
                <hr>
    <input type="text" class="form-control" name="iid" value="<?= $q['id'];?>" hidden>
   <div class="form-group mb-3">
        <label>Username</label>
        <input type="text" class="form-control" name="username" value="<?= $q['username']; ?>" Readonly>
    </div>
        <div class="form-group mb-3">
        <label>Email</label>
        <input type="text" class="form-control" value="<?= $q['email']; ?>" Readonly>
    </div>
    <div class="form-group mb-3">
        <label>Phone</label>
        <input type="text" class="form-control" value="<?= $q['phone']; ?>" Readonly>
    </div>
           </blockquote>    
        </div>
    </div>
        <div class="float-right">
                <button type="button" data-bs-dismiss="modal" aria-label="Close" class="btn btn-block bg-light fw-bold">BACK</button>
            <button type="submit" name="delete_user" class="btn btn-block btn-success">DELETE</button>
        </div>
        </form>
        
