<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title><?php echo e($serviceComplaint->id); ?></title>
    <style type="text/css" media="all">
        .bg-lightgray {
            background-color: #a0a0a0;
        }

        .bg-white {
            background-color: #fff;
        }

        .h3 {
            font-weight: normal;
        }

        .h4 {
            font-weight: normal;
        }

        .border {

            margin: 0px 0;
            font-size: 1em;
            font-family: sans-serif;
            min-width: 400px;
            margin: 0;
            line-height: 0.9;
            color: #212529;
            text-align: left;
            font-family: sans-serif;
            font-size: 12px;
            border: 1px;

        }

        .notes {

            margin: 0px 0;
            font-size: 1em;
            font-family: sans-serif;
            min-width: 400px;
            margin: 0;
            line-height: 1;
            color: #212529;
            text-align: left;
            font-family: sans-serif;
            font-size: 12px;

        }

        .border thead tr {
            background-color: #009879;
            color: #ffffff;
            text-align: left;
        }

        .border th,
        .border td {
            text-align: left;
            border: 1px;
            border-color: #000;

        }

        .border tbody tr {
            border-bottom: 0px solid #000000;
        }

        .border tbody tr:nth-of-type(even) {
            background-color: #f3f3f3;
        }

        .border tbody tr:last-of-type {
            border-bottom: 2px solid #009879;
        }

        .table {
            text-align: left;
            border: 1px;
            border-color: #000;
        }

        .page-break {
            page-break-after: always;
        }

        body {
            margin: 0;
            line-height: 1;
            color: #212529;
            text-align: left;
            font-family: sans-serif;
            font-size: 12px;

        }
    </style>
</head>

