@extends('layouts.app')
@section('title','Claim Documents Verification | ')
@section('content')
<!-- Content Header (Page header) -->
<div class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-sm-6">
                <h1 class="m-0">Claim Documents</h1>
            </div><!-- /.col -->
            <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                    <li class="breadcrumb-item"><a href="#">Home</a></li>
                    <li class="breadcrumb-item active">Claim Management</li>
                </ol>
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->
<!-- Main content -->
<section class="content">
    <div class="container-fluid">

        <div class="card card-default">
            <div class="card-header">
                <h3 class="card-title">Claim Documents</h3>
            </div>
            <!-- /.card-header -->
            <div class="card-body">
                @if (session('success'))
                <div class="alert alert-success alert-dismissible fade show" role="alert">
                    <strong>{{ session('success') }}</strong>
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                @endif
                @if (session('error'))
                <div class="alert alert-danger alert-dismissible fade show" role="alert">
                    <strong>{{ session('error') }}</strong>
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                @endif
                @if (session('warning'))
                <div class="alert alert-warning alert-dismissible fade show" role="alert">
                    <strong>{{ session('warning') }}</strong>
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                @endif
                <form action="{{ route('store.next.claim.form') }}" method="post" autocomplete="off">
                    @csrf
                    <input type="hidden" id="claim_id" name="claim_id" value="{{ $claim_data->claim_id }}">
                    <input type="hidden" name="claim_type" value="{{ $claim_data->claim_type }}">
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="">Employee ID</label>
                                <input type="text" class="form-control" value="{{ $claim_data->emp_id }}" readonly>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="">Employee Name</label>
                                <input type="text" class="form-control" value="{{ $claim_data->emp_name }}" readonly>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="">Claim Type</label>
                                <input type="text" class="form-control" value="{{ ($claim_data->claim_type == 1) ? 'Death' : 'Accident' }}" readonly>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="claim_for">Claim For</label>
                                <select name="claim_for"
                                    class="custom-select form-control reset_form @if( $errors->has('claim_for')) is-invalid border-danger  @endif"
                                    id="claim_for">
                                    <option value="" {{ (old('claim_for') == '') ? 'selected' : '' }}>Select Claim For
                                    </option>
                                    <option value="EPF" {{ (old('claim_for') == 'EPF') ? 'selected' : '' }}>EPF</option>
                                    <option value="ESI" {{ (old('claim_for') == 'ESI') ? 'selected' : '' }}>ESI</option>
                                    <option value="WC" {{ (old('claim_for') == 'WC') ? 'selected' : '' }}>WC</option>
                                    <option value="GPA" {{ (old('claim_for') == 'GPA') ? 'selected' : '' }}>GPA</option>
                                </select>
                                <small class="text-danger claim_for_error"></small>
                                @if($errors->has('claim_for'))
                                <span id="claim_for-error"
                                    class="error text-danger invalid-feedback">{{ $errors->first('claim_for') }}</span>
                                <small></small>
                                @endif
                            </div>
                        </div>
                    </div>
                    <div class="claim_by_epf">
                        <div class="row">
                            <div class="col-md-12 ">
                                <div class="form-group">
                                    <label for="document_for_claim">Document required for EPF Claim</label>
                                    <br><small class='text-muted'><strong>Important: </strong>All the documents are
                                        required
                                        for claim as mentioned below</small>
                                    <div class="custom-control custom-checkbox ">
                                        <input class="custom-control-input " name="epf_emp_aadhar" value="1"
                                            type="checkbox" id="epf_emp_aadhar"
                                            {{ (old('epf_emp_aadhar') == '1') ? 'checked' : '' }}>
                                        <label for="epf_emp_aadhar" class="custom-control-label">Aadhar of
                                            Divyang
                                            Employee</label>
                                    </div>
                                    @if($errors->has('epf_emp_aadhar'))
                                        <small  class="error text-danger">{{ $errors->first('epf_emp_aadhar') }}</small>
                                    @endif
                                    @if($claim_data->claim_type == 1)
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="epf_death_certificate" value="1"
                                            type="checkbox" id="epf_death_certificate"
                                            {{ (old('epf_death_certificate') == '1') ? 'checked' : '' }}>
                                        <label for="epf_death_certificate" class="custom-control-label">Death
                                            Certificate</label>
                                    </div>
                                    @if($errors->has('epf_death_certificate'))
                                        <small  class="error text-danger">{{ $errors->first('epf_death_certificate') }}</small>
                                    @endif
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="epf_nominee" value="1" type="checkbox"
                                            id="epf_nominee" {{ (old('epf_nominee') == '1') ? 'checked' : '' }}>
                                        <label for="epf_nominee" class="custom-control-label">Nominee's
                                            Document</label>
                                    </div>
                                    @if($errors->has('epf_nominee'))
                                        <small  class="error text-danger">{{ $errors->first('epf_nominee') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="epf_pan" value="1" type="checkbox"
                                            id="epf_pan" {{ (old('epf_pan') == '1') ? 'checked' : '' }}>
                                        <label for="epf_pan" class="custom-control-label">PAN</label>
                                    </div>
                                    @if($errors->has('epf_pan'))
                                        <small  class="error text-danger">{{ $errors->first('epf_pan') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="epf_bank_passbook" value="1"
                                            type="checkbox" id="epf_bank_passbook"
                                            {{ (old('epf_bank_passbook') == '1') ? 'checked' : '' }}>
                                        <label for="epf_bank_passbook" class="custom-control-label">Bank Passbook(Only
                                            SBI)
                                            <br>
                                            <small class="text-muted">Join account in SBI with mother if child is
                                                minor</small>
                                        </label>
                                    </div>
                                    @if($errors->has('epf_bank_passbook'))
                                        <small  class="error text-danger">{{ $errors->first('epf_bank_passbook') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="epf_ration_card" value="1"
                                            type="checkbox" id="epf_ration_card"
                                            {{ (old('epf_ration_card') == '1') ? 'checked' : '' }}>
                                        <label for="epf_ration_card" class="custom-control-label">Ration Card</label>
                                    </div>
                                    @if($errors->has('epf_ration_card'))
                                        <small  class="error text-danger">{{ $errors->first('epf_ration_card') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="epf_photos" value="1" type="checkbox"
                                            id="epf_photos" {{ (old('epf_photos') == '1') ? 'checked' : '' }}>
                                        <label for="epf_photos" class="custom-control-label">3 Photos</label>
                                    </div>
                                    @if($errors->has('epf_photos'))
                                        <small  class="error text-danger">{{ $errors->first('epf_photos') }}</small>
                                    @endif

                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="epf_member_id">Member ID</label>
                                    <input type="text" name="epf_member_id"
                                        class="form-control   @if( $errors->has('epf_member_id')) is-invalid border-danger  @endif"
                                        value="{{ old('epf_member_id') }}" id="epf_member_id" placeholder="Member ID">
                                    @if ($errors->has('epf_member_id'))
                                    <span id="epf_member_id-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('epf_member_id') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="epf_uan_number">UAN Number</label>
                                    <input type="number" name="epf_uan_number"
                                        class="form-control @if( $errors->has('epf_uan_number')) is-invalid border-danger  @endif"
                                        id="epf_uan_number" value="{{ old('epf_uan_number') }}"
                                        placeholder="EPF/UAN Number" max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('epf_uan_number'))
                                    <span id="epf_uan_number-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('epf_uan_number') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="epf_intimation_date">Intimation Date(Optional) <small
                                            class="text-muted intimation_date_info_label">(Department Information Date)</small></label>
                                    <input type="date" name="epf_intimation_date"
                                        class="form-control @if( $errors->has('epf_intimation_date')) is-invalid border-danger  @endif"
                                        id="epf_intimation_date" value="{{ old('epf_intimation_date') }}"
                                        max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('epf_intimation_date'))
                                    <span id="epf_intimation_date-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('epf_intimation_date') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="epf_submission_date">Form Submission Date(Optional) <small class="text-muted">(Document
                                            Submission Date)</small></label>
                                    <input type="date" name="epf_submission_date"
                                        class="form-control @if( $errors->has('epf_submission_date')) is-invalid border-danger  @endif"
                                        id="epf_submission_date" value="{{ old('epf_submission_date') }}"
                                        max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('epf_submission_date'))
                                    <span id="epf_submission_date-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('epf_submission_date') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>

                        </div>
                    </div>
                    <div class="claim_by_esi">
                        <div class="row">
                            <div class="col-md-12 ">
                                <div class="form-group">
                                    <label for="document_for_claim">Document required for ESI Claim</label>
                                    <br><small class='text-muted'><strong>Important: </strong>All the documents are
                                        required
                                        for claim as mentioned below</small>
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="esi_emp_aadhar" value="1"
                                            type="checkbox" id="esi_emp_aadhar"
                                            {{ (old('esi_emp_aadhar') == '1') ? 'checked' : '' }}>
                                        <label for="esi_emp_aadhar" class="custom-control-label">Aadhar of
                                            Divyang
                                            Employee</label>
                                    </div>
                                    @if($errors->has('esi_emp_aadhar'))
                                        <small  class="error text-danger">{{ $errors->first('esi_emp_aadhar') }}</small>
                                    @endif
                                    @if($claim_data->claim_type == 1)
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="esi_death_certificate" value="1"
                                            type="checkbox" id="esi_death_certificate"
                                            {{ (old('esi_death_certificate') == '1') ? 'checked' : '' }}>
                                        <label for="esi_death_certificate" class="custom-control-label">Death
                                            Certificate</label>
                                    </div>
                                    @if($errors->has('esi_death_certificate'))
                                        <small  class="error text-danger">{{ $errors->first('esi_death_certificate') }}</small>
                                    @endif
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="esi_nominee" value="1" type="checkbox"
                                            id="esi_nominee" {{ (old('esi_nominee') == '1') ? 'checked' : '' }}>
                                        <label for="esi_nominee" class="custom-control-label">Nominee's
                                            Document</label>
                                    </div>
                                    @if($errors->has('esi_nominee'))
                                        <small  class="error text-danger">{{ $errors->first('esi_nominee') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="esi_pan" value="1" type="checkbox"
                                            id="esi_pan" {{ (old('esi_pan') == '1') ? 'checked' : '' }}>
                                        <label for="esi_pan" class="custom-control-label">PAN</label>
                                    </div>
                                    @if($errors->has('esi_pan'))
                                        <small  class="error text-danger">{{ $errors->first('esi_pan') }}</small>
                                    @endif
                                    
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="esi_ration_card" value="1"
                                            type="checkbox" id="esi_ration_card"
                                            {{ (old('esi_ration_card') == '1') ? 'checked' : '' }}>
                                        <label for="esi_ration_card" class="custom-control-label">Ration Card</label>
                                    </div>
                                    @if($errors->has('esi_ration_card'))
                                        <small  class="error text-danger">{{ $errors->first('esi_ration_card') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="esi_photos" value="1" type="checkbox"
                                            id="esi_photos" {{ (old('esi_photos') == '1') ? 'checked' : '' }}>
                                        <label for="esi_photos" class="custom-control-label">3 Photos</label>
                                    </div>
                                    @if($errors->has('esi_photos'))
                                        <small  class="error text-danger">{{ $errors->first('esi_photos') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="esi_fir_report" value="1"
                                            type="checkbox" id="esi_fir_report"
                                            {{ (old('esi_fir_report') == '1') ? 'checked' : '' }}>
                                        <label for="esi_fir_report" class="custom-control-label">FIR(First Information
                                            Report)</label>
                                    </div>
                                    @if($errors->has('esi_fir_report'))
                                        <small  class="error text-danger">{{ $errors->first('esi_fir_report') }}</small>
                                    @endif
                                    @if($claim_data->claim_type == 1)
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="esi_scratch" value="1" type="checkbox"
                                            id="esi_scratch" {{ (old('esi_scratch') == '1') ? 'checked' : '' }}>
                                        <label for="esi_scratch" class="custom-control-label">Scratch of the place where
                                            the accident happened</label>
                                    </div>
                                    @if($errors->has('esi_scratch'))
                                        <small  class="error text-danger">{{ $errors->first('esi_scratch') }}</small>
                                    @endif
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="esi_bank_passbook" value="1"
                                            type="checkbox" id="esi_bank_passbook"
                                            {{ (old('esi_bank_passbook') == '1') ? 'checked' : '' }}>
                                        <label for="esi_bank_passbook" class="custom-control-label">Bank Passbook
                                            <!-- <br>
                                            <small class="text-muted">Join account in SBI with mother if child is
                                                minor</small> -->
                                        </label>
                                    </div>
                                    @if($errors->has('esi_bank_passbook'))
                                        <small  class="error text-danger">{{ $errors->first('esi_bank_passbook') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="esi_passbook_statement" value="1"
                                            type="checkbox" id="esi_passbook_statement"
                                            {{ (old('esi_passbook_statement') == '1') ? 'checked' : '' }}>
                                        <label for="esi_passbook_statement" class="custom-control-label">Passbook 6
                                            Month(Statement)</label>
                                    </div>
                                    @if($errors->has('esi_passbook_statement'))
                                        <small  class="error text-danger">{{ $errors->first('esi_passbook_statement') }}</small>
                                    @endif
                                    @if($claim_data->claim_type == 1)
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="esi_post_mortem_report" value="1"
                                            type="checkbox" id="esi_post_mortem_report"
                                            {{ (old('esi_post_mortem_report') == '1') ? 'checked' : '' }}>
                                        <label for="esi_post_mortem_report" class="custom-control-label">Post Mortem Report</label>
                                    </div>
                                    @if($errors->has('esi_post_mortem_report'))
                                        <small  class="error text-danger">{{ $errors->first('esi_post_mortem_report') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="esi_panchnama_report" value="1"
                                            type="checkbox" id="esi_panchnama_report"
                                            {{ (old('esi_panchnama_report') == '1') ? 'checked' : '' }}>
                                        <label for="esi_panchnama_report" class="custom-control-label">Panchnama Report</label>
                                    </div>
                                    @if($errors->has('esi_panchnama_report'))
                                        <small  class="error text-danger">{{ $errors->first('esi_panchnama_report') }}</small>
                                    @endif
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="esi_member_id">Member ID</label>
                                    <input type="text" name="esi_member_id"
                                        class="form-control   @if( $errors->has('esi_member_id')) is-invalid border-danger  @endif"
                                        value="{{ old('esi_member_id') }}" id="esi_member_id" placeholder="Member ID">
                                    @if ($errors->has('esi_member_id'))
                                    <span id="esi_member_id-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('esi_member_id') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="esi_number">ESI Number</label>
                                    <input type="number" name="esi_number"
                                        class="form-control @if( $errors->has('esi_number')) is-invalid border-danger  @endif"
                                        id="esi_number" value="{{ old('esi_number') }}" placeholder="ESI Number"
                                        max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('esi_number'))
                                    <span id="esi_number-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('esi_number') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="esi_intimation_date">Intimation Date(Optional) <small
                                            class="text-muted intimation_date_info_label">(Department Information Date)</small></label>
                                    <input type="date" name="esi_intimation_date"
                                        class="form-control @if( $errors->has('esi_intimation_date')) is-invalid border-danger  @endif"
                                        id="esi_intimation_date" value="{{ old('esi_intimation_date') }}"
                                        max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('esi_intimation_date'))
                                    <span id="esi_intimation_date-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('esi_intimation_date') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="esi_submission_date">Form Submission Date(Optional) <small class="text-muted">(Document
                                            Submission Date)</small></label>
                                    <input type="date" name="esi_submission_date"
                                        class="form-control @if( $errors->has('esi_submission_date')) is-invalid border-danger  @endif"
                                        id="esi_submission_date" value="{{ old('esi_submission_date') }}"
                                        max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('esi_submission_date'))
                                    <span id="esi_submission_date-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('esi_submission_date') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="claim_by_wc">
                        <div class="row">
                            <div class="col-md-12 ">
                                <div class="form-group">
                                    <label for="document_for_claim">Document required for WC Claim</label>
                                    <br><small class='text-muted'><strong>Important: </strong>All the documents are
                                        required
                                        for claim as mentioned below</small>
                                    @if($claim_data->claim_type == 1)
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="wc_death_certificate" value="1"
                                            type="checkbox" id="wc_death_certificate"
                                            {{ (old('wc_death_certificate') == '1') ? 'checked' : '' }}>
                                        <label for="wc_death_certificate" class="custom-control-label">Death
                                            Certificate</label>
                                    </div>
                                    @if($errors->has('wc_death_certificate'))
                                        <small  class="error text-danger">{{ $errors->first('wc_death_certificate') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="wc_post_mortem_report" value="1"
                                            type="checkbox" id="wc_post_mortem_report"
                                            {{ (old('wc_post_mortem_report') == '1') ? 'checked' : '' }}>
                                        <label for="wc_post_mortem_report" class="custom-control-label">POST Mortem
                                            Report</label>
                                    </div>
                                    @if($errors->has('wc_post_mortem_report'))
                                        <small  class="error text-danger">{{ $errors->first('wc_post_mortem_report') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="wc_panchnama_report" value="1"
                                            type="checkbox" id="wc_panchnama_report"
                                            {{ (old('wc_panchnama_report') == '1') ? 'checked' : '' }}>
                                        <label for="wc_panchnama_report" class="custom-control-label">Panchnama Report</label>
                                    </div>
                                    @if($errors->has('wc_panchnama_report'))
                                        <small  class="error text-danger">{{ $errors->first('wc_panchnama_report') }}</small>
                                    @endif
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="wc_bills" value="1" type="checkbox"
                                            id="wc_bills" {{ (old('wc_bills') == '1') ? 'checked' : '' }}>
                                        <label for="wc_bills" class="custom-control-label">Bills/Medical Allowance</label>
                                    </div>
                                    @if($errors->has('wc_bills'))
                                        <small  class="error text-danger">{{ $errors->first('wc_bills') }}</small>
                                    @endif
                                    <!-- <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="wc_salary_slip" value="1" type="checkbox"
                                            id="wc_salary_slip" {{ (old('wc_salary_slip') == '1') ? 'checked' : '' }}>
                                        <label for="wc_salary_slip" class="custom-control-label">Salary Slip</label>
                                    </div>
                                    @if($errors->has('wc_salary_slip'))
                                        <small  class="error text-danger">{{ $errors->first('wc_salary_slip') }}</small>
                                    @endif -->
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="wc_policy_number">Policy Number</label>
                                    <input type="text" name="wc_policy_number"
                                        class="form-control   @if( $errors->has('wc_policy_number')) is-invalid border-danger  @endif"
                                        value="{{ old('wc_policy_number') }}" id="wc_policy_number"
                                        placeholder="Policy Number">
                                    @if ($errors->has('wc_policy_number'))
                                    <span id="wc_policy_number-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('wc_policy_number') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="wc_company_name">Company Name</label>
                                    <input type="text" name="wc_company_name"
                                        class="form-control @if( $errors->has('wc_company_name')) is-invalid border-danger  @endif"
                                        id="wc_company_name" value="{{ old('wc_company_name') }}"
                                        placeholder="Company Name" max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('wc_company_name'))
                                    <span id="wc_company_name-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('wc_company_name') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="wc_intimation_date">Intimation Date(Optional) <small
                                            class="text-muted intimation_date_info_label">(Department Information Date)</small></label>
                                    <input type="date" name="wc_intimation_date"
                                        class="form-control @if( $errors->has('wc_intimation_date')) is-invalid border-danger  @endif"
                                        id="wc_intimation_date" value="{{ old('wc_intimation_date') }}"
                                        max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('wc_intimation_date'))
                                    <span id="wc_intimation_date-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('wc_intimation_date') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="wc_submission_date">Form Submission Date(Optional) <small class="text-muted">(Document
                                            Submission Date)</small></label>
                                    <input type="date" name="wc_submission_date"
                                        class="form-control @if( $errors->has('wc_submission_date')) is-invalid border-danger  @endif"
                                        id="wc_submission_date" value="{{ old('wc_submission_date') }}"
                                        max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('wc_submission_date'))
                                    <span id="wc_submission_date-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('wc_submission_date') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="claim_by_gpa">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="document_for_claim">Document required for GPA Claim</label>
                                    <br><small class='text-muted'><strong>Important: </strong>All the documents are
                                        required
                                        for claim as mentioned below</small>
                                    @if($claim_data->claim_type == 1)
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="gpa_death_certificate" value="1"
                                            type="checkbox" id="gpa_death_certificate"
                                            {{ (old('gpa_death_certificate') == '1') ? 'checked' : '' }}>
                                        <label for="gpa_death_certificate" class="custom-control-label">Death
                                            Certificate</label>
                                    </div>
                                    @if($errors->has('gpa_death_certificate'))
                                        <small  class="error text-danger">{{ $errors->first('gpa_death_certificate') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="gpa_post_mortem_report" value="1"
                                            type="checkbox" id="gpa_post_mortem_report"
                                            {{ (old('gpa_post_mortem_report') == '1') ? 'checked' : '' }}>
                                        <label for="gpa_post_mortem_report" class="custom-control-label">POST Mortem
                                            Report</label>
                                    </div>
                                    @if($errors->has('gpa_post_mortem_report'))
                                        <small  class="error text-danger">{{ $errors->first('gpa_post_mortem_report') }}</small>
                                    @endif
                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="gpa_panchnama_report" value="1"
                                            type="checkbox" id="gpa_panchnama_report"
                                            {{ (old('gpa_panchnama_report') == '1') ? 'checked' : '' }}>
                                        <label for="gpa_panchnama_report" class="custom-control-label">Panchnama Report</label>
                                    </div>
                                    @if($errors->has('gpa_panchnama_report'))
                                        <small  class="error text-danger">{{ $errors->first('gpa_panchnama_report') }}</small>
                                    @endif
                                    @endif

                                    <div class="custom-control custom-checkbox">
                                        <input class="custom-control-input" name="gpa_bills" value="1" type="checkbox"
                                            id="gpa_bills" {{ (old('gpa_bills') == '1') ? 'checked' : '' }}>
                                        <label for="gpa_bills" class="custom-control-label">Bills/Medical Allowance</label>
                                    </div>
                                    @if($errors->has('gpa_bills'))
                                        <small  class="error text-danger">{{ $errors->first('gpa_bills') }}</small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="gpa_policy_number">Policy Number</label>
                                    <input type="text" name="gpa_policy_number"
                                        class="form-control   @if( $errors->has('gpa_policy_number')) is-invalid border-danger  @endif"
                                        value="{{ old('gpa_policy_number') }}" id="gpa_policy_number"
                                        placeholder="Policy Number">
                                    @if ($errors->has('gpa_policy_number'))
                                    <span id="gpa_policy_number-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('gpa_policy_number') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="gpa_company_name">Company Name</label>
                                    <input type="text" name="gpa_company_name"
                                        class="form-control @if( $errors->has('gpa_company_name')) is-invalid border-danger  @endif"
                                        id="gpa_company_name" value="{{ old('gpa_company_name') }}"
                                        placeholder="Company Name" max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('gpa_company_name'))
                                    <span id="gpa_company_name-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('wc_company_name') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="gpa_intimation_date">Intimation Date(Optional) <small
                                            class="text-muted intimation_date_info_label">(Department Information Date)</small></label>
                                    <input type="date" name="gpa_intimation_date"
                                        class="form-control @if( $errors->has('gpa_intimation_date')) is-invalid border-danger  @endif"
                                        id="gpa_intimation_date" value="{{ old('gpa_intimation_date') }}"
                                        max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('gpa_intimation_date'))
                                    <span id="gpa_intimation_date-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('gpa_intimation_date') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="gpa_submission_date">Form Submission Date(Optional) <small class="text-muted">(Document
                                            Submission Date)</small></label>
                                    <input type="date" name="gpa_submission_date"
                                        class="form-control @if( $errors->has('gpa_submission_date')) is-invalid border-danger  @endif"
                                        id="gpa_submission_date" value="{{ old('gpa_submission_date') }}"
                                        max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('gpa_submission_date'))
                                    <span id="gpa_submission_date-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('gpa_submission_date') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <!-- <div class="col-md-6">
                                <div class="form-group">
                                    <label for="gpa_hand_over_date">Date of hand over the lawyer</label>
                                    <input type="date" name="gpa_hand_over_date"
                                        class="form-control @if( $errors->has('gpa_hand_over_date')) is-invalid border-danger  @endif"
                                        id="gpa_hand_over_date" value="{{ old('gpa_hand_over_date') }}"
                                        max="{{ date('Y-m-d') }}">
                                    @if ($errors->has('gpa_hand_over_date'))
                                    <span id="gpa_hand_over_date-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('gpa_hand_over_date') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div> -->
                        </div>
                    </div>
                    <div class="if_accident">
                        <div class="row">
                            <!-- <div class="col-md-6">
                                <div class="form-group">
                                    <label for="claim_date">Claim Settled Date<small class="text-muted">(Claim Received
                                            Date)</small></label>
                                    <input type="date" name="claim_date"
                                        class="form-control   @if( $errors->has('claim_date')) is-invalid border-danger  @endif"
                                        value="{{ old('claim_date') }}" max="{{ date('Y-m-d') }}" id="claim_date">
                                    @if ($errors->has('claim_date'))
                                    <span id="claim_date-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('claim_date') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div> -->
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="claim_by">Claim Submitted By</label>
                                    <input type="text" name="claim_by"
                                        class="form-control   @if( $errors->has('claim_by')) is-invalid border-danger  @endif"
                                        value="{{ old('claim_by') }}" id="claim_by" placeholder="Claim By">
                                    @if ($errors->has('claim_by'))
                                    <span id="claim_by-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('claim_by') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="relation_with_emp">Relation With Employee</label>
                                    <select name="relation_with_emp"
                                        class="custom-select form-control reset_form @if( $errors->has('relation_with_emp')) is-invalid border-danger  @endif"
                                        id="relation_with_emp">
                                        <option value="" {{ (old('relation_with_emp') == '') ? 'selected' : '' }}>Select
                                            Relation</option>
                                        @php $relations = loadRelations(); @endphp
                                        @foreach($relations as $key => $value)
                                        <option value="{{ $key }}"
                                            {{ (old('relation_with_emp') == $key) ? 'selected' : '' }}>{{ $value }}
                                        </option>
                                        @endforeach
                                    </select>
                                    <small class="text-danger relation_with_emp_error"></small>
                                    @if($errors->has('relation_with_emp'))
                                    <span id="relation_with_emp-error"
                                        class="error text-danger invalid-feedback">{{ $errors->first('relation_with_emp') }}</span>
                                    <small></small>
                                    @endif
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="form-group">
                            <a class="btn btn-secondary m-1" href="{{ route('list.all.claims') }}">Back</a>

                            <input type="submit" name="save" value="Save" class="btn btn-primary">
                        </div>
                        <small class="text-muted"><strong>Note: </strong>Verify the details entered by you before
                            saving and proceeding with the form</small><br>
                        <small class="text-muted"><strong>नोट: </strong>फॉर्म को सेव और आगे बढ़ाने से पहले आपके
                            द्वारा भरी गई डिटेल्स की पुष्टि कर ले</small>
                    </div>
                </form>
            </div>
        </div>
        <!-- /.card -->
    </div>
    <!--/. container-fluid -->
</section>
<!-- /.content -->
@endsection

@push('js')
<script>
$('#claim_for').change(function() {
    checkClaim();
    // changeIntimationLabel();
});
$('#claim_for').ready(function() {
    checkClaim();
    // changeIntimationLabel();
});

function checkClaim() {
    let claim_for = $('#claim_for').find('option:selected').val();
    let claim_id = $('#claim_id').val();
    error_tag = $('.claim_for_error');
    let url = "{{ route('check.claim') }}";
    $.ajax({
        url: url,
        type: "GET",
        data: {
            claim_for: claim_for,
            claim_id: claim_id
        },
        dataType: "json",
        success: function(response) {
            if (response.status == 'success') {
                error_tag.text(response.message);
            }
        }
    });
}

// // Change Intimation date info label
// function changeIntimationLabel() 
// {
//     let claim_for = $('#claim_for').find('option:selected').val();
//     let claim_id = $('#claim_id').val();  
//     // define label
//     let label_for_wc_gpa = "(Intimation to Insurance Company)";
//     let label_for_epf = "(Intimation to EPF Department)";
//     let label_for_esi = "(Intimation to ESI Department)";
//     // get intimation tag
//     let intimation_info_tag = $(".intimation_date_info_label");
//     intimation_info_tag.text('');
//     if(claim_for == "") {
//         intimation_info_tag.text('');
//     } 
//     if(claim_for == 'EPF') {
//         intimation_info_tag.text(label_for_epf);
//     }
//     if(claim_for == 'ESI') {
//         intimation_info_tag.text(label_for_esi);
//     }
//     if(claim_for == 'WC') {
//         intimation_info_tag.text(label_for_wc_gpa);
//     }
//     if(claim_for == 'GPA') {
//         intimation_info_tag.text(label_for_wc_gpa);
//     }
// }

</script>

@endpush