<?php
    use Mtc\Core\Admin\User;
?>

<form action="" method="post">

    <div class="row">
        <select name="user_id" class="chosen" id="user_id">
            <?php $users = User::all() ?>

            <?php foreach ($users as $user): ?>
                <?php if ($user->id != 1): ?>

                    <option value="<?= $user->id; ?>" <?= (isset($thread) && $user->id == $thread_assigned_user_id) ? 'selected' : '' ?>>
                        <?= $user->name; ?>
                    </option>

                <?php endif ?>
            <?php endforeach ?>

        </select>
    </div>

    <input type="hidden" name="thread_url" value="<?= $thread_url ?>" />
    <input type="submit" name="assign_user" class="btn" value="Assign" />

</form>
