@extends('layouts.app')
@section("breadcrumb")
<li class="breadcrumb-item"><a href="{{ route('cancel-reason.index')}}">@lang('fleet.cancellation')</a></li>
<li class="breadcrumb-item active">@lang('fleet.addReason')</li>
@endsection
@section('content')
<div class="row">
  <div class="col-md-12">
    <div class="card card-success">
      <div class="card-header">
        <h3 class="card-title">@lang('fleet.addReason')</h3>
      </div>
      <div class="card-body">
        @if (count($errors) > 0)
        <div class="alert alert-danger">
          <ul>
            @foreach ($errors->all() as $error)
              <li>{{ $error }}</li>
            @endforeach
          </ul>
        </div>
        @endif
        {!! Form::open(['route' => 'cancel-reason.store','method'=>'post','class' => 'form-reset']) !!}
        {!! Form::hidden('user_id',Auth::user()->id)!!}
        <div class="row">
          <div class="col-md-6">
            <div class="form-group">
              {!! Form::label('reason',__('fleet.addReason'), ['class' => 'form-label']) !!}
              {!! Form::text('reason',null,['class'=>'form-control','required']) !!}
            </div>
          </div>

           <div class="col-md-6">
            <div class="form-group">
              {!! Form::label('reason',__('fleet.type'), ['class' => 'form-label']) !!}

              <select class="form-control" name="type" required>
                  <option value="">Select</option>
                  <option value="All">All</option>
                  <option value="C">Customer</option>
                  <option value="D">Driver</option>
              </select>
            </div>
          </div>

          
        </div>
        <div class="row">
          <div class="col-md-12">
            {!! Form::submit(__('fleet.save'), ['class' => 'btn btn-success']) !!}
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
@endsection


@section('script')

<script>
  $(document).ready(function() {
    $(".form-reset").on("submit", function(event) {
        $('input[type="submit"]').prop('disabled', true);
    });
  });
</script>

@endsection
