<?php
$title = 'Edit Role';

ob_start();
?>

<div class="container py-5">

    <div class="card border-0 shadow-lg rounded-4">

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

            <h2 class="fw-bold mb-4">

                <i class="fa fa-user-shield"></i>
                Edit Role

            </h2>

            <form
                method="post"
                action="/easychair/admin/roles/update">

                <input
                    type="hidden"
                    name="id"
                    value="<?= (int)$role['id'] ?>">

                <div class="mb-4">

                    <label class="form-label fw-bold">
                        Role Name
                    </label>

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

                </div>

                <div class="mb-4">

                    <label class="form-label fw-bold">
                        Role Code
                    </label>

                    <input
                        type="text"
                        name="code"
                        class="form-control"
                        value="<?= htmlspecialchars(
                            $role['code'] ?? ''
                        ) ?>"
                        required>

                </div>

                <button
                    class="btn btn-primary rounded-pill px-5">

                    <i class="fa fa-save"></i>
                    Update Role

                </button>

            </form>

        </div>

    </div>

</div>

<?php
$content = ob_get_clean();

require BASE_PATH .
    '/app/views/layouts/admin_layout.php';
?>
