<html>

<x-head />

<body>

    <x-header />

    <!-- Bradcam area -->
    <div class="bradcam_area bradcam_bg_1">
        <div class="container">
            <div class="row">
                <div class="col-xl-12">
                    <div class="bradcam_text">
                        <h3>Панель администратора</h3>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Job listing area -->
    <div class="job_listing_area plus_padding">
        <div class="container">
            <div class="row">
                <div class="col-lg-3">
                    <div class="job_filter white-bg">
                        <h3>Добавить город</h3>
                        <form action="{{Route('addcity')}}" method="post">
                            @csrf
                            <div class="form-group">
                                <input type="text" id="cityname" name="cityname" placeholder="Город" class="form-control">
                                @error("cityname")
                                <div class="alert alert-danger">Поле города не может быть пустым!</div>
                                @enderror
                            </div>
                            <button class="boxed-btn3 w-100" type="submit">Добавить</button>
                        </form>

                        <h3>Добавить категорию</h3>
                        <form action="{{Route('addcategory')}}" method="post">
                            @csrf
                            <div class="form-group">
                                <input type="text" id="categoryname" name="categoryname" placeholder="Категория" class="form-control">
                                @error("categoryname")
                                <div class="alert alert-danger">Поле категории не может быть пустым!</div>
                                @enderror
                            </div>
                            <button class="boxed-btn3 w-100" type="submit">Добавить</button>
                        </form>
                    </div>
                </div>

                <div class="col-lg-6">
                    <div class="job_lists m-0">
                        <h4>Список городов</h4>
                        @foreach($cities as $city)
                        <div class="single_jobs white-bg d-flex justify-content-between">
                            <div class="jobs_left d-flex align-items-center">
                                <div class="jobs_conetent">
                                    <h5>{{ $city->name }}</h5>
                                </div>
                            </div>
                            <a href="{{Route('edit_city', $city->id)}}" class="boxed-btn3">Изменить</a>
                        </div>
                        @endforeach
                        <div class="pagination_wrap">
                            {{$cities->links('vendor.pagination.simple-default')}}
                        </div>
                    </div>

                    <div class="job_lists m-0">
                        <h4>Список категорий</h4>
                        @foreach($categories as $category)
                        <div class="single_jobs white-bg d-flex justify-content-between">
                            <div class="jobs_left d-flex align-items-center">
                                <div class="jobs_conetent">
                                    <h5>{{ $category->name }}</h5>
                                </div>
                            </div>
                            <a href="{{Route('edit_category', $category->id)}}" class="boxed-btn3">Изменить</a>
                        </div>
                        @endforeach
                        <div class="pagination_wrap">
                            {{$categories->links('vendor.pagination.simple-default')}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- footer start -->
    <x-footer />

    <x-scripts />

</body>

</html>