@extends('layouts.index')
@section('css-part')
<link rel="stylesheet" href="{{ asset('assets/css/general.panel.css') }}">
<link rel="stylesheet" href="{{ asset('assets/css/jalalidatepicker.min.css') }}">
@endsection
@section('js-part')
<script src="{{ asset('assets/js/city.js') }}"></script>
<script src="{{ asset('assets/js/jalalidatepicker.min.js') }}"></script>
<script src="{{ asset('assets/js/general.panel.js') }}"></script>
<script>
    $(document).ready(function() {
        jalaliDatepicker.startWatch({
            minDate: "attr",
            maxDate: "attr",
            minTime: "attr",
            maxTime: "attr",
            time: false,
            date: true,
            hasSecond: true,
            hideAfterChange: false,
            autoHide: true,
            showTodayBtn: true,
            showEmptyBtn: true,
            topSpace: 10,
            bottomSpace: 30,
            overflowSpace: -10,
            dayRendering(opt, input) {
                return {
                    isHollyDay: opt.day == 1,
                };
            },
        });
    });
</script>
@endsection
@section('panel')
@include('layouts.header.header')
@include('layouts.nav.nav')
@endsection
@section('container')
<div class="container">
    @include('layouts.notification.success')
    <h2 class=" text-center mt-3">لیست درخواست ها</h2>
    <form method="get" class="mt-3">
        <div class="row">
            <div class="col-12 col-md-6 col-lg-2 form-group mt-3  ms-0 ms-lg-2">
                <input type="text" class=" form-control" name="from" id="from" data-jdp value="{{request('from')}}" placeholder="از تاریخ">
            </div>
            <div class="col-12 col-md-6 col-lg-2 form-group mt-3  ms-0 ms-lg-2">
                <input type="text" class=" form-control" name="to" id="to" data-jdp value="{{request('to')}}" placeholder="به تاریخ">
            </div>
            <div class="col-12 col-md-6 col-lg-2 form-group mt-3 ms-0 ms-lg-2">
                <input type="text" class="form-control" name="fname" id="fname" placeholder="نام کشاورز" value="{{request('fname')}}">
            </div>
            <div class="col-12 col-md-6 col-lg-2 form-group mt-3 ms-0 ms-lg-2 ">
                <input type="text" class="form-control" name="lname" id="lname" placeholder="نام خانوادگی" value="{{request('lname')}}">
            </div>
            <div class="col-12 col-md-6 col-lg-3 form-group mt-3 mt-md-0 d-flex justify-content-between">
                <div class="form-group mt-3">
                    <button type="submit" class="btn btn-primary ms-0 ms-md-3">فیلتر</button>
                </div>

                @if(request('from') || request('to') || request('fname') || request('lname'))
                <div class="form-group  mt-3">
                    <a href="{{ request()->url() }}" class="btn btn-outline-secondary ms-0 ms-md-2">حذف فیلتر</a>
                </div>
                @endif
            </div>

        </div>
    </form>
    <form action="{{route('dryer.printlist')}}" method="get">
        <input type="hidden" name="step" value="9">
        <input type="hidden" name="farmer_first_name" value="{{request('fname')}}">
        <input type="hidden" name="farmer_last_name" value="{{request('lname')}}">
        <input type="hidden" name="from" value="{{request('from')}}">
        <input type="hidden" name="to" value="{{request('to')}}">
        <button type="submit" class="btn btn-outline-success mt-3">دریافت خروجی</button>
    </form>
    @include('dryer.list.table')
</div>
@endsection