nhance/app/Views/rfq/claims_details_non_eb.php
2025-06-06 17:50:02 +05:30

63 lines
4.0 KiB
PHP

<?php if(isset($lead_edit_data)) {
$claims = !empty($lead_edit_data['fin_years_claims_array']) ? $lead_edit_data['fin_years_claims_array'] : [ ['year' => '', 'claim_amount' => '', 'status' => '', 'claim_type' => '', 'cause_of_death' => '', 'death_date' => ''] ];
?>
<div class="custom-control custom-switch">
<input type="checkbox" onchange="claimHistoryToggle()" class="custom-control-input" id="claim_history" name="claim_history" <?= $lead_edit_data['claim_history'] == 1 ? "checked" : "" ?> />
<label class="custom-control-label" for="claim_history">Claims History</label>
</div><br>
<?php
if ($lead_edit_data['claim_history'] == 1) {
foreach ($claims as $key => $value) { ?>
<div class="row claim-row">
<div class="form-group col-md-2">
<label for="first_year">Year<span class="text-danger">*</span></label>
<select class="form-control first_year_" id="first_year" name="first_year[]">
<option value="">Select Year</option>
<?php foreach ($lastFiveYears as $year) {
$selected = ($year == $value['year']) ? 'selected' : '';
echo "<option value='$year' $selected>$year</option>";
} ?>
</select>
</div>
<div class="form-group col-md-2">
<label for="first_policy_type_${increment}">Policy Type<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_policy_type_${increment}" name="first_policy_type_[]"
value="<?= htmlspecialchars($value['policy_type']) ?>">
</div>
<div class="form-group col-md-2">
<label for="first_date_of_loss_${increment}">Date of Loss<span class="text-danger">*</span></label>
<input type="text" class="form-control loss_date" id="first_date_of_loss_${increment}" name="first_date_of_loss_[]"
value="<?= htmlspecialchars($value['date_of_loss']) ?>">
</div>
<div class="form-group col-md-2">
<label for="first_cause_of_death_${increment}">Cause Of Loss <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_cause_of_loss_${increment}" name="first_cause_of_loss[]"
value="<?= htmlspecialchars($value['cause_of_loss']) ?>">
</div>
<div class="form-group col-md-2">
<label for="first_claim_amount_${increment}">Claim Amount<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_claim_amount_${increment}" name="first_claim_amount[]"
value="<?= htmlspecialchars($value['claim_amount']) ?>">
</div>
<div class="form-group col-md-2">
<label for="first_claim_amount_${increment}">Settled Amount<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_settled_amount_${increment}" name="first_settled_amount[]"
value="<?= htmlspecialchars($value['settled_amount']) ?>">
</div>
<div class="form-group col-md-2">
<label for="first_claim_status_${increment}">Claim Status<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_claim_status_${increment}" name="first_claim_status[]"
value="<?= htmlspecialchars($value['status']) ?>">
</div>
<div class="form-group col-md-2">
<div class="" style="position: relative; top: 28px; float: right; text-align: end;">
<a class="btn btn-danger waves-effect waves-light" onclick="removeClaim(this)">x</a>
<a class="btn btn-primary waves-effect waves-light mr-1" onclick="appendThreeYearsClaims()">+</a>
</div>
</div>
</div>
<?php } } ?>
<?php } ?>