@extends('dashboard.layouts.app')
@section('title', trans('admin.add') . ' - ')
@section('speedbar')
    <div class="content-header row">
        <div class="content-header-left col-md-9 col-12 mb-2">
            <div class="row breadcrumbs-top">
                <div class="col-12">
                    <h2 class="content-header-title float-left mb-0">@lang('admin.add')</h2>
                    <div class="breadcrumb-wrapper col-12">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item ">
                                <a href="{{ route('dashboard') }}">@lang('admin.home')</a>
                            </li>
                            <li class="breadcrumb-item">
                                <a href="{{ route('dashboard.usefulinfos.index') }}">@lang('admin.usefulinfos.title')</a>
                            </li>
                            <li class="breadcrumb-item">
                                <a
                                    href="{{ route('dashboard.usefulinfoitems.index', $usefulinfo_id) }}">@lang('admin.usefulinfoitems.title')</a>
                            </li>
                            <li class="breadcrumb-item active">
                                @lang('admin.add')
                            </li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@push('css')
    <link rel="stylesheet" type="text/css"
        href="{{ asset('/vendor/dashboard/app-assets/vendors/css/forms/select/select2.min.css') }}">
@endpush

@section('content')
    <div class="row">
        <div class="col-md-12 col-12">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title">@lang('admin.add')</h4>
                </div>
                <div class="card-content">
                    <form class="form form-vertical" action="{{ route('dashboard.usefulinfoitems.store', $usefulinfo_id) }}"
                        enctype="multipart/form-data" method="post">
                        @csrf

                        {{--  <input type="hidden" name="usefulinfo_id" value="{{ $usefulinfo_id }}">  --}}

                        <div class="card-body">
                            <div class="form-body">
                                <p>@lang('admin.all_fields_with')</p>
                                <div class="row">
                                    <div class="col-12">
                                        <div class="row">
                                            <div class="col-12">
                                                <div class="form-group">
                                                    <label for="first-name-vertical">@lang('admin.partners.name') (uz) *</label>
                                                    <input type="text" id="first-name-vertical" required
                                                        class="form-control @error('name_uz') is-invalid @enderror"
                                                        name="name_uz" value="{{ old('name_uz') }}"
                                                        placeholder="@lang('admin.partners.name') (uz)">
                                                    @error('name_uz')
                                                        <div class="invalid-feedback">
                                                            {{ $message }}
                                                        </div>
                                                    @enderror
                                                </div>
                                            </div>
                                            <div class="col-12">
                                                <div class="form-group">
                                                    <label for="first-name-vertical">@lang('admin.partners.name') (ru) *</label>
                                                    <input type="text" id="first-name-vertical" required
                                                        class="form-control @error('name_ru') is-invalid @enderror"
                                                        name="name_ru" value="{{ old('name_ru') }}"
                                                        placeholder="@lang('admin.partners.name') (ru)">
                                                    @error('name_ru')
                                                        <div class="invalid-feedback">
                                                            {{ $message }}
                                                        </div>
                                                    @enderror
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-12">
                                        <div class="form-group">
                                            <label for="description_uz">@lang('admin.partners.description') (uz)</label>
                                            <textarea id="description_uz" class="form-control @error('description_uz') is-invalid @enderror" name="description_uz"
                                                placeholder="@lang('admin.partners.description')">{{ old('description_uz') }}</textarea>
                                            @error('description_uz')
                                                <div class="invalid-feedback">
                                                    {{ $message }}
                                                </div>
                                            @enderror
                                        </div>
                                    </div>

                                    <div class="col-12">
                                        <div class="form-group">
                                            <label for="description_ru">@lang('admin.partners.description') (ru)</label>
                                            <textarea id="description_ru" class="form-control @error('description_ru') is-invalid @enderror" name="description_ru"
                                                placeholder="@lang('admin.partners.description')">{{ old('description_ru') }}</textarea>
                                            @error('description_ru')
                                                <div class="invalid-feedback">
                                                    {{ $message }}
                                                </div>
                                            @enderror
                                        </div>
                                    </div>

                                    <div class="col-12">
                                        <div class="form-group">
                                            <label for="video_url">@lang('admin.partners.video_url')</label>
                                            <input type="text" id="video_url"
                                                class="form-control @error('video_url') is-invalid @enderror"
                                                name="video_url" value="{{ old('video_url') }}"
                                                placeholder="@lang('admin.partners.video_url')">
                                            @error('video_url')
                                                <div class="invalid-feedback">
                                                    {{ $message }}
                                                </div>
                                            @enderror
                                        </div>
                                    </div>

                                    <div class="col-12">
                                        <div class="form-group">
                                            <label for="link_url">@lang('admin.usefulinfoitems.link_url')</label>
                                            <input type="text" id="link_url"
                                                class="form-control @error('link_url') is-invalid @enderror" name="link_url"
                                                value="{{ old('link_url') }}" placeholder="@lang('admin.usefulinfoitems.link_url')">
                                            @error('link_url')
                                                <div class="invalid-feedback">
                                                    {{ $message }}
                                                </div>
                                            @enderror
                                        </div>
                                    </div>

                                    <div class="col-12">
                                        <div class="form-group">
                                            <label for="file">@lang('admin.usefulinfoitems.file')</label>
                                            <input type="file" id="file"
                                                class="form-control @error('file') is-invalid @enderror" name="file"
                                                value="{{ old('file') }}"
                                                accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx"
                                                placeholder="@lang('admin.usefulinfoitems.file')">
                                            @error('file')
                                                <div class="invalid-feedback">
                                                    {{ $message }}
                                                </div>
                                            @enderror
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <div class="card-footer pb-0 pl-0 pt-1">
                            <div class="col-12 mb-0">
                                <div class="row">
                                    <div class="col-3">
                                        <button type="submit"
                                            class="btn btn-primary mr-1 mb-1 waves-effect waves-light btn-icon">
                                            <i class="feather icon-save"></i> @lang('admin.save')
                                        </button>
                                    </div>

                                    <div class="col-9">
                                        <a href="{{ route('dashboard.usefulinfoitems.index', $usefulinfo_id) }}"
                                            class="btn btn-danger mr-1 mb-1 waves-effect waves-light btn-icon pull-right">
                                            <i class="feather icon-x-circle"></i> @lang('admin.cancel')
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection

@push('js')
    <script src="{{ asset('/vendor/dashboard/app-assets/vendors/js/forms/select/select2.full.min.js') }}"></script>
    <script src="{{ asset('/vendor/dashboard/app-assets/js/scripts/forms/select/form-select2.js') }}"></script>
@endpush
