@extends('base.base')
@section('base')
<div class="container-fluid">
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">编辑代理级别</h3>
                </div>
                <form action="{{ route('admin.extension_new.register_config_update', ['id' => $level->id]) }}" method="post">
                    @csrf
                    <div class="card-body">
                        <div class="form-group">
                            <label for="level_name">级别名称</label>
                            <input type="text" class="form-control" id="level_name" name="level_name" value="{{ $level->level_name }}" required>
                        </div>
                        <div class="form-group">
                            <label for="level">级别序号</label>
                            <input type="number" class="form-control" id="level" name="level" value="{{ $level->level }}" min="1" required readonly>
                            <small class="form-text text-muted">级别序号不可修改</small>
                        </div>
                        <div class="form-group">
                            <label for="required_referrals">所需有效邀请人数</label>
                            <input type="number" class="form-control" id="required_referrals" name="required_referrals" value="{{ $level->required_referrals }}" min="0" required>
                        </div>
                        <div class="form-group">
                            <label for="commission_rate">佣金比例(%)</label>
                            <input type="number" class="form-control" id="commission_rate" name="commission_rate" value="{{ $level->commission_rate }}" min="0" max="100" step="0.01" required>
                        </div>
                    </div>
                    <div class="card-footer">
                        <button type="submit" class="btn btn-primary">保存</button>
                        <a href="{{ route('admin.extension_new.register_config') }}" class="btn btn-default">返回</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection
