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

if(!isset($_SESSION['login']) || $_SESSION['role'] != 'superadmin'){
    header("Location: ../login.php");
    exit;
}

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

$d = $conn->query("
SELECT * FROM admin
WHERE id='$id'
")->fetch_assoc();

if(!$d){
    die("Data tidak ditemukan");
}

if(isset($_POST['update'])){

    $nama  = $conn->real_escape_string($_POST['nama']);
    $email = $conn->real_escape_string($_POST['email']);
    $role  = $_POST['role'];

    $conn->query("
    UPDATE admin
    SET
    nama='$nama',
    email='$email',
    role='$role'
    WHERE id='$id'
    ");

    header("Location: index.php");
    exit;
}
?>

<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Edit User</title>

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">

<style>

body{
    margin:0;
    background:#f4f6f9;
    font-family:'Segoe UI',sans-serif;
}

.sidebar{
    position:fixed;
    left:0;
    top:0;
    width:260px;
    height:100vh;
    background:#0d6efd;
    color:white;
}

.sidebar .logo{
    text-align:center;
    padding:25px;
    border-bottom:1px solid rgba(255,255,255,.15);
}

.sidebar .logo img{
    width:90px;
    margin-bottom:10px;
}

.menu{
    display:block;
    color:white;
    text-decoration:none;
    padding:15px 25px;
}

.menu:hover,
.menu.active{
    background:rgba(255,255,255,.15);
    color:white;
}

.content{
    margin-left:260px;
    padding:30px;
}

.form-card{
    max-width:700px;
    background:white;
    border:none;
    border-radius:20px;
    box-shadow:0 5px 20px rgba(0,0,0,.08);
}

.form-control,
.form-select{
    height:50px;
    border-radius:12px;
}

.input-group-text{
    border-radius:12px 0 0 12px;
}

.btn{
    border-radius:10px;
}

</style>
</head>
<body>

<div class="sidebar">

    <div class="logo">
        <img src="../assets/bws1.png" width="90">
        <h5>SIPTSA</h5>
        <small>Balai Wilayah Sungai Kalimantan IV</small>
    </div>

    <a href="index.php" class="menu active">
        <i class="fas fa-users"></i>
        Manajemen User
    </a>

    <a href="logout.php" class="menu">
        <i class="fas fa-sign-out-alt"></i>
        Logout
    </a>

</div>

<div class="content">

    <h3 class="mb-4">
        <i class="fas fa-user-edit text-warning"></i>
        Edit Akun Administrator
    </h3>

    <div class="card form-card">

        <div class="card-body p-4">

            <form method="POST">

                <label class="mb-2">Nama</label>

                <div class="input-group mb-3">
                    <span class="input-group-text">
                        <i class="fas fa-user"></i>
                    </span>

                    <input
                        type="text"
                        name="nama"
                        class="form-control"
                        value="<?= htmlspecialchars($d['nama']) ?>"
                        required>
                </div>

                <label class="mb-2">Email</label>

                <div class="input-group mb-3">
                    <span class="input-group-text">
                        <i class="fas fa-envelope"></i>
                    </span>

                    <input
                        type="email"
                        name="email"
                        class="form-control"
                        value="<?= htmlspecialchars($d['email']) ?>"
                        required>
                </div>

                <label class="mb-2">Role</label>

                <select name="role" class="form-select mb-4">

                    <option value="admin1" <?= $d['role']=='admin1'?'selected':'' ?>>
                        Admin 1
                    </option>

                    <option value="admin2" <?= $d['role']=='admin2'?'selected':'' ?>>
                        Admin 2
                    </option>

                    <option value="admin3" <?= $d['role']=='admin3'?'selected':'' ?>>
                        Admin 3
                    </option>

                    <option value="superadmin" <?= $d['role']=='superadmin'?'selected':'' ?>>
                        Super Admin
                    </option>

                </select>

                <button
                    type="submit"
                    name="update"
                    class="btn btn-warning">

                    <i class="fas fa-save"></i>
                    Update
                </button>

                <a
                    href="index.php"
                    class="btn btn-secondary">

                    <i class="fas fa-arrow-left"></i>
                    Kembali
                </a>

            </form>

        </div>

    </div>

</div>

</body>
</html>
```
