@extends('admin')
@section('contentData')
    @if (session()->has('message-fail'))
        <div class="alert alert-warning">
            {{ session('message-fail') }}
        </div>
    @endif

    <div class="container">
        <div class="row" style="width: 650px;">
            <div class="card" style="width: 600px;">
                <div class="card-header">Editace banovacího pravidla: {{$dataC->idban_automat}}</div>
                <div class="card-body">
                    <form method="POST" action="{{ route('ban-edit',$dataC->idban_automat)}}">
                        @csrf

                        <div class="form-group row">
                            <label for="id_user" class="col-md-4 col-form-label text-md-right">{{ __('Pro stanici: ') }}</label>
                            <div class="col-md-6">
                                <label for="id_stanice"></label><select id="id_stanice" name="id_stanice">
                                    @foreach(\App\Stanice::all() as $poradi => $data)
                                        @if($data->idStanice == $dataC->id_stanice)
                                            <option id="{{$data->idStanice}}" value="{{$data->idStanice}}" selected>{{$data->nazev}} ({{$data->idStanice}})</option>
                                        @else
                                            <option id="{{$data->idStanice}}" value="{{$data->idStanice}}">{{$data->nazev}} ({{$data->idStanice}})</option>
                                        @endif
                                    @endforeach
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="pocet_zprav" class="col-md-4 col-form-label text-md-right">{{ __('Počet zpráv: ') }}</label>

                            <div class="col-md-6">
                                <input id="pocet_zprav" type="text" class="form-control" name="pocet_zprav" value="{{ old('pocet_zprav') ?? $dataC->pocet_zprav }}">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="pocet_minut" class="col-md-4 col-form-label text-md-right">{{ __('Počet minut: ') }}</label>

                            <div class="col-md-6">
                                <input id="pocet_minut" type="text" class="form-control" name="pocet_minut" value="{{ old('pocet_minut') ?? $dataC->pocet_minut }}">
                            </div>
                        </div>

                        <div class="form-group row mb-0">
                            <div class="col-md-6 offset-md-4">
                                <button type="submit" class="btn btn-primary">
                                    {{ __('Uložit') }}
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
