@extends ('layouts/template')
@section('content')

    <div class="p-3 mcp-theme-1">
        <div class="card">
            <div class="card-header">
                <div class="d-flex align-items-center justify-content-between">
                    <div class="d-flex align-items-center">
                        <div class="mr-3">
                            <span>Name:</span>
                            <span class="font-weight-bold">{{ $statTree->name }}</span>
                        </div>
                        <div class="mr-3">
                            <span>Model:</span>
                            <span class="font-weight-bold">{{ $statTree->model }}</span>
                        </div>
                        <div class="mr-3">
                            <span>Slug:</span>
                            <span class="font-weight-bold">{{ $statTree->slug }}</span>
                        </div>
                        <div moe relative wide class="ml-auto">
                            <a href="#" start show class="btn btn-sm btn-primary text-white">Edit</a>
                            <form url="{{ route("practice-management.api.statTree.updateBasic") }}">
                                @csrf
                                <input type="hidden" name="uid" value="{{$statTree->uid}}">
                                <div class="mb-2">
                                    <label class="text-secondary text-sm mb-1">Name *</label>
                                    <input type="text" class="form-control form-control-sm" name="name" value="{{$statTree->name}}" autofocus required>
                                </div>
                                <div class="mb-2">
                                    <label class="text-secondary text-sm mb-1">Model *</label>
                                    <input type="text" class="form-control form-control-sm" data-option-list="model-options" autocomplete="off" name="model" value="{{$statTree->model}}" required>
                                    <div id="model-options" class="data-option-list">
                                        <?php $models = \Illuminate\Support\Facades\DB::select('SELECT distinct(model) as m FROM clause order by model'); ?>
                                        @foreach($models as $m)
                                            <div>{!! $m->m !!}</div>
                                        @endforeach
                                    </div>
                                </div>
                                <div class="mb-2">
                                    <label class="text-secondary text-sm mb-1">Slug *</label>
                                    <input type="text" class="form-control form-control-sm" name="slug" value="{{$statTree->slug}}" required>
                                </div>
                                <div class="d-flex align-items-center">
                                    <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
                                    <button class="btn btn-sm btn-default mr-2 border" type="button" cancel>Cancel</button>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div>
                        <a href="{{route('practice-management.statTrees.list')}}" class="btn btn-sm btn-primary text-white"><i class="fas fa-network-wired"></i> View All Stat Trees</a>
                    </div>
                </div>
            </div>
            <div class="card-body">
                @yield('page')
            </div>
        </div>
    </div>

@endsection