<x-header />

<div class="main">
    <div class="container">
        <section class="shadow" id="menu">
            <li>
                <h3 class="ap">Отправить заявку</h3>
            </li>
            <li>
                <form action="{{ route('addapply') }}" method="POST">
                    @csrf
                    <select name="category_id" id="category_id">
                        @error('category_id')
                        <div class="alert alert-danger">{{ $message }}</div>
                        @enderror
                        <option value="">Выберите категорию</option>
                        @foreach($categories as $category)
                        <option value="{{ $category->id  }}">{{ $category->name }}</option>
                        @endforeach
                    </select>
                    <div id="customcategorybox" style="display: none;">
                        <textarea name="customcategory" id="customcategory" rows="3" placeholder="Опишите необходимую услугу"></textarea>
                        @error('customcategory')
                        <div class="alert alert-danger">{{ $message }}</div>
                        @enderror
                    </div>
                    <div class="form-check">
                        <input class="form-check-input" type="checkbox" id="checkbox" name="checkbox">
                        <label class="form-check-label" for="checkbox">
                            Нужна другая услуга
                        </label>
                    </div></br>
                    <input type="text" name="name" id="name"
                        placeholder="Введите ваше имя">
                    @error('name')
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror
                    <input type="tel" placeholder="+7 (___) ___-__-__" maxlength="18" name="number" id="number">
                    @error('number')
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror

                    <input type="email" name="email" id="email" placeholder="Введите вашу почту">
                    @error('email')
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror

                    <input type="text" name="address" id="address"
                        placeholder="Введите адрес">
                    @error('address')
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror

                    <input type="date" name="date" id="date">
                    @error('date')
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror

                    <input type="time" name="time" id="time">
                    @error('time')
                    <div class="alert alert-danger">{{ $message }}</div>
                    @enderror

                    <div class="form-check">
                        <input class="form-check-input" type="radio" name="paymethod" id="payment_cash" value="Наличные">
                        <label class="form-check-label" for="payment_cash">
                            Наличные
                        </label>
                        @error('paymethod')
                        <div class="alert alert-danger">{{ $message }}</div>
                        @enderror
                    </div>
                    <div class="form-check">
                        <input class="form-check-input" type="radio" checked="checked"  name="paymethod" id="payment_card" value="Банковская карта">
                        <label class="form-check-label" for="payment_card">
                            Банковская карта
                        </label>
                        @error('paymethod')
                        <div class="alert alert-danger">{{ $message }}</div>
                        @enderror
                    </div>
                    <input type="submit" class="but" value="Отправить">
                </form>
            </li>
        </section>
    </div>
</div>



<x-footer />
<x-scripts />
</body>

</html>