@extends('master')
@section('icerik')
    <div class="container mt-4 mb-4">
        <h3><i class="fa fa-calendar-check-o text-success"></i> Kiralama Tarihleri</h3>
        <form action="/arac-kirala" method="post" id="formx">
            <input type="hidden" name="arac" value="{{ $request->id }}">
            @csrf
        <div class="row">
            <div class="col-lg-4">
                Teslim Tarihi
                <input type="date" name="alinma" @isset($request->alinma) value="{{ $request->alinma }}" @else value="{{ date('Y-m-d') }}" @endif required class="form-control">
                Teslim Yeri
                <input type="text" name="alinmayeri" value="{{ $ayar['adres'] }}"  class="form-control" >
            </div>
            <div class="col-lg-4">
                İade Tarihi
                <input type="date" name="birakilma" @isset($request->birakilma) value="{{ $request->birakilma }}" @else value="{{ date('Y-m-d', strtotime('+7 days')) }}" @endif  required class="form-control">
                İade Yeri
                <input type="text" name="birkilmayeri" class="form-control" value="{{$ayar['adres']}}" >
            </div>
            <div class="col-lg-4"><br>
                <button class="btn-lg btn-main p-3" style="height: 80%; width: 100%;"><i class="fa fa-chevron-right"></i> <br> İleri </button>
            </div>
        </div>
        </form>

    </div>
    @isset($request->alinma)
        @isset($request->birakilma)
            <script>
                document.getElementById('formx').submit();





            </script>

        @endisset
    @endisset
@endsection
