@extends('agent.layouts.app')
@push('title')
    {{ __('Create Ticket') }}
@endpush
@push('style')
    <link rel="stylesheet" type="text/css" href="{{ asset('common/css/summernote/summernote.min.css') }}"/>
    <link rel="stylesheet" type="text/css" href="{{ asset('common/css/summernote/summernote-lite.min.css') }}"/>
@endpush
@section('content')

    <div data-aos="fade-up" data-aos-duration="1000" class="p-sm-30 p-15">
        <h4 class="fs-18 fw-600 lh-20 text-title-black pb-17">{{__('Create Ticket')}}</h4>
        <div class="p-sm-25 p-15 bd-one bd-c-stroke bd-ra-10 bg-white">
            <form action="{{route('agent.ticket.submit')}}" method="post" class="form-horizontal"
                  enctype="multipart/form-data">
                @csrf
                <div class="row rg-24">
                    <div class="col-md-6">
                        <div class="user-info-from">
                            <label class="zForm-label">{{__("Subject")}} <span>*</span></label>
                            <input type="text" placeholder="{{__("Subject")}}" class="zForm-control" name="subject">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="user-info-from">
                            <label class="zForm-label w-100">{{__("Category")}} <span>*</span></label>
                            <select id="" class="single-catagories zForm-control" name="category">
                                <option>{{__("Select Category")}}</option>
                                @foreach($category as $item)
                                    <option value="{{$item->id}}">{{$item->name}}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>

                    @if(count($dynamicFields)>0)
                        @foreach($dynamicFields as $field)
                            <div class="col-md-12">
                                <div class="zi-lg-w-100" style="width: {{$field->width != null?$field->width:100}}%;">
                                    <div class="user-info-from">
                                        @if($field->type == TEXT_FIELD_ID)
                                            <label class="zForm-label">{{$field->level}}
                                                <span> {{$field->required == REQUIRED_YES?'*':''}}</span></label>
                                            <input type="text" placeholder="{{$field->placeholder}}" class="zForm-control"
                                                   name="{{$field->name}}">
                                        @elseif($field->type == TEXTAREA_FIELD_ID)
                                            <label class="zForm-label">{{$field->level}}
                                                <span> {{$field->required == REQUIRED_YES?'*':''}}</span></label>
                                            <textarea class="zForm-control mb-3 text-h"
                                                      placeholder="{{$field->placeholder}}"
                                                      name="{{$field->name}}"></textarea>
                                        @endif
                                    </div>
                                </div>
                            </div>
                        @endforeach
                    @endif

                    <div class="col-md-12">
                        <div class="user-info-from">
                            <label class="zForm-label">{{__("Description")}} <span> *</span></label>
                            <textarea class="customer-ticket-create summernoteOne" placeholder="Massage"
                                      name="details"></textarea>
                        </div>
                    </div>

                    <div class="col-md-12">
                        <div class="file-upload">
                            <div class="ticket-upload-box pb-12">
                                <div class="ticket-upload-btn-box">
                                    <p class="fs-15 fw-600 lh-24 text-para-text pb-12">{{__("Upload file (JPG, JPEG, PNG, ZIP, MP4, GIF, DOC)")}}</p>
                                    <div class="choose-file-border file-upload-one">
                                        <label class="upload__btn" for="ticket-upload-img">
                                            <p class="fs-12 fw-500 lh-16 text-para-text">{{ __('Choose files to upload') }}</p>
                                            <p class="fs-12 fw-500 lh-16 text-white browse-file">{{ __('Browse File') }}</p>
                                        </label>
                                        <input type="file" multiple="" data-max_length="20" id="ticket-upload-img"
                                               name="file[]" class="ticket-img-input d-none">
                                    </div>
                                </div>
                                <div class="ticket-upload-img-wrap"></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="agree-box align-items-start">
                    <div class="agree-left zForm-wrap-checkbox">
                        <input type="checkbox" id="service">
                        <label for="service"> {{__("I agree with")}} <a href="{{ route('terms.of.use.index') }}"
                                                                        target="__blank"
                                                                        class="text-main-color text-decoration-underline">{{__("Terms & Service")}}</a></label>
                    </div>
                    <button class="submit-btu border-0 bg-main-color py-8 px-26 bd-ra-8 fs-15 fw-600 lh-25 text-white mt-25"
                            disabled="disabled">{{__("Create Ticket")}}</button>
                </div>
            </form>
        </div>
    </div>
@endsection

@push('script')
    <script src="{{asset('agent/assets/js/custom/notification.js')}}"></script>
    <script src="{{ asset('common/js/summernote/summernote-lite.min.js') }}"></script>
    <script src="{{ asset('admin/js/custom/summernote-init.js') }}"></script>
@endpush
