ispt4.0_laravel/resources/views/projectsClients/pdf/testePdf.blade.php
2024-09-05 07:28:48 +01:00

367 lines
16 KiB
PHP

{{-- @php
$pageCounter = 1;
@endphp
<x-pdf-layout :tag="$tag" :numeroPanini="$numeroPanini" :nObra="$nObra" :ambito="$ambito" :projectLogoPath="$projectLogoPath"
:pageCounter="$pageCounter" :companyLogoPath="$companyLogoPath">
@foreach ($receiveAllTasksHistiory as $task_todo)
<div class="page-break"></div>
<div class="content">
@include('components.elemental-tasks', ['task_todo' => $task_todo])
<br>
<br>
<br>
@if (isset($taskImages[$task_todo->control_equipment_workstation_id]) && is_array($taskImages[$task_todo->control_equipment_workstation_id]))
<div class="row no-gutters">
@foreach ($taskImages[$task_todo->control_equipment_workstation_id] as $image)
<div class="col-4">
<img src="{{ public_path($image) }}" alt="Image" class="pdf-image"
style="border: 3px solid #00B0EA">
</div>
@endforeach
</div>
@endif
</div>
@php
$pageCounter++;
@endphp
@endforeach
</x-pdf-layout> --}}
{{-- <x-pdf-layout :tag="$tag" :numeroPanini="$numeroPanini" :nObra="$nObra" :ambito="$ambito" :projectLogoPath="$projectLogoPath"
:companyLogoPath="$companyLogoPath">
@php
$pageCounter = 1;
@endphp
@foreach ($receiveAllTasksHistiory as $task_todo)
<div class="page-break"></div>
<div class="container">
<header class="mb-3">
@include(
'projectsClients.pdf._header',
compact('tag', 'numeroPanini', 'nObra', 'ambito', 'projectLogoPath', 'companyLogoPath'))
</header>
<div class="content mr-4">
@include('components.elemental-tasks', ['task_todo' => $task_todo])
<br>
<br>
<br>
@if (isset($taskImages[$task_todo->control_equipment_workstation_id]) && is_array($taskImages[$task_todo->control_equipment_workstation_id]))
<div class="row no-gutters">
@foreach ($taskImages[$task_todo->control_equipment_workstation_id] as $image)
<div class="col-4">
<img src="{{ public_path($image) }}" alt="Image" class="pdf-image"
style="border: 3px solid #00B0EA">
</div>
@endforeach
</div>
@endif
</div>
<footer>
<div class="footer">
<div class="container">
<div class="row">
<div class="col-6 generated-at">
Generated at: {{ \Carbon\Carbon::now()->addHour()->format('Y-m-d H:i:s') }}
</div>
<div class="col-6 page-number">
Page: {{ $pageCounter }}
</div>
</div>
</div>
</div>
</footer>
</div>
@php
$pageCounter++;
@endphp
@endforeach
</x-pdf-layout> --}}
@extends('components.pdf-layout')
@section('firstPage')
<div class="container-frist-page">
<div style=" border: 1px solid black;">
<!-- Header-frist-page -->
<div class="header-frist-page">
<img src="{{ public_path($isptLogoPath) }}" alt="Company Logo" class="img-fluid"
style="max-width: 150px; max-height: 150px; border:1px solid black">
<div class="title">
<!-- PSV -->
@if ($detailsEquipment->equipment_type_id == 3)
<h2>FICHA DE BENEFICIAÇÃO E REPARAÇÃO<br>DE<br>VÁLVULAS DE SECCIONAMENTO</h2>
<!-- CV -->
@elseif($detailsEquipment->equipment_type_id == 1)
<h2>FICHA DE BENEFICIAÇÃO E REPARAÇÃO<br>DE<br>VÁLVULAS DE CONTROLO E ON/OFF</h2>
<!-- ISV -->
@else
<h2>FICHA DE BENEFICIAÇÃO E REPARAÇÃO<br>DE<br>VÁLVULAS DE SEGURANCA</h2>
@endif
</div>
<div class="info">
<p> OBRA :<b>N/A</b>
<br>FICHA : {{ $detailsEquipmentWorkHistory->ispt_number }}
<br>FOLHA: 1 de 2
</p>
</div>
</div>
<!-- Info Table -->
<table class="info-table">
<tr>
<td> <b>Cliente:</b> <span>{{ $receiveDetailsProject->plant->company->company_name }}</span></td>
<td> <b>Obra Cliente:</b> <span><b>N/A</b></span></td>
</tr>
<tr>
<td> <b>Unidade:</b> <span>{{ $receiveDetailsProject->plant->plant_name }}</span></td>
<td> <b>Trabalhos Realizados de:</b> <span>{{ $oldestDate }}</span> a <span>{{ $latestDate }}</span>
</td>
</tr>
</table>
<!-- PSV -->
@if ($detailsEquipment->equipment_type_id == 3)
<!-- Specifications Table -->
{{-- <table class="spec-table">
<tr>
<th colspan="4" class="section-title">I - ESPECIFICAÇÕES TÉCNICAS PSV</th>
</tr>
<tr>
<td>TAG Válvula: <span>{{ $detailsEquipment->equipment_tag ?? 'N/A' }}</span></td>
<td>Descrição: <span>{{ $detailsEquipment->equipment_description ?? 'N/A' }}</span></td>
<td>N Série: <span>{{ $detailsEquipment->equipment_serial_number ?? 'N/A' }}</span></td>
<td>Marca: <span>{{ $detailsEquipment->equipment_brand ?? 'N/A' }}</span></td>
</tr>
<tr>
<td>Modelo: <span>{{ $detailsEquipment->specificAttributes[8]['value'] ?? 'N/A' }}</span></td>
<td>Dimensão: <span>{{ $detailsEquipment->specificAttributes[8]['value'] ?? 'N/A' }}</span></td>
<td>Rating: <span>{{ $detailsEquipment->specificAttributes[17]['value'] ?? 'N/A' }}</span></td>
<td>Dim Certa: <span>{{ $detailsEquipment->specificAttributes[10]['value'] ?? 'N/A' }}</span></td>
</tr>
<tr>
<td>Main Equipament: <span>{{ $detailsEquipment->specificAttributes[18]['value'] ?? 'N/A' }}</span>
</td>
<td>P&ID: <span>{{ $detailsEquipment->specificAttributes[11]['value'] ?? 'N/A' }}</span></td>
<td> SAP: <span>{{ $detailsEquipment->specificAttributes[12]['value'] ?? 'N/A' }}</span></td>
<td>Manufacturer: <span>{{ $detailsEquipment->specificAttributes[22]['value'] ?? 'N/A' }}</span>
</td>
</tr>
<tr>
<td>dn_ent: <span>{{ $detailsEquipment->specificAttributes[9]['value'] ?? 'N/A' }}</span></td>
<td>dn_sai: <span>{{ $detailsEquipment->specificAttributes[39]['value'] ?? 'N/A' }}</span></td>
<td>rating_flange_mount:
<span>{{ $detailsEquipment->specificAttributes[33]['value'] ?? 'N/A' }}</span>
</td>
<td>rating_flange_jusante:
<span>{{ $detailsEquipment->specificAttributes[34]['value'] ?? 'N/A' }}</span>
</td>
</tr>
<tr>
<td>sp_bar_cold: <span>{{ $detailsEquipment->specificAttributes[19]['value'] ?? 'N/A' }}</span>
</td>
<td>back_presure_bar:
<span>{{ $detailsEquipment->specificAttributes[20]['value'] ?? 'N/A' }}</span>
</td>
<!-- Ainda falta criar no general_attributes_equipaments -->
<!-- <td colspan="2">decontamination:
<span>{{ $detailsEquipment->specificAttributes[34]['value'] ?? 'N/A' }}</span> </td> -->
</tr>
</table> --}}
<table class="spec-table">
<tr>
<th colspan="4" class="section-title">I - ESPECIFICAÇÕES TÉCNICAS PSV</th>
</tr>
<tr>
<td><b>TAG Válvula:</b> <span>{{ $detailsEquipment->equipment_tag ?? 'N/A' }}</span></td>
<td><b>Descrição:</b> <span>{{ $detailsEquipment->equipment_description ?? 'N/A' }}</span></td>
<td><b>N Série:</b> <span>{{ $detailsEquipment->equipment_serial_number ?? 'N/A' }}</span></td>
<td><b>Marca:</b> <span>{{ $detailsEquipment->equipment_brand ?? 'N/A' }}</span></td>
</tr>
<tr>
<td><b>Modelo:</b> <span>{{ $detailsEquipment->specificAttributes[8]['value'] ?? 'N/A' }}</span>
</td>
<td><b>Dimensão:</b> <span>{{ $detailsEquipment->specificAttributes[8]['value'] ?? 'N/A' }}</span>
</td>
<td><b>Rating:</b> <span>{{ $detailsEquipment->specificAttributes[17]['value'] ?? 'N/A' }}</span>
</td>
<td><b>Dim Certa:</b>
<span>{{ $detailsEquipment->specificAttributes[10]['value'] ?? 'N/A' }}</span></td>
</tr>
<tr>
<td><b>Main Equipament:</b>
<span>{{ $detailsEquipment->specificAttributes[18]['value'] ?? 'N/A' }}</span></td>
<td><b>P&ID:</b> <span>{{ $detailsEquipment->specificAttributes[11]['value'] ?? 'N/A' }}</span>
</td>
<td><b> SAP:</b> <span>{{ $detailsEquipment->specificAttributes[12]['value'] ?? 'N/A' }}</span>
</td>
<td><b>Manufacturer:</b>
<span>{{ $detailsEquipment->specificAttributes[22]['value'] ?? 'N/A' }}</span></td>
</tr>
<tr>
<td><b>dn_ent:</b> <span>{{ $detailsEquipment->specificAttributes[9]['value'] ?? 'N/A' }}</span>
</td>
<td><b>dn_sai:</b> <span>{{ $detailsEquipment->specificAttributes[39]['value'] ?? 'N/A' }}</span>
</td>
<td><b>rating_flange_mount:</b>
<span>{{ $detailsEquipment->specificAttributes[33]['value'] ?? 'N/A' }}</span></td>
<td><b>rating_flange_jusante:</b>
<span>{{ $detailsEquipment->specificAttributes[34]['value'] ?? 'N/A' }}</span></td>
</tr>
<tr>
<td><b>sp_bar_cold:</b>
<span>{{ $detailsEquipment->specificAttributes[19]['value'] ?? 'N/A' }}</span></td>
<td><b>back_presure_bar:</b>
<span>{{ $detailsEquipment->specificAttributes[20]['value'] ?? 'N/A' }}</span></td>
</tr>
</table>
<!-- CV -->
@elseif($detailsEquipment->equipment_type_id == 1)
<!-- Specifications Table -->
<table class="spec-table">
<tr>
<th colspan="4" class="section-title">I - ESPECIFICAÇÕES TÉCNICAS CV</th>
</tr>
<tr>
<td>TAG Válvula: <span>PP.PCV-116</span></td>
<td>Tipo de Atuador: <span>Linear</span></td>
<td>Tipo de Válvula: <span>Controle</span></td>
<td>Atuador: <span>Rotativo</span></td>
</tr>
<tr>
<td>Fabricante da Válvula: <span>Fisher</span></td>
<td>Tipo de Atuador: <span>Eletro</span></td>
<td>Modelo da Válvula: <span>Globo Frontal</span></td>
<td>Atuador: <span>Pneumático</span></td>
</tr>
<tr>
<td>Modelo de Atuador: <span>Fisher 1B</span></td>
<td colspan="3">Mais especificações aqui...</td>
</tr>
</table>
<!-- ISV -->
@else
<!-- Specifications Table -->
<table class="spec-table">
<tr>
<th colspan="4" class="section-title">I - ESPECIFICAÇÕES TÉCNICAS ISV</th>
</tr>
<tr>
<td>TAG Válvula: <span>PP.PCV-116</span></td>
<td>Tipo de Atuador: <span>Linear</span></td>
<td>Tipo de Válvula: <span>Controle</span></td>
<td>Atuador: <span>Rotativo</span></td>
</tr>
<tr>
<td>Fabricante da Válvula: <span>Fisher</span></td>
<td>Tipo de Atuador: <span>Eletro</span></td>
<td>Modelo da Válvula: <span>Globo Frontal</span></td>
<td>Atuador: <span>Pneumático</span></td>
</tr>
<tr>
<td>Modelo de Atuador: <span>Fisher 1B</span></td>
<td colspan="3">Mais especificações aqui...</td>
</tr>
</table>
@endif
</div>
<footer>
<div class="footer-container">
<h4>Lista de Históricos de Âmbitos</h4>
<ul>
@foreach ($ambitHistories as $history)
<li>{{ $history['AmbitHistoryOrder'] }} - {{ $history['AmbitName'] }}
({{ $history['AmbitHistoryTimeChange'] }})
</li>
@endforeach
</ul>
</div>
</footer>
</div>
@endsection
@section('loopPages')
@foreach ($receiveAllTasksHistiory as $task_todo)
<div class="page-break"></div>
<div class="container-loop-pages">
<header>
@include(
'projectsClients.pdf._header',
compact(
'detailsEquipment',
'detailsEquipmentWorkHistory',
'receiveDetailsProject',
'ambito',
'projectLogoPath',
'companyLogoPath'))
</header>
<div class="content-loop-pages">
@include('components.elemental-tasks', ['task_todo' => $task_todo])
@if (isset($taskImages[$task_todo->control_equipment_workstation_id]) &&
is_array($taskImages[$task_todo->control_equipment_workstation_id]))
<div class="row no-gutters">
@foreach ($taskImages[$task_todo->control_equipment_workstation_id] as $image)
<div class="col-4">
<img src="{{ public_path($image) }}" alt="Image" class="pdf-image"
style="border: 3px solid #00B0EA">
</div>
@endforeach
</div>
@endif
</div>
<footer>
<div class="footer-container">
<div class="row">
<div class="col-sm generated-at">
Generated at: {{ \Carbon\Carbon::now()->addHour()->format('Y-m-d H:i:s') }}
</div>
<div class="col-sm generated-at" style=" text-align: right;">
Page: 1234
</div>
</div>
</div>
</footer>
</div>
@endforeach
@endsection