<x-user.layout title="{{ auth()->user()->firstname.' '.auth()->user()->lastname }} | Open Ticket - {{ config('settings.site_name') }}">

    <div class="row">
        <div class="col-10 mx-auto">
            <div class="card h-100">
                <div class="card-inner">
                    <div class="card-title border-bottom d-flex justify-content-between mb-3">
                        <div><h6 class="title">Support Tickets</h6></div>
                        <div><a href="{{ route('user.tickets') }}" class="btn btn-primary btn-sm" ><em class="icon ni ni-ticket-plus"></em> My Tickets</a></div>
                    </div>

                    @if($errors->any())
                        <div class="form-group">
                            <div class="alert alert-danger">
                                <em class="icon ni ni-alert-circle"></em>
                                <strong>{{ $errors->first() }}</strong>
                            </div>
                        </div>
                    @endif

                    <form class="form-validate is-alter" novalidate="novalidate" method="POST" id="formData">
                        @csrf
                        <div class="row g-gs">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="form-label">Department</label>
                                    <div class="form-control-wrap">
                                        <select class="form-control form-select" id="department" name="department">
                                            <option @if (old('department')=='General') selected @endif>General</option>
                                            <option @if (old('department')=='Account & Billing') selected @endif>Account &amp; Billing</option>
                                            <option @if (old('department')=='Security') selected @endif>Security</option>
                                            <option @if (old('department')=='Technical') selected @endif>Technical</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="form-label" for="fva-subject">Subject</label>
                                    <div class="form-control-wrap">
                                        <input type="text" class="form-control" id="subject" name="subject" value="{{ old('subject') }}" placeholder="Enter subject" >
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label class="form-label" for="message">Message</label>
                                    <div class="form-control-wrap">
                                        <textarea class="form-control tinymce-basic form-control-sm" id="message" name="message" placeholder="Write your complaint" >{{ old('message') }}</textarea>
                                    </div>
                                </div>
                            </div>
                            <div class="nk-pps-field form-action text-center">
                                <div class="nk-pps-action">
                                    <button class="btn btn-block btn-primary buttonClick">
                                        <span>Open Ticket</span>
                                        <span class="spinner-border spinner-border-sm hide button-spinner" style="display: none;" role="status" aria-hidden="true"></span>
                                    </button>
                                </div>
                            </div>
                            {{-- <div class="col-md-12">
                                <div class="form-group">
                                    <button type="submit" class="btn btn-lg btn-primary">Open Ticket</button>
                                </div>
                            </div> --}}
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>


</x-user.layout>
