<?php $__env->startSection('title','Edit Claim| '); ?>
<?php $__env->startSection('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">Edit Claim</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">
    <a class="btn btn-primary m-1" href="<?php echo e(route('list.all.claims')); ?>">Back</a>

        <div class="card card-default">
            <div class="card-header">
                <h3 class="card-title">Edit Claim</h3>
            </div>
            <!-- /.card-header -->
            <div class="card-body">
                <?php if(session('success')): ?>
                <div class="alert alert-success alert-dismissible fade show" role="alert">
                    <strong><?php echo e(session('success')); ?></strong>
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <?php endif; ?>
                <?php if(session('error')): ?>
                <div class="alert alert-danger alert-dismissible fade show" role="alert">
                    <strong><?php echo e(session('error')); ?></strong>
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <?php endif; ?>
                <?php if(session('warning')): ?>
                <div class="alert alert-warning alert-dismissible fade show" role="alert">
                    <strong><?php echo e(session('warning')); ?></strong>
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <?php endif; ?>
               
                <?php if(!empty($claim_data)): ?>
                <form id="claimEditForm" action="<?php echo e(route('update.claim.info')); ?>" method="post" autocomplete="off">
                    <?php echo csrf_field(); ?>
                    <input type="hidden" name="claim_id" value="<?php echo e($claim_data->claim_id); ?>">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="emp_id">Employee ID</label>
                                <input type="number" name="emp_id"
                                    class="form-control   <?php if( $errors->has('emp_id')): ?> is-invalid border-danger  <?php endif; ?>"
                                    value="<?php echo e($claim_data->emp_id); ?>" id="emp_id" placeholder="Employee ID">
                                <small class="text-danger emp_id_error"></small>
                                <?php if($errors->has('emp_id')): ?>
                                <span id="emp_id-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('emp_id')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="emp_name">Employee Name</label>
                                <input type="text" name="emp_name"
                                    class="form-control   <?php if( $errors->has('emp_name')): ?> is-invalid border-danger  <?php endif; ?>"
                                    value="<?php echo e($claim_data->emp_name); ?>" id="emp_name" placeholder="Employee Name">
                                <?php if($errors->has('emp_name')): ?>
                                <span id="emp_name-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('emp_name')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="emp_mobile">Mobile</label>
                                <input type="number" name="emp_mobile"
                                    class="form-control <?php if( $errors->has('emp_mobile')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="emp_mobile" value="<?php echo e($claim_data->emp_mobile); ?>" placeholder="Mobile Number">
                                <?php if($errors->has('emp_mobile')): ?>
                                <span id="emp_mobile-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('emp_mobile')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="emp_department">Department</label>
                                <select name="emp_department"
                                    class="custom-select form-control reset_form <?php if( $errors->has('emp_department')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="emp_department">
                                    <option value="">Select departments</option>
                                    <?php if($departments->count() > 0): ?>
                                    <?php $__currentLoopData = $departments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $department): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($department->department_master_id); ?>"
                                        <?php if($claim_data->department_id ==$department->department_master_id): ?>
                                        <?php echo e(__('selected')); ?>

                                        <?php endif; ?>><?php echo e($department->department_name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php endif; ?>
                                </select>
                                <small class="text-danger department_error"></small>
                                <?php if($errors->has('emp_department')): ?>
                                <span id="emp_department-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('emp_department')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="scheme">Scheme</label>
                                <select name="scheme"
                                    class="custom-select form-control reset_form <?php if( $errors->has('scheme')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="scheme">
                                    <option value="">Select Scheme</option>
                                </select>
                                <small class="text-danger scheme_error"></small>
                                <?php if($errors->has('scheme')): ?>
                                <span id="scheme-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('scheme')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="emp_division">Division</label>
                                <select name="emp_division"
                                    class="custom-select form-control reset_form <?php if( $errors->has('emp_division')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="emp_division">
                                    <option value="">Select Division</option>
                                </select>
                                <small class="text-danger emp_division_error"></small>
                                <?php if($errors->has('emp_division')): ?>
                                <span id="emp_division-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('emp_division')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="emp_posting_place">Posting Place</label>
                                <select name="emp_posting_place"
                                    class="custom-select form-control reset_form <?php if( $errors->has('emp_posting_place')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="emp_posting_place">
                                    <option value="">Select Posting Place</option>

                                </select>
                                <small class="text-danger emp_posting_place_error"></small>
                                <?php if($errors->has('emp_posting_place')): ?>
                                <span id="emp_posting_place-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('emp_posting_place')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="date_of_joining">Date of Joining</label>
                                <input type="date" name="date_of_joining"
                                    class="form-control <?php if( $errors->has('date_of_joining')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="date_of_joining" value="<?php echo e($claim_data->date_of_joining); ?>" placeholder="Date"
                                    max="<?php echo e(date('Y-m-d')); ?>">
                                <?php if($errors->has('date_of_joining')): ?>
                                <span id="date_of_joining-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('date_of_joining')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="father_husband_name">Father/Husband's Name</label>
                                <input type="text" name="father_husband_name"
                                    class="form-control <?php if( $errors->has('father_husband_name')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="father_husband_name" value="<?php echo e($claim_data->father_husband_name); ?>"
                                    placeholder="Father/Husaband's Name">
                                <?php if($errors->has('father_husband_name')): ?>
                                <span id="father_husband_name-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('father_husband_name')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="relation_type">Relation Type</label>
                                <select name="relation_type"
                                    class="custom-select form-control reset_form <?php if( $errors->has('relation_type')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="relation_type">
                                    <option value="">Select Relation Type</option>
                                    <option value="1" <?php echo e(($claim_data->relation_type == '1') ? 'selected' : ''); ?>>Father</option>
                                    <option value="2" <?php echo e(($claim_data->relation_type == '2') ? 'selected' : ''); ?>>Husband</option>
                                </select>
                                <small class="text-danger relation_type_error"></small>
                                <?php if($errors->has('relation_type')): ?>
                                <span id="relation_type-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('relation_type')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="aadhar_number">Aadhar Number</label>
                                <input type="number" name="aadhar_number"
                                    class="form-control <?php if( $errors->has('aadhar_number')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="aadhar_number" value="<?php echo e($claim_data->aadhar_number); ?>" placeholder="Aadhar Number">
                                <small class="text-danger aadhar_error"></small>
                                <?php if($errors->has('aadhar_number')): ?>
                                <span id="aadhar_number-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('aadhar_number')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="claim_type">Claim Type</label>
                                <select name="claim_type"
                                    class="custom-select form-control reset_form <?php if( $errors->has('claim_type')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="claim_type">
                                    <option value="" <?php echo e(($claim_data->claim_type == '') ? 'selected' : ''); ?>>Select Claim Type</option>
                                    <option value="1" <?php echo e(($claim_data->claim_type == 1) ? 'selected' : ''); ?>>Death</option>
                                    <option value="2" <?php echo e(($claim_data->claim_type == 2) ? 'selected' : ''); ?>>Accident</option>
                                </select>
                                <small class="text-danger claim_type_error"></small>
                                <?php if($errors->has('claim_type')): ?>
                                <span id="claim_type-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('claim_type')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6 for_death hide_for_accident">
                            <div class="form-group">
                                <label for="date_of_death">Date of Death</label>
                                <input type="date" name="date_of_death"
                                    class="form-control  <?php if( $errors->has('date_of_death')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="date_of_death" value="<?php echo e($claim_data->death_date); ?>" max="<?php echo e(date('Y-m-d')); ?>">
                                <?php if($errors->has('date_of_death')): ?>
                                <span id="date_of_death-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('date_of_death')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6 for_death hide_for_accident">
                            <div class="form-group">
                                <label for="cause_of_death">Cause of Death</label>
                                <input type="text" name="cause_of_death"
                                    class="form-control <?php if( $errors->has('cause_of_death')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="cause_of_death" value="<?php echo e($claim_data->cause_of_death); ?>"
                                    placeholder="Cause of Death">
                                <?php if($errors->has('cause_of_death')): ?>
                                <span id="cause_of_death-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('cause_of_death')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6 for_both">
                            <div class="form-group">
                                <label for="date_of_accident">Date of Accident</label>
                                <input type="date" name="date_of_accident"
                                    class="form-control <?php if( $errors->has('date_of_accident')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="date_of_accident" value="<?php echo e($claim_data->accident_date); ?>"
                                    max="<?php echo e(date('Y-m-d')); ?>">
                                <?php if($errors->has('date_of_accident')): ?>
                                <span id="date_of_accident-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('date_of_accident')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6 for_both">
                            <div class="form-group">
                                <label for="accident_time">Time of Accident <small class="text-muted">(24 Hours)</small></label>
                                <input type="time" name="accident_time"
                                    class="form-control <?php if( $errors->has('accident_time')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="accident_time" value="<?php echo e($claim_data->accident_time); ?>"
                                    max="<?php echo e(date('Y-m-d')); ?>">
                                <?php if($errors->has('accident_time')): ?>
                                <span id="accident_time-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('accident_time')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6 for_both">
                            <div class="form-group">
                                <label for="accident_place">Accident Place</label>
                                <input type="text" name="accident_place"
                                    class="form-control <?php if( $errors->has('accident_place')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="accident_place" value="<?php echo e($claim_data->accident_place); ?>"
                                    placeholder="Accident Place">
                                <?php if($errors->has('accident_place')): ?>
                                <span id="accident_place-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('accident_place')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6 for_both">
                            <div class="form-group">
                                <label for="shift_start_time">Shift Start Time <small class="text-muted">(24 Hours)</small></label>
                                <input type="time" name="shift_start_time"
                                    class="form-control <?php if( $errors->has('shift_start_time')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="shift_start_time" value="<?php echo e($claim_data->shift_start_time); ?>"
                                    placeholder="Shift Start Time">
                                <?php if($errors->has('shift_start_time')): ?>
                                <span id="shift_start_time-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('shift_start_time')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6 for_both">
                            <div class="form-group">
                                <label for="shift_end_time">Shift End Time <small class="text-muted">(24 Hours)</small></label>
                                <input type="time" name="shift_end_time"
                                    class="form-control <?php if( $errors->has('shift_end_time')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="shift_end_time" value="<?php echo e($claim_data->shift_end_time); ?>"
                                    placeholder="Shift Start Time">
                                <?php if($errors->has('shift_end_time')): ?>
                                <span id="shift_end_time-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('shift_end_time')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6 for_both">
                            <div class="form-group">
                                <label for="permanent_disability">Permanent Disability<small class="text-muted">(Accidental body part)</small></label>
                                <select name="permanent_disability[]" multiple="multiple"
                                    class="custom-select select2 form-control reset_form <?php if( $errors->has('permanent_disability')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="permanent_disability" data-placeholder="Select  Disability" style="width: 100%;">
                                    <?php $disabilities = loadPermanentDisability(); ?>
                                    <?php $__currentLoopData = $disabilities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($key); ?>" <?php echo e((in_array($key, explode(',',$claim_data->accidental_body_part)) ? "selected":"")); ?>><?php echo e($value); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <?php if($errors->has('permanent_disability')): ?>
                                <span id="permanent_disability-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('permanent_disability')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-6 for_both">
                            <div class="form-group">
                                <label for="accident_info">Accident Info</label>
                                <input type="text" name="accident_info"
                                    class="form-control <?php if( $errors->has('accident_info')): ?> is-invalid border-danger  <?php endif; ?>"
                                    id="accident_info" value="<?php echo e($claim_data->accident_info); ?>"
                                    placeholder="Accident Details">
                                <?php if($errors->has('accident_info')): ?>
                                <span id="accident_info-error"
                                    class="error text-danger invalid-feedback"><?php echo e($errors->first('accident_info')); ?></span>
                                <small></small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-12 for_both">
                            <div class="form-group">
                                <label for="document_for_claim">Document required for 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 for_death hide_for_accident">
                                    <input class="custom-control-input" name="death_intimation_letter" value="1" type="checkbox" id="death_intimation_letter" <?php echo e(($claim_data->death_intimation_letter == '1') ? 'checked' : ''); ?> >
                                    <label for="death_intimation_letter" class="custom-control-label">Death Intimation
                                        Letter</label>
                                </div>
                                <div class="custom-control custom-checkbox for_both">
                                    <input class="custom-control-input" name="claimant_statement" value="1" type="checkbox" id="claimant_statement" <?php echo e(($claim_data->claimant_statement == '1') ? 'checked' : ''); ?> >
                                    <label for="claimant_statement" class="custom-control-label">Claimant's
                                        Statement</label>
                                </div>
                                <div class="custom-control custom-checkbox for_death hide_for_accident">
                                    <input class="custom-control-input" name="death_certificate" value="1" type="checkbox" id="death_certificate" <?php echo e(($claim_data->death_certificate == '1') ? 'checked' : ''); ?> >
                                    <label for="death_certificate" class="custom-control-label">Original Death
                                        Certificate from Birth & death registrar office</label>
                                </div>
                                <div class="custom-control custom-checkbox for_both">
                                    <input class="custom-control-input" name="age_proof" value="1" type="checkbox" id="age_proof" <?php echo e(($claim_data->age_proof == '1') ? 'checked' : ''); ?> >
                                    <label for="age_proof" class="custom-control-label">Proof of Standard Age. </label>
                                </div>
                                <div class="custom-control custom-checkbox for_both">
                                    <input class="custom-control-input" name="fir_report" value="1" type="checkbox" id="fir_report" <?php echo e(($claim_data->fir_report == '1') ? 'checked' : ''); ?> >
                                    <label for="fir_report" class="custom-control-label">FIR Report</label>
                                </div>
                                <div class="custom-control custom-checkbox for_death hide_for_accident">
                                    <input class="custom-control-input" name="post_mortem_report" value="1" type="checkbox" id="post_mortem_report" <?php echo e(($claim_data->post_mortem_report == '1') ? 'checked' : ''); ?> >
                                    <label for="post_mortem_report" class="custom-control-label">POST Mortem
                                        Report</label>
                                </div>
                                <div class="custom-control custom-checkbox for_both">
                                    <input class="custom-control-input" name="employer_certificate" value="1" type="checkbox" id="employer_certificate" <?php echo e(($claim_data->employer_certificate == '1') ? 'checked' : ''); ?> >
                                    <label for="employer_certificate" class="custom-control-label">Employer
                                        Certificate</label>
                                </div>
                                <div class="form-group for_both">
                                    <div class="col-md-6">
                                        <label for="age_proof_doc">Age Proof Document. eg. passport, birth certificate
                                            etc</label>
                                        <select name="age_proof_doc"
                                            class="custom-select form-control reset_form <?php if( $errors->has('age_proof_doc')): ?> is-invalid border-danger  <?php endif; ?>"
                                            id="age_proof_doc">
                                            <option value="">Select Age Proof Document</option>
                                            <?php $ageDocs = loadAgeProofDoc(); ?>
                                            <?php $__currentLoopData = $ageDocs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ageProof): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($ageProof); ?>" <?php echo e(($claim_data->age_proof_doc == $ageProof) ? 'selected' : ''); ?> ><?php echo e($ageProof); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                        <small class="text-danger relation_type_error"></small>
                                    </div>
                                </div>
                                <?php if($errors->has('death_intimation_letter') || $errors->has('claimant_statement') || $errors->has('death_certificate') || $errors->has('age_proof') || $errors->has('fir_report') || $errors->has('post_mortem_report') || $errors->has('employer_certificate') || $errors->has('age_proof_doc')): ?>
                                <small class="text-danger">All the above documents are required for claim</small>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-12">
                            <div class="form-group">
                                <input type="submit" name="update" value="Update Claim Details" 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>
                    </div>
                </form>
                <?php else: ?>
                    <div class="row">
                        <div class="col-md-12 col-lg-12 col-sm-12 mb-2">
                            <p class="p-0 m-0 text-secondary border-muted">
                                <strong>No Record Found</strong>
                            </p>
                        </div>
                    </div>
                <?php endif; ?>
            </div>
        </div>
        <!-- /.card -->
    </div>
    <!--/. container-fluid -->
</section>
<!-- /.content -->
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/claim_and_case_management/resources/views/pages/claims/editClaim.blade.php ENDPATH**/ ?>