feat: initial commit
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
<div style="width: 50vw">
|
||||
|
||||
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
<th style="text-transform: capitalize; text-align:center; border: 1px solid black;" >Transmittal</th>
|
||||
<th style="text-transform: capitalize; text-align:center; border: 1px solid black;" >File</th>
|
||||
<th style="text-transform: capitalize; text-align:center; border: 1px solid black;" >Notes</th>
|
||||
<th style="text-transform: capitalize; text-align:center; border: 1px solid black;" >Remarks</th>
|
||||
</tr>
|
||||
@foreach ($transmittals as $transmittal)
|
||||
@php
|
||||
$fileRowCounter = 0;
|
||||
|
||||
|
||||
foreach ($transmittal->files as $file) {
|
||||
$fileNoteCount = $file->notes_count;
|
||||
$fileRemarkCount = $file->remarks_count;
|
||||
|
||||
$fileRowCount = $fileNoteCount;
|
||||
if($fileRemarkCount > $fileNoteCount) {
|
||||
$fileRowCount = $fileRemarkCount;
|
||||
}
|
||||
|
||||
$fileRowCounter += $fileRowCount;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$transmittalRowCount = $fileRowCounter;
|
||||
|
||||
if($transmittalRowCount < $transmittal->files_count) {
|
||||
$transmittalRowCount = $transmittal->fiels_count;
|
||||
}
|
||||
|
||||
$fileNoteCount = $transmittal->files[0]->notes_count;
|
||||
$fileRemarkCount = $transmittal->files[0]->remarks_count;
|
||||
|
||||
$firstFileRowCount = $fileNoteCount;
|
||||
|
||||
if($fileRemarkCount > $fileNoteCount)
|
||||
{
|
||||
$firstFileRowCount = $fileRemarkCount;
|
||||
}
|
||||
|
||||
|
||||
@endphp
|
||||
<tr>
|
||||
<td style="border: 1px solid black;" rowspan="{{ $transmittalRowCount }}">{{ $transmittal->series }} </td>
|
||||
<td style="border: 1px solid black;" rowspan="{{ $firstFileRowCount ?: 1 }}">{{ $transmittal->files[0]->description }} </td>
|
||||
<td style="border: 1px solid black;" >{{ $transmittal->files[0]->notes->first()?->comment }}</td>
|
||||
<td style="border: 1px solid black;" >{{ $transmittal->files[0]->remarks->first()?->remark }} </td>
|
||||
</tr>
|
||||
|
||||
@foreach($transmittal->files as $file)
|
||||
@php
|
||||
$fileNoteCount = $file->notes_count;
|
||||
$fileRemarkCount = $file->remarks_count;
|
||||
$fileRowCount = $fileNoteCount;
|
||||
if($fileRemarkCount > $fileNoteCount) {
|
||||
$fileRowCount = $fileRemarkCount;
|
||||
}
|
||||
|
||||
$notes = $file->notes->pluck('comment');
|
||||
$remarks = $file->remarks->pluck('remark');
|
||||
@endphp
|
||||
@if(!$loop->parent->first)
|
||||
@if($loop->first)
|
||||
@for($i = 1 ; $i < $fileRowCount ; $i++)
|
||||
<tr>
|
||||
<td style="border: 1px solid black;" >{{ $notes[$i] ?? '' }} </td>
|
||||
<td style="border: 1px solid black;" >{{ $remarks[$i] ?? '' }}</td>
|
||||
</tr>
|
||||
@endfor
|
||||
@else
|
||||
@for($i = 0 ; $i < $fileRowCount ; $i++)
|
||||
<tr>
|
||||
@if($i == 0)
|
||||
<td style="border: 1px solid black;" rowspan="{{ $fileRowCount }}">{{ $file->description }} </td>
|
||||
@endif
|
||||
<td style="border: 1px solid black;" >{{ $notes[$i] ?? '' }} </td>
|
||||
<td style="border: 1px solid black;" >{{ $remarks[$i] ?? '' }}</td>
|
||||
</tr>
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@endif
|
||||
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
|
||||
{{-- @foreach($transmittals as $transmittal)--}}
|
||||
{{-- @php $rowspan = 0; @endphp--}}
|
||||
{{-- @foreach($transmittal->files as $file)--}}
|
||||
{{-- @php $rowspan += max(count($file->notes), count($file->remarks)); @endphp--}}
|
||||
{{-- @endforeach--}}
|
||||
{{-- @foreach($transmittal->files as $file)--}}
|
||||
{{-- @php $fileRowspan = max(count($file->notes), count($file->remarks)); @endphp--}}
|
||||
{{-- <tr>--}}
|
||||
{{-- @if($loop->first)--}}
|
||||
{{-- <td style="border: 1px solid black;" rowspan="{{ $rowspan }}">{{ $transmittal->series }}</td>--}}
|
||||
{{-- @endif--}}
|
||||
{{-- <td style="border: 1px solid black;" rowspan="{{ $fileRowspan }}">{{ $file->description }}</td>--}}
|
||||
{{-- @if(count($file->notes) > 0)--}}
|
||||
{{-- <td style="border: 1px solid black;">{{ $file->notes[0]->comment }}</td>--}}
|
||||
{{-- @else--}}
|
||||
{{-- <td style="border: 1px solid black;"></td>--}}
|
||||
{{-- @endif--}}
|
||||
{{-- @if(count($file->remarks) > 0)--}}
|
||||
{{-- <td style="border: 1px solid black;">{{ $file->remarks[0]->remark }}</td>--}}
|
||||
{{-- @else--}}
|
||||
{{-- <td style="border: 1px solid black;"></td>--}}
|
||||
{{-- @endif--}}
|
||||
{{-- </tr>--}}
|
||||
{{-- @for($i = 1; $i < $fileRowspan; $i++)--}}
|
||||
{{-- <tr>--}}
|
||||
{{-- @if($loop->first)--}}
|
||||
{{-- <td style="border: 1px solid black;">--first--</td>--}}
|
||||
{{-- @endif--}}
|
||||
{{-- @if(isset($file->notes[$i]))--}}
|
||||
{{-- <td style="border: 1px solid black;">{{ $file->notes[$i]->comment }}</td>--}}
|
||||
{{-- @else--}}
|
||||
{{-- <td style="border: 1px solid black;"></td>--}}
|
||||
{{-- @endif--}}
|
||||
{{-- @if(isset($file->remarks[$i]))--}}
|
||||
{{-- <td style="border: 1px solid black;">{{ $file->remarks[$i]->remark }}</td>--}}
|
||||
{{-- @else--}}
|
||||
{{-- <td style="border: 1px solid black;"></td>--}}
|
||||
{{-- @endif--}}
|
||||
{{-- </tr>--}}
|
||||
{{-- @endfor--}}
|
||||
{{-- @endforeach--}}
|
||||
{{-- @endforeach--}}
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,64 @@
|
||||
<div class="pa-2 rounded-lg">
|
||||
<div class="grid grid-cols-1 mt-10">
|
||||
<div class="col"><b class="font-light text-xs">Date Created:</b></div>
|
||||
<div class="col font-medium">{{ $getRecord()->date_created->format('F j, Y') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 mt-10">
|
||||
<div class="mt-2">
|
||||
<div class="flex flex-col">
|
||||
<div class="col"><b class="font-light text-xs">Dispatch By:</b></div>
|
||||
<div class="col font-medium">{{ $getRecord()->user?->name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<div class="flex flex-col">
|
||||
<div class="col"><b class="font-light text-xs">Date Dispatched:</b></div>
|
||||
<div class="col font-medium">{{ $getRecord()->date_dispatch?->format('F j, Y') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<div class="flex flex-col">
|
||||
<div class="col"><b class="font-light text-xs">Received By:</b></div>
|
||||
<div class="col font-medium">{{ $getRecord()->received_by }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2 ">
|
||||
<div class="flex flex-col">
|
||||
<div class="col"><b class="font-light text-xs">Date Received:</b></div>
|
||||
<div class="col font-medium">{{ $getRecord()->date_received?->format('F j, Y') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2 ">
|
||||
<div class="flex flex-col">
|
||||
<div class="flex"><b class="font-normal text-md text-center">Files:</b></div>
|
||||
</div>
|
||||
@foreach($getRecord()->files as $file)
|
||||
<div class="border-b border-gray-400 text-orange-200 px-4 py-3 files-row">
|
||||
<div class="flex flex-col">
|
||||
<div class="col"><b class="font-light text-xs">Description:</b></div>
|
||||
<div class="col font-medium">{{ $file->description }}</div>
|
||||
</div>
|
||||
<div class="mt-2" style="gap: 10rem; display: flex;">
|
||||
<div class="flex flex-col">
|
||||
@if($file->notes->count() > 0)
|
||||
<div class="font-light text-xs">Notes:</div>
|
||||
@foreach($file->notes as $comment)
|
||||
<div class="col font-medium">{{ $comment->comment }}</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
@if($file->remarks->count() > 0)
|
||||
<div class="font-light text-xs">Remarks:</div>
|
||||
@foreach($file->remarks as $remark)
|
||||
<div class="col font-medium">{{ $remark->remark }}</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user