<div class="row">
  <div class="col-md-6">
    <div class="card">
      <div class="card-header"><h4><?= e(app_zh('编辑用户')) ?></h4></div>
      <div class="card-body">
        <form method="post" action="<?= e_url(base_url('admin/users/edit/' . $target['id'])) ?>">
          <?= csrf_field() ?>
          <div class="form-group">
            <label><?= e(app_zh('账号')) ?></label>
            <input class="form-control" name="username" value="<?= e((string)$target['username']) ?>">
          </div>
          <div class="form-group">
            <label><?= e(app_zh('姓名')) ?></label>
            <input class="form-control" name="full_name" value="<?= e((string)($target['full_name'] ?? '')) ?>">
          </div>
          <div class="form-group">
            <label><?= e(app_zh('角色')) ?></label>
            <select class="form-control" name="role">
              <option value="admin" <?= ($target['role'] ?? '') === 'admin' ? 'selected' : '' ?>><?= e(app_zh('管理员')) ?></option>
              <option value="reseller" <?= ($target['role'] ?? '') === 'reseller' ? 'selected' : '' ?>><?= e(app_zh('代理')) ?></option>
            </select>
          </div>
          <div class="form-group">
            <label><?= e(app_zh('状态')) ?></label>
            <select class="form-control" name="status">
              <option value="active" <?= ($target['status'] ?? '') === 'active' ? 'selected' : '' ?>><?= e(app_zh('正常')) ?></option>
              <option value="disabled" <?= ($target['status'] ?? '') === 'disabled' ? 'selected' : '' ?>><?= e(app_zh('禁用')) ?></option>
            </select>
          </div>
          <div class="form-group">
            <label><?= e(app_zh('余额')) ?></label>
            <input class="form-control" name="balance" value="<?= e((string)$target['balance']) ?>">
          </div>
          <button class="btn btn-primary" type="submit"><?= e(app_zh('保存')) ?></button>
        </form>
      </div>
    </div>
  </div>
</div>
