{{-- Extends layout --}}
@extends('layout.default')

{{-- Content --}}
@section('content')

<div class="card card-custom example example-compact">
    <div class="card-header">
        <h3 class="card-title">
            Timing
            @if(isset($timings['timingid']))
                Edit
            @else 
                Add
            @endif
        </h3>
    </div>
    <!--begin::Form-->
    <form class="form" action="{{$action}}" method="POST">
        @csrf
        @isset($timings->timingid)
        {{ method_field('PATCH')}}
        @endisset
        <div class="card-body">
            @if ($errors->any())
            <div class="alert alert-danger">
                <strong>Error!</strong>
                <ul>
                    @foreach ($errors->all() as $error)
                    <li></li>
                    @endforeach
                </ul>
            </div>
            @endif

            <div class="form-group row">
                <label class="col-lg-3 control-label">Timing:</label>
                <div class="col-lg-6 col-md-9 col-sm-12">
                    <input type="hidden" name="ttid" value="{{$timings->timingid}}" />
                    <input type="text" class="form-control" id="timename" value="{{$timings->timename}}" name="timename" placeholder="Enter Name" minlength="2" maxlength="50" required />
                </div>
            </div>
            <div class="form-group row">
                <label class="col-lg-3 control-label">&nbsp;</label>
                <div class="col-lg-9">
                    <label>
                        <input type="checkbox" value="1" name="isactive" checked>
                        Is Valid
                    </label>
                </div>
            </div>
        </div>
        <div class="card-footer">
            <div class="row">
                <div class="col-lg-9 ml-lg-auto">
                    <button type="submit" class="btn btn-success mr-2">Submit</button>
                    <a href="/timings" class="btn btn-secondary">Back</a>
                </div>
            </div>
        </div>
    </form>
    <!--end::Form-->
</div>
@endsection
{{-- Styles Section --}}
@section('styles')
<link href="{{ asset('plugins/custom/datatables/datatables.bundle.css') }}" rel="stylesheet" type="text/css" />
@endsection
{{-- Scripts Section --}}
@section('scripts')
{{-- vendors --}}
<script src="{{ asset('plugins/custom/datatables/datatables.bundle.js') }}" type="text/javascript"></script>

{{-- page scripts --}}
<script src="{{ asset('js/pages/crud/datatables/extensions/buttons.js') }}" type="text/javascript"></script>

<script src="{{ asset('js/app.js') }}" type="text/javascript"></script>
@endsection