ispt4.0_laravel/resources/views/projectsClients/showAllEquipmentsInProjectQrCodePdf.blade.php
2025-03-12 12:02:15 +00:00

301 lines
15 KiB
PHP
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
@page {
margin-top: 15mm;
margin-bottom: 15mm;
margin-left: 15mm;
margin-right: 15mm;
}
.card-layout {
margin-top: 10px;
font-size: 10px;
/* width: 80mm;
height: 45mm; */
width: 115mm;
height: 58mm;
display: flex;
flex-direction: column;
/* Organiza os filhos verticalmente */
border: 1px solid black;
}
.card-header {
flex-basis: 40%;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
padding: 0;
}
.title-card {
display: flex;
flex-direction: column;
height: 100%;
}
.card-footer {
flex-basis: 60%;
display: flex;
flex-direction: column;
text-align: center;
}
.qr-code {
margin-top: 5px;
width: 20mm;
height: 20mm;
}
.tag-name-qrcode {
font-size: 10px;
margin: 0;
padding: 0;
}
.img-company {
padding:1px;
width: 12mm;
height: 12mm;
}
/* .blue {
background-color: #09255C;
color: white;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
font-weight: bold;
} */
/* .gray {
background-color: #EAF3F6;
color: black;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
font-weight: bold;
}
.dark-blue {
background-color: #00B0EA;
color: white;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
font-weight: bold;
} */
</style>
</head>
<body>
@php $globalCounter = 0; @endphp
@foreach ($equipmentData as $data)
@php
// Identifica o tipo de equipamento antes de processar os componentes
$equipmentTypeId = $data['equipment']->equipment_type_id;
$equipmentTag = $data['equipment']->equipment_tag;
@endphp
<!-- Estrutura PSV -->
@if ($equipmentTypeId == 3)
@foreach ($data['associatedArray'] as $component)
@php
$parts = explode('@', $component['component_tag']);
$tagName = $parts[0];
$tagType = $parts[1] ?? 'Tipo não especificado'; // Evita valores nulos
@endphp
<div class="card-layout" style="border:1px solid black">
<div class="card-header">
<div class="row" style="width: 100%; height:100%;">
<div class="col-sm p-0 " style="border: 1px solid gray;">
<div class="col-sm" style="border: 1px solid gray;" >
{{-- <img class="img-company" src="{{$isptLogoPath }}" alt="Logo da Empresa"> --}}
</div>
<div class="col-sm">
{{-- <img class="img-company" src="{{ $logoPath }}" alt="Logo da Empresa"> --}}
</div>
</div>
<div class="col-sm-6 p-0 m-0 title-card" style="border: 1px solid gray;">
<div class="col-sm" style="padding-top: 15px; margin: 0px; background-color: #09255C; color: #fff; font-size: 15px;">
ISPT - Paragem Navigator FF
</div>
<div class="row align-items-center" style="margin: 0px; height: 18px;">
<div class="col-sm" style="font-size: 12px; background-color: rgb(218, 218, 218);border:1px dashed black;">
N.Isp
</div>
<div class="col-sm" style="text-align: center;">
###
</div>
</div>
<div class="row align-items-center" style="margin: 0px; height: 18px;">
<div class="col-sm" style="font-size: 12px; background-color: rgb(218, 218, 218);border:1px dashed black;">
Tag
</div>
<div class="col-sm">
###
</div>
</div>
</div>
<div class="col-sm p-0" style="border: 1px solid gray;">
<div class="col-sm">
{{-- <img class="qr-code" src="{{ $tagType }}" alt="QR Code"> --}}
</div>
<div class="col-sm">
{{-- <p class="tag-name-qrcode">{{ $component['qrCodeImage'] }}</p> --}}
</div>
</div>
</div>
</div><!-- .Card-header -->
<div class="card-footer">
<div class="row" style="margin: 0px; height: 20px; ">
<div class="col-sm-3" style="font-size: 10px; background-color:#09255C;border:1px dashed black; color:white;">Dim.Entrada:</div>
<div class="col-sm-6" style="font-size: 10px;border:1px dashed black;">###</div>
<div class="col-sm" style="font-size: 10px; background-color:#09255C;border:1px dashed black; color:white;">Rating:</div>
<div class="col-sm" style="font-size: 10px;border:1px dashed black;">###</div>
</div>
<div class="row" style="margin: 0px; height: 20px; ">
<div class="col-sm-3" style="font-size: 10px; background-color:#09255C;border:1px dashed black; color:white;">Dim.Saida:</div>
<div class="col-sm-6" style="font-size: 10px;border:1px dashed black;">###</div>
<div class="col-sm" style="font-size: 10px; background-color:#09255C;border:1px dashed black; color:white;">Rating:</div>
<div class="col-sm" style="font-size: 10px;border:1px dashed black;">###</div>
</div>
<div class="row " style="margin: 0px; height: 20px; ">
<div class="col-sm-3" style="font-size: 10px; background-color:#09255C;border:1px dashed black; color:white;">Equipamento:</div>
<div class="col-sm-9" style="font-size: 10px;border:1px dashed black;">VÁLVULA SEGURANÇA DO TANQUE DE FLASH DO </div>
</div>
<div class="row" style="margin: 0px; height: 20px; ">
<div class="col-sm-3" style="font-size: 10px; background-color:#09255C;border:1px dashed black; color:white;">Fluido:</div>
<div class="col-sm" style="font-size: 10px;border:1px dashed black"> vapor </div>
<div class="col-sm" style="font-size: 10px; background-color:#09255C;border:1px dashed black; color:white;">Pressão:</div>
<div class="col-sm" style="font-size: 10px;border:1px dashed black"> 4,5 </div>
<div class="col-sm" style="font-size: 10px; background-color:#09255C;border:1px dashed black; color:white;">C.pressão:</div>
<div class="col-sm" style="font-size: 10px;border:1px dashed black"> na </div>
</div>
<div class="row" style="margin: 0px; display: flex; align-items: stretch;">
<div class="col-sm" style="font-size: 10px; background-color:#09255C; border:1px dashed black; color:white; text-align: center; display: flex; align-items: center; justify-content: center; min-height: 3em;">
T.val:
</div>
<div class="col-sm" style="font-size: 10px; border:1px dashed black; text-align: center; display: flex; align-items: center; justify-content: center; min-height: 4em;">
PSV
</div>
<div class="col-sm" style="font-size: 10px; background-color:#09255C; border:1px dashed black; color:white; text-align: center; display: flex; align-items: center; justify-content: center; min-height: 4em;">
Âmbito:
</div>
<div class="col-sm-4" style="font-size: 10px; border:1px dashed black; text-align: center; display: flex; align-items: center; justify-content: center; min-height: 4em;">
Reparação asdas asdasdasdd
</div>
<div class="col-sm" style="font-size: 10px; background-color:#09255C; border:1px dashed black; color:white; text-align: center; display: flex; align-items: center; justify-content: center; min-height: 4em;">
Área:
</div>
<div class="col-sm" style="font-size: 10px; border:1px dashed black; text-align: center; display: flex; align-items: center; justify-content: center; min-height: 4em;">
L-059
</div>
</div>
</div><!-- .Card-footer -->
</div>
<!-- .Card-layout -->
@endforeach
@elseif ($equipmentTypeId == 2)
@foreach ($data['associatedArray'] as $component)
@php
$parts = explode('@', $component['component_tag']);
$tagName = $parts[0];
$tagType = $parts[1] ?? 'Tipo não especificado'; // Evita valores nulos
@endphp
<h1>{{$equipmentTag}}</h1>
<div class="col-sm-4 text-center component-card">
<img class="qr-code" src="{{ $component['qrCodeImage'] }}" alt="QR Code">
<p class="tag-name-qrcode">{{ $tagType }}</p>
</div>
@endforeach
@elseif ($equipmentTypeId == 1)
@foreach ($data['associatedArray'] as $component)
@php
$parts = explode('@', $component['component_tag']);
$tagName = $parts[0];
$tagType = $parts[1] ?? 'Tipo não especificado'; // Evita valores nulos
@endphp
<h1>{{$equipmentTag}}</h1>
<div class="col-sm-4 text-center component-card">
<img class="qr-code" src="{{ $component['qrCodeImage'] }}" alt="QR Code">
<p class="tag-name-qrcode">{{ $tagType }}</p>
</div>
@endforeach
@else
<div class="unknown-structure">
<p>Estrutura desconhecida</p>
<div class="row">
@foreach ($data['associatedArray'] as $component)
@php
$parts = explode('@', $component['component_tag']);
$tagName = $parts[0];
$tagType = $parts[1] ?? 'Tipo não especificado'; // Evita valores nulos
@endphp
<div class="col-sm-4 text-center component-card">
<img class="qr-code" src="{{ $component['qrCodeImage'] }}" alt="QR Code">
<p class="tag-name-qrcode">{{ $tagType }}</p>
</div>
@endforeach
</div>
</div>
@endif
@php $globalCounter++; @endphp
@if ($globalCounter % 4 == 0)
<div class="page-break"></div>
@endif
@endforeach
</body>
</html>