@extends('layouts.app')

@section('extra_css')
<link rel="stylesheet" href="{{ asset('assets/css/bootstrap-datepicker.min.css') }}">
@endsection

@section("breadcrumb")
<li class="breadcrumb-item">
    <a href="{{ route('travel-allowance.index') }}">@lang('fleet.dynamic_fare_Range')</a>
</li>
<li class="breadcrumb-item active">Edit @lang('fleet.dynamic_fare_Range')</li>
@endsection

@section('content')
<div class="row">
    <div class="col-md-12">
        <div class="card card-warning">
            <div class="card-header">
                <h3 class="card-title">Edit @lang('fleet.dynamic_fare_Range')</h3>
            </div>

            <div class="card-body">

                {{-- Validation Errors --}}
                @if ($errors->any())
                <div class="alert alert-danger">
                    <ul class="mb-0">
                        @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
                @endif

                {!! Form::open([
                    'url' => route('dynamic-fare-range.update', $data->id),
                    'method' => 'PUT',
                    'class' => 'form-reset'
                ]) !!}

                {!! Form::hidden('user_id', Auth::user()->id) !!}

                <div class="row">

                    {{-- MIN VALUE --}}
                    <div class="col-md-3">
                        <label>@lang('fleet.Min_Value') <span class="text-danger">*</span></label>
                        <div class="form-group">
                            <input type="number" name="min_value"
                                   class="form-control"
                                   value="{{ old('min_value', $data->min_value) }}"
                                   required min="0">
                        </div>
                    </div>

                    {{-- MAX VALUE --}}
                    <div class="col-md-3">
                        <label>@lang('fleet.Max_Value') <span class="text-danger">*</span></label>
                        <div class="form-group">
                            <input type="number" name="max_value"
                                   class="form-control"
                                   value="{{ old('max_value', $data->max_value) }}"
                                   required min="0">
                        </div>
                    </div>

                    {{-- PERCENTAGE --}}
                    <div class="col-md-3">
                        <label>@lang('fleet.Percentage') (%) <span class="text-danger">*</span></label>
                        <div class="form-group">
                            <input type="number" name="percentage"
                                   class="form-control"
                                   value="{{ old('percentage', $data->percentage) }}"
                                   required min="0" step="0.01">
                        </div>
                    </div>

                  

                </div>

                <div class="row mt-3">
                    <div class="col-md-12">
                        {!! Form::submit(__('fleet.update'), ['class' => 'btn btn-warning']) !!}
                        <a href="{{ route('dynamic-fare-range.index') }}"
                           class="btn btn-secondary ml-2">
                            @lang('fleet.can_cel')
                        </a>
                    </div>
                </div>

                {!! Form::close() !!}
            </div>
        </div>
    </div>
</div>
@endsection


