<html>
<x-head />

<body class="body">
    <x-header />
    @if(Route::is('addtariff'))
    <div class="main">
        <div class="container">
            <section id="menu">
                <li>
                    <h3>Добавление тарифа</h3>
                </li>
                <li>
                    <form action="{{Route('add_tariff')}}" method="post">
                        @csrf
                        <input type="text" name="tname" placeholder="Название тарифа"><br>
                        <input type="number" name="sprice" placeholder="Цена за секунду"><br>
                        <input type="submit" class="but" value="Добавить">
                    </form>
                    @error("tname")
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror
                    @error("sprice")
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror
                </li>
            </section>
        </div>
    </div>
    @endif
    @if(Route::is('edit_tariff'))
    <div class="main">
        <div class="container">
            <section id="menu">
                <li>
                    <h3>Изменение тарифа</h3>
                </li>
                <li>
                    <form action="{{Route('edittariff', $trf->id)}}" method="post">
                        @csrf
                        <input type="text" name="tname" placeholder="Название тарифа" value="{{$trf->name}}"><br>
                        <input type="number" name="sprice" placeholder="Цена за секунду" value="{{$trf->sprice}}"><br>
                        <input type="submit" class="but" value="Изменить">
                    </form>
                    @error("tname")
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror
                    @error("sprice")
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror
                </li>
            </section>
        </div>
    </div>
    @endif
</body>

</html>