1
0
forked from poc/pds
Files
poc-pds1/resources/views/exports/export-isi-three-phase-pdf.blade.php
2025-06-02 13:06:06 +05:30

202 lines
7.1 KiB
PHP

<!DOCTYPE html>
<html>
<head>
<style>
@page { size: A4 landscape; margin: 30px 8px 8px 8px; }
body {
font-family: Arial, sans-serif;
font-size: 8px;
counter-reset: page;
}
.page-number {
position: fixed;
top: -15px;
right: 0;
font-size: 10px;
}
.page-number:after {
content: "Page " counter(page);
}
.data-table {
width: 100%;
border-collapse: collapse;
margin-top: 6px;
}
.data-table th, .data-table td {
border: 1px solid #222;
padding: 2px;
text-align: center;
font-size: 7px;
}
thead { display: table-header-group; }
.company-title { font-size: 16px; font-weight: bold; text-align: center; }
.company-subtitle { font-size: 12px; text-align: center; }
.company-address { font-size: 10px; text-align: center; }
.register-title { font-size: 12px; font-weight: bold; text-align: center; }
</style>
</head>
<body>
<div class="page-number"></div>
<table class="data-table">
<tr>
<td colspan="24" style="padding:0;">
<table width="100%" style="border-collapse:collapse;">
<tr>
<td style="width:13%; text-align:left; border:none; border-bottom:1px solid #222;">
<img src="{{ public_path('images/cripumps.logo.png') }}" alt="Logo" height="45" style="position: relative; left: 5mm;">
</td>
<td style="width:74%; border:none; border-bottom:1px solid #222;">
<div class="company-title">C.R.I. Pumps Private Limited</div>
<div class="company-subtitle">Unit : {{ $plant?->name ?? '' }}</div>
<div class="company-address">{{ $plant?->address ?? '' }}</div>
<div class="register-title">MOTOR FREE RUN TEST REGISTER</div>
</td>
@php
$showIsiLogo = $records->every(fn ($record) => $record['isi_model']);
@endphp
<td style="width:13%; text-align:right; border:none; border-bottom:1px solid #222;">
@if ($showIsiLogo)
<img src="{{ public_path('images/isi_logo1.PNG') }}" alt="ISI Logo" height="35" style="position: relative; left: -20mm;">
@endif
</td>
</tr>
<tr>
@php
$uniqueItemCodes = $records->pluck('Item Code')->unique();
$kw = $hp = $phase = '-';
if ($uniqueItemCodes->count() === 1) {
$firstRecord = $records->first();
$kw = $firstRecord['kw'] ?? '-';
$hp = $firstRecord['hp'] ?? '-';
$phase = $firstRecord['phase'] ?? '-';
}
@endphp
<td colspan="3" style="text-align:left; font-size:10px; font-weight:bold; border:none; padding-left:230mm;">
MOTOR KW / HP : {{ $kw }} / {{ $hp }} and PHASE : {{ $phase }}
</td>
</tr>
</table>
</td>
</tr>
<thead>
<!-- Row 1: Main Group Headings -->
<tr>
{{-- <th rowspan="4">Date</th> --}}
<th rowspan="4" style="width: 40px; white-space: nowrap;">Date</th>
<th rowspan="4">Motor SNo</th>
<th rowspan="4">Item Code</th>
<th rowspan="4">Motor Type</th>
<th colspan="12">AFTER FREE RUN</th>
<th colspan="3">LOCKED ROTOR TEST</th>
<th rowspan="4">No Load Pickup Voltage</th>
<th rowspan="4">Room Temp.</th>
<th rowspan="4">High Voltage Test</th>
<th rowspan="4">Result</th>
<th rowspan="4">Remark</th>
</tr>
<!-- Row 2: AFTER FREE RUN main columns -->
<tr>
<th rowspan="2">Voltage</th>
<th rowspan="2">Current</th>
<th rowspan="2">Power</th>
<th colspan="3">IR.Hot</th>
<th colspan="3">IR.Cool</th>
<th rowspan="2">Frequency</th>
<th rowspan="2">Speed</th>
<th rowspan="2">Leakage Current</th>
<!-- LOCKED ROTOR TEST -->
<th rowspan="2">Voltage</th>
<th rowspan="2">Current</th>
<th rowspan="2">Power</th>
</tr>
<!-- Row 3: Sub-columns for IR.Hot and IR.Cool -->
<tr>
<th>R</th>
<th>Y</th>
<th>B</th>
<th>R</th>
<th>Y</th>
<th>B</th>
</tr>
<!-- Row 4: Units -->
<tr>
<td>(V)</td> <!-- Voltage -->
<td>(A)</td> <!-- Current -->
<td>(W)</td> <!-- Power -->
<td>(Ohm)</td> <!-- IR.Hot R -->
<td>(Ohm)</td> <!-- IR.Hot Y -->
<td>(Ohm)</td> <!-- IR.Hot B -->
<td>(Ohm)</td> <!-- IR.Cool R -->
<td>(Ohm)</td> <!-- IR.Cool Y -->
<td>(Ohm)</td> <!-- IR.Cool B -->
<td>(Hz)</td> <!-- Frequency -->
<td>(Rpm)</td> <!-- Speed -->
<td>(mA)</td> <!-- Leakage Current -->
<td>(V)</td> <!-- Locked Voltage -->
<td>(A)</td> <!-- Locked Current -->
<td>(W)</td> <!-- Locked Power -->
</tr>
</thead>
@foreach($records as $record)
<tr>
{{-- COMMON FIELDS --}}
<td>{{ $record['Date'] ?? '' }}</td>
<td>{{ $record['Motor SNo'] ?? '' }}</td>
<td>{{ $record['Item Code'] ?? '' }}</td>
<td>{{ $record['Motor Type'] ?? '' }}</td>
{{-- AFTER FREE RUN --}}
<td>{{ $record['Voltage_After'] ?? '' }}</td>
<td>{{ $record['Current_After'] ?? '' }}</td>
<td>{{ $record['Power_After'] ?? '' }}</td>
{{-- IR Hot: R, Y, B --}}
<td>{{ $record['IR_Hot_R'] ?? '' }}</td>
<td>{{ $record['IR_Hot_Y'] ?? '' }}</td>
<td>{{ $record['IR_Hot_B'] ?? '' }}</td>
{{-- IR Cool: R, Y, B --}}
<td>{{ $record['IR_Cool_R'] ?? '' }}</td>
<td>{{ $record['IR_Cool_Y'] ?? '' }}</td>
<td>{{ $record['IR_Cool_B'] ?? '' }}</td>
<td>{{ $record['Frequency_After'] ?? '' }}</td>
<td>{{ $record['Speed_After'] ?? '' }}</td>
<td>{{ $record['Leakage_Current'] ?? '' }}</td>
{{-- LOCKED ROTOR TEST --}}
<td>{{ $record['Voltage_Locked'] ?? '' }}</td>
<td>{{ $record['Current_Locked'] ?? '' }}</td>
<td>{{ $record['Power_Locked'] ?? '' }}</td>
{{-- OTHER FIELDS --}}
<td>{{ $record['No_Load_Pickup_Voltage'] ?? '' }}</td>
<td>{{ $record['Room_Temp'] ?? '' }}</td>
<td>{{ $record['High_Voltage_Test'] ?? '' }}</td>
<td>{{ $record['Result'] ?? '' }}</td>
<td>{{ $record['Remark'] ?? '' }}</td>
</tr>
@endforeach
</table>
</body>
</html>