<body
    style="margin: 0;
            line-height: 1;
            color: #212529;
            text-align: left;
            font-family: sans-serif;
            font-size: 12px;">

    <div class="card">
        <div class="card-header">
            <table class="table table-bordered table-striped" width=100%>
                <tr>
                    <td width="25%"></td>
                    <td colspan="2">
                        <img width="100%"
                            src='data:image/png;base64, '>
                    </td>
                    <td align="right">
                        <img width="100%"
                            src='data:image/jpeg;base64, '>

                    </td>
                </tr>
                <tr>
                    <td width="25%"></td>
                    <td>
                        Plot no- 48, Queen Street,<br>
                        VGN Summerdale,PHASE-2,<br>Kovur, Chennai-600128
                    </td>
                    <td>E-Mail: serviceteam@fusionengg.in<br>
                        Service Help Line No: 91766 61387 / 91766 66883
                    </td>


                </tr>
            </table>

        </div>

        <table width=100% border="2px" border-color="black">
            <tr>
                <td><br><?php echo e(trans('cruds.serviceComplaint.fields.service_report_number')); ?>: <?php echo e($serviceComplaint->id); ?>

                </td>
                <td style="text-align: center;">
                    <h1> Field Service Report</h1>
                </td>
                <td colspan="3" style="text-align: right;">
                    <?php echo e(trans('cruds.serviceComplaint.fields.service_date')); ?>: <?php echo e($serviceComplaint->service_date); ?>

                </td>
            </tr>
            <tr>
                <td colspan="5" style="vertical-align: top;"><b>Customer Name and Address</b>
                    <br><br>
                    <?php echo e($serviceComplaint->client->company_name ?? ''); ?>

                    <br><br>
                    <?php echo e($serviceComplaint->client->company_address ?? ''); ?>

                    <br><br>
                    <?php echo e($serviceComplaint->client->company_email ?? ''); ?>

                    <br><br>

                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <!--- Equipment Details -->
                    <table width="100%">
                        <tr>
                            <th>Equipment Details</th>
                            <td><?php echo e(trans('cruds.serviceComplaint.fields.air_compressor')); ?></td>
                            <td><?php echo e(trans('cruds.serviceComplaint.fields.airdryer')); ?> </td>
                            <td><?php echo e(trans('cruds.serviceComplaint.fields.filter')); ?> </td>
                            <td><?php echo e(trans('cruds.serviceComplaint.fields.eco_drain')); ?> </td>
                            <td><?php echo e(trans('cruds.serviceComplaint.fields.air_receiver')); ?> </td>
                        </tr>

                        <tr>
                            <th>Model</th>

                            <td>
                                <?php if(isset($serviceComplaint->asset) && $serviceComplaint->asset->air_compressor_id): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->asset->air_compressor->name ?? ''); ?></span></span>
                                    <span class="part-number"><span
                                            class="text-success"><?php echo e($serviceComplaint->asset->air_compressor->model ?? ''); ?></span></span>
                                <?php elseif(isset($serviceComplaint->air_compressor_name)): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->air_compressor_name); ?></span></span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($serviceComplaint->dryer_asset) && isset($serviceComplaint->dryer_asset->airdryer)): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->dryer_asset->airdryer->name ?? ''); ?></span></span>
                                    <span class="part-number"><span
                                            class="text-success"><?php echo e($serviceComplaint->dryer_asset->airdryer->model ?? ''); ?></span></span>
                                <?php elseif(isset($serviceComplaint->air_dryer_name)): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->air_dryer_name); ?></span></span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($serviceComplaint->filter_asset) && isset($serviceComplaint->filter_asset->filter)): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->filter_asset->filter->name ?? ''); ?></span></span>
                                    <span class="part-number"><span
                                            class="text-success"><?php echo e($serviceComplaint->filter_asset->filter->model ?? ''); ?></span></span>
                                <?php elseif(isset($serviceComplaint->filter_name)): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->filter_name); ?></span></span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($serviceComplaint->ecodrain_asset) && isset($serviceComplaint->ecodrain_asset->eco_drain)): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->ecodrain_asset->eco_drain->name ?? ''); ?></span></span>
                                    <span class="part-number"><span
                                            class="text-success"><?php echo e($serviceComplaint->ecodrain_asset->eco_drain->model ?? ''); ?></span></span>
                                <?php elseif(isset($serviceComplaint->eco_drain_name)): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->eco_drain_name); ?></span></span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($serviceComplaint->receiver_asset) && isset($serviceComplaint->receiver_asset->air_receiver)): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->receiver_asset->air_receiver->name ?? ''); ?></span></span>
                                    <span class="part-number"><span
                                            class="text-success"><?php echo e($serviceComplaint->receiver_asset->air_receiver->model ?? ''); ?></span></span>
                                <?php elseif(isset($serviceComplaint->air_receiver_name)): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->air_receiver_name); ?></span></span>
                                <?php endif; ?>
                            </td>
                        </tr>

                        <tr>
                            <th>Part No</th>
                            <td>
                                <?php if(isset($serviceComplaint->asset) && $serviceComplaint->asset->air_compressor_part_no): ?>
                                    <span class="part-number"><span
                                            class="text-success"><?php echo e($serviceComplaint->asset->air_compressor_part_no); ?></span></span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($serviceComplaint->dryer_asset) && $serviceComplaint->dryer_asset->air_dryer_part_no): ?>
                                    <span class="part-number"><span
                                            class="text-success"><?php echo e($serviceComplaint->dryer_asset->air_dryer_part_no); ?></span></span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($serviceComplaint->filter_asset) && $serviceComplaint->filter_asset->filter_part_no): ?>
                                    <span class="part-number"><span
                                            class="text-success"><?php echo e($serviceComplaint->filter_asset->filter_part_no); ?></span></span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($serviceComplaint->ecodrain_asset) && $serviceComplaint->ecodrain_asset->eco_drain_part_no): ?>
                                    <span class="part-number"><span
                                            class="text-success"><?php echo e($serviceComplaint->ecodrain_asset->eco_drain_part_no); ?></span></span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($serviceComplaint->receiver_asset) && $serviceComplaint->receiver_asset->air_reciever_part_no): ?>
                                    <span class="part-number"><span
                                            class="text-success"><?php echo e($serviceComplaint->receiver_asset->air_reciever_part_no); ?></span></span>
                                <?php endif; ?>
                            </td>
                        </tr>

                        <tr>
                            <th>Serial No</th>
                            <td>
                                <?php if(isset($serviceComplaint->asset) && $serviceComplaint->asset->air_compressor_serial_no): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->asset->air_compressor_serial_no); ?></span></span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($serviceComplaint->dryer_asset) && $serviceComplaint->dryer_asset->airdryer_serial_no): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->dryer_asset->airdryer_serial_no); ?></span></span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($serviceComplaint->filter_asset) && $serviceComplaint->filter_asset->filter_serial_no): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->filter_asset->filter_serial_no); ?></span></span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($serviceComplaint->ecodrain_asset) && $serviceComplaint->ecodrain_asset->eco_drain_serial_no): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->ecodrain_asset->eco_drain_serial_no); ?></span></span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(isset($serviceComplaint->receiver_asset) && $serviceComplaint->receiver_asset->air_receiver_serial_no): ?>
                                    <span class="serial-number"><span
                                            class="text-primary"><?php echo e($serviceComplaint->receiver_asset->air_receiver_serial_no); ?></span></span>
                                <?php endif; ?>
                            </td>
                        </tr>

                        <tr>
                            <th>Running Hrs.</th>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1141): ?>
                                        <?php echo e($value['checklist_value_text_1']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1142): ?>
                                        <?php echo e($value['checklist_value_text_1']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1143): ?>
                                        <?php echo e($value['checklist_value_text_1']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1144): ?>
                                        <?php echo e($value['checklist_value_text_1']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1145): ?>
                                        <?php echo e($value['checklist_value_text_3']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                        </tr>

                        <tr>
                            <th>Load Hrs.</th>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1141): ?>
                                        <?php echo e($value['checklist_value_text_2']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1142): ?>
                                        <?php echo e($value['checklist_value_text_2']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1143): ?>
                                        <?php echo e($value['checklist_value_text_2']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1144): ?>
                                        <?php echo e($value['checklist_value_text_2']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1145): ?>
                                        <?php echo e($value['checklist_value_text_2']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                        </tr>

                        <tr>
                            <th>Mfg Year</th>
                            <td><?php echo e($serviceComplaint->asset->air_compressor->mfg_year ?? ''); ?></td>
                            <td><?php echo e($serviceComplaint->asset->airdryer->mfg_year ?? ''); ?></td>
                            <td><?php echo e($serviceComplaint->asset->filter->mfg_year ?? ''); ?></td>
                            <td><?php echo e($serviceComplaint->asset->eco_drain->mfg_year ?? ''); ?></td>
                            <td><?php echo e($serviceComplaint->asset->air_receiver->mfg_year ?? ''); ?></td>
                        </tr>

                        <tr>
                            <th>Motor Starts</th>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1146): ?>
                                        <?php echo e($value['checklist_value_text_1']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1146): ?>
                                        <?php echo e($value['checklist_value_text_2']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>

                            </td>
                            <td>

                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1146): ?>
                                        <?php echo e($value['Remarks']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                        </tr>

                        <tr>
                            <th>Load Value On</th>

                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1141): ?>
                                        <?php echo e($value['Remarks']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1142): ?>
                                        <?php echo e($value['Remarks']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1143): ?>
                                        <?php echo e($value['Remarks']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1144): ?>
                                        <?php echo e($value['Remarks']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td>
                                <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($value['checklist_name_id'] == 1145): ?>
                                        <?php echo e($value['Remarks']); ?>

                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                        </tr>
                        <tr>
                            <th>Start Up Date</th>

                            <td><?php echo e($serviceComplaint->asset->commisioned_date ?? ''); ?></td>
                            <td><?php echo e($serviceComplaint->asset->commisioned_date ?? ''); ?></td>
                            <td><?php echo e($serviceComplaint->asset->commisioned_date ?? ''); ?></td>
                            <td><?php echo e($serviceComplaint->asset->commisioned_date ?? ''); ?></td>
                            <td><?php echo e($serviceComplaint->asset->commisioned_date ?? ''); ?></td>
                        </tr>

                    </table>
                    <!--- Equipment Details -->
                </td>
            </tr>
            <tr>
                <td>
                    Visit: <?php echo e($serviceComplaint->visit_type->name ?? ''); ?>





                </td>
                <td colspan="2"> Nature of the Problem: <?php echo e(Str::before($serviceComplaint->complaint, '#')); ?></td>
            </tr>


        </table>



        <br><br>

        <!-- Checklist Include -->

        <?php if ($__env->exists('admin.serviceComplaints.relationships.complaintChecklistReportsPDF', [
            'checklistReports' => $serviceComplaint->complaintChecklistReports,
        ])) echo $__env->make('admin.serviceComplaints.relationships.complaintChecklistReportsPDF', [
            'checklistReports' => $serviceComplaint->complaintChecklistReports,
        ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

        <!-- Checklist Include -->
        <br>
        <!-- Bottom Tables Start -->
        <table class="table table-bordered table-striped" width=100% border="2px" border-color="black">
            <tr>
                <td>
                    <!-- Guidelines -->
                    Guidelines For Performance Improvement Work Remarks:
                    <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($value['checklist_name_id'] == 1199): ?>
                            <?php echo e($value['checklist_value_text_1']); ?> <?php echo e($value['checklist_value_text_2']); ?>

                            <?php echo e($value['Remarks']); ?>

                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </td>
                <td>
                    <!-- Customer Remarks -->
                    Customer Remarks
                    <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($value['checklist_name_id'] == 1200): ?>
                            <?php echo e($value['checklist_value_text_1']); ?> <?php echo e($value['checklist_value_text_2']); ?>

                            <?php echo e($value['Remarks']); ?>

                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </td>
            </tr>
        </table>

        <br><br>
        <table class="table table-bordered table-striped" width=100% border="2px" border-color="black">
            <tr>
                <td colspan="3">List of Spare Parts Consumed</td>
                <td colspan="2">List of Spare Required for Next Visit</td>
                <td>Required Date:
                    <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($value['checklist_name_id'] == 1197): ?>
                            <?php echo e($value['checklist_value_text_1']); ?>

                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </td>
            </tr>
            <tr>
                <td>Consumed Parts Description</td>
                <td>Part No</td>
                <td>Qty</td>
                <td>Required Parts Description</td>
                <td>Part Number</td>
                <td>Qty </td>
            </tr>
            <?php
                $consumedParts = [];
                $requiredParts = [];

                // Collect consumed parts data and split by comma
                foreach ($serviceComplaint->complaintChecklistReports as $key => $value) {
                    if ($value['checklist_name_id'] == 1195) {
                        $descriptions = explode(',', $value['checklist_value_text_1']);
                        $partNos = explode(',', $value['checklist_value_text_2']);
                        $quantities = explode(',', $value['Remarks']);

                        // Trim whitespace and create individual parts
                        for ($j = 0; $j < count($descriptions); $j++) {
                            $consumedParts[] = [
                                'description' => trim($descriptions[$j] ?? ''),
                                'part_no' => trim($partNos[$j] ?? ''),
                                'qty' => trim($quantities[$j] ?? ''),
                            ];
                        }
                    }
                }

                // Collect required parts data and split by comma
                foreach ($serviceComplaint->complaintChecklistReports as $key => $value) {
                    if ($value['checklist_name_id'] == 1196) {
                        $descriptions = explode(',', $value['checklist_value_text_1']);
                        $partNos = explode(',', $value['checklist_value_text_2']);
                        $quantities = explode(',', $value['Remarks']);

                        // Trim whitespace and create individual parts
                        for ($j = 0; $j < count($descriptions); $j++) {
                            $requiredParts[] = [
                                'description' => trim($descriptions[$j] ?? ''),
                                'part_no' => trim($partNos[$j] ?? ''),
                                'qty' => trim($quantities[$j] ?? ''),
                            ];
                        }
                    }
                }

                $maxRows = max(count($consumedParts), count($requiredParts));
            ?>

            <?php for($i = 0; $i < $maxRows; $i++): ?>
                <tr>
                    <td>
                        <?php echo e(isset($consumedParts[$i]) ? $consumedParts[$i]['description'] : ''); ?>

                    </td>
                    <td>
                        <?php echo e(isset($consumedParts[$i]) ? $consumedParts[$i]['part_no'] : ''); ?>

                    </td>
                    <td>
                        <?php echo e(isset($consumedParts[$i]) ? $consumedParts[$i]['qty'] : ''); ?>

                    </td>
                    <td>
                        <?php echo e(isset($requiredParts[$i]) ? $requiredParts[$i]['description'] : ''); ?>

                    </td>
                    <td>
                        <?php echo e(isset($requiredParts[$i]) ? $requiredParts[$i]['part_no'] : ''); ?>

                    </td>
                    <td>
                        <?php echo e(isset($requiredParts[$i]) ? $requiredParts[$i]['qty'] : ''); ?>

                    </td>
                </tr>
            <?php endfor; ?>
        </table>

        <br><br>
        <table class="table table-bordered table-striped" width=100% border="2px" border-color="black">
            <tr>
                <td>Start of Work</td>
                <td>End of Work</td>
                <td>Travel Time</td>
                <td>Travel Km</td>
                <td>Date</td>
                <td>Technician Name</td>
                <td>Customer Contact Person</td>
            </tr>
            <tr>
                <td>
                    <!-- Consumed Parts Description -->
                    <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($value['checklist_name_id'] == 1191): ?>
                            <?php echo e($value['checklist_value_text_1']); ?>

                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </td>
                <td>
                    <!-- Part No -->
                    <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($value['checklist_name_id'] == 1192): ?>
                            <?php echo e($value['checklist_value_text_1']); ?>

                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </td>
                <td>
                    <!-- Qty -->

                    <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($value['checklist_name_id'] == 1193): ?>
                            <?php echo e($value['checklist_value_text_1']); ?>

                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </td>
                <td>
                    <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($value['checklist_name_id'] == 1194): ?>
                            <?php echo e($value['checklist_value_text_1']); ?>

                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </td>
                <td>

                    <!-- Date --><?php echo e($serviceComplaint->service_date); ?>


                </td>
                <td>
                    <!-- Technician Name  -->
                    <?php echo e($serviceComplaint->enginner_assigned->name ?? ''); ?>

                </td>
                <td>
                    <!-- Customer Contact  -->
                    Contact Person: <?php echo e($serviceComplaint->location->contact_first_name ?? ''); ?>


                    <br><br>
                    Mobile: <?php echo e($serviceComplaint->location->contact_phone_1 ?? ''); ?>

                    <br><br>
                    Email: <?php echo e($serviceComplaint->client->company_email ?? ''); ?>

                </td>
            </tr>
        </table>


        <br><br>
        <table class="table table-bordered table-striped" width=100% border="2px" border-color="black">
            <tr>
                <td>Next Action</td>
                <td>Comlpaint Status</td>

            </tr>
            <tr>
                <td>
                    <!-- Next Action -->
                    <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($value['checklist_name_id'] == 1198): ?>
                            <?php echo e($value['checklist_value_text_1']); ?><?php echo e($value['checklist_value_text_2']); ?><?php echo e($value['Remarks']); ?>

                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </td>
                <td>
                    <!-- Comlpaint Status Name -->
                    <?php echo e($serviceComplaint->status->name ?? ''); ?>

                </td>



            </tr>
        </table>

        <br><br>

        <!-- Signature Table -->

        <table class="table table-bordered table-striped" width=100% border="2px" border-color="black">
            <tr>
                <td>Work Done</td>
                <td>Work Accepted</td>
            </tr>
            <tr>
                <td>
                    <!-- Work Done -->
                    <?php if($serviceComplaint->status->name == 'Yes'): ?>
                        Yes
                    <?php else: ?>
                        No
                    <?php endif; ?>
                    <br><br>
                    <img class="" src="<?php echo e($user_sign[0] ?? ''); ?>" width="100" height="50" alt="photo">

                </td>
                <td>
                    <?php $__currentLoopData = $serviceComplaint->complaintChecklistReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($value['checklist_name_id'] == 1201): ?>
                            <img class="" src="<?php echo e($value['Remarks'] ?? ''); ?>" width="40" alt="photo">
                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </td>
            </tr>
            <tr>
                <td>Technician Signature</td>
                <td>Customer Signature</td>
            </tr>
        </table>

        <!-- Signature Table -->

        <!-- Complaint Status Close -->

        <!-- Complaint Status Close -->



        <!-- Office User Only Table -->



        <table class="table table-bordered table-striped" width=100% border="2px" border-color="black">
            <tr>
                <td colspan="4">Office Use Only</td>
            </tr>
            <tr>
                <td>
                    <!-- Work Done -->
                    Report Verified:
                    <?php if($serviceComplaint->status->name == 'Yes'): ?>
                        Yes
                    <?php else: ?>
                        No
                    <?php endif; ?>
                    <br><br>
                </td>
                <td colspan="3"><br><br>
                    Verified By: <?php echo e($serviceComplaint->supervisor_assigned->name ?? ''); ?>

                </td>
            </tr>
        </table>




</body>

</html>
<?php /**PATH /home/newrhytha2/public_html/sfm.fusionengg.in/resources/views/admin/serviceComplaints/createcomplaintpdf.blade.php ENDPATH**/ ?>