@extends('layouts.main') 
@section('title', 'Intervention Master')
@section('content')

<?php 
    $getstatecodedata = DB::table('state_master')->get();
?>
    <div class="container-fluid">
        <div class="page-header">
            <div class="row align-items-end">
                <div class="col-lg-8">
                    <div class="page-header-title">
                        <i class="ik ik-edit bg-blue"></i>
                        <div class="d-inline">
                            <h5>{{ __('Intervention Master')}}</h5>
                        </div>
                    </div>
                </div>
                <div class="col-lg-4">
                    <nav class="breadcrumb-container" aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">
                                <a href="{{route('dashboard')}}"><i class="ik ik-home"></i></a>
                            </li>
                            <li class="breadcrumb-item"><a href="#">{{ __('Forms')}}</a></li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-7 mx-auto">
                <div class="card">
                    <div class="card-header"><h3>{{ __('Intervention Master Form')}}</h3></div>
                    <div class="card-body">
                        <form class="forms-sample"  method='POST' @if(!empty($showdata)) action="{{ url('updateint') }}" @else action="{{ url('intinsert') }}" @endif>
                            @csrf
                            
                            @if(!empty($showdata))
                            <input type='hidden' name='id' value='{{$showdata[0]->id}}'>
                            @endif
                            
                            <div class="form-group">
                                <label for="int_id">{{ __('INT Id')}}</label>
                                <input type="number" class="form-control" id="int_id" name='int_id' <?php if(!empty($showdata)){ ?> value='{{$showdata[0]->int_id}}' <?php } ?> placeholder="Enter INT Id" required>
                            </div>
                            <div class="form-group">
                                <label for="int_support">{{ __('INT Support')}}</label>
                                <input type="text" class="form-control" id="int_support" name='int_support' <?php if(!empty($showdata)){ ?> value='{{$showdata[0]->int_support}}' <?php } ?> placeholder="Enter INT Support" required>
                            </div>
                            
                            <br><br>
                            <button type="submit" class="btn btn-primary mr-2">{{ __('Submit')}}</button>
                            @if(empty($showdata))
                            <a href='{{'int-master'}}' class="btn btn-light">{{ __('Cancel')}}</a>
                            @endif
                          </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- push external js -->
    @push('script')
        <script src="{{ asset('js/form-components.js') }}"></script>
    @endpush
@endsection