@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) {{-- section content --}} @section('content') @include('layouts.navbars.auth.topnav', ['title' => '']) @include('components.alert')
{{-- Document Preview Tabs --}}
Document Preview
@if(isset($is_pi) && $is_pi) @php $piBankInfo = ''; if(isset($ET_HEADER) && count($ET_HEADER) > 0 && !empty($ET_HEADER[0]->account_info_PI)) { $piBankInfo = addslashes($ET_HEADER[0]->account_info_PI); } @endphp @endif
{{-- View Dropdown --}} {{-- Download Dropdown --}} {{-- Print Dropdown --}} {{-- Edit PI Info Button --}} @if(isset($is_pi) && $is_pi) @endif
{{-- Zoom Controls --}}
@php // get use_different_template from backend $useElseTemplate = isset($use_different_template) ? $use_different_template : false; @endphp @if($useElseTemplate) @include('pages.documents.sales_contract_else') @else @include('pages.documents.sales_contract') @endif
@if(isset($is_pi) && $is_pi) @endif
{{-- Attachment Preview Section --}}
Dokumen PO (Purchase Order) @php // Use attachments passed from controller, or fallback to legacy if not set if (!isset($attachments)) { $attachments = collect([]); if (isset($list->attachment_path) && $list->attachment_path) { $attachments->push((object)[ 'id' => 0, 'file_path' => $list->attachment_path, 'original_name' => $list->attachment_original_name ]); } } @endphp @if($attachments->count() > 0) {{ $attachments->count() }} file @endif
@php // Update/Delete disabled for specific modules unless backend supports it $canUpdate = false; $hasAttachment = $attachments->count() > 0; @endphp @if($canUpdate) @endif
@if($hasAttachment) @php $attachmentsForJs = $attachments->map(function($att) { return [ 'id' => $att->id ?? 0, 'path' => asset('storage/' . $att->file_path), 'name' => $att->original_name, 'extension' => strtolower(pathinfo($att->file_path, PATHINFO_EXTENSION)) ]; })->values(); @endphp {{-- All Documents Stacked Vertically --}}
@foreach($attachments as $index => $attachment) @php $extension = strtolower(pathinfo($attachment->file_path, PATHINFO_EXTENSION)); $isImage = in_array($extension, ['jpg', 'jpeg', 'png', 'gif', 'webp']); $isPdf = $extension === 'pdf'; $attPath = asset('storage/' . $attachment->file_path); @endphp
{{-- Header with controls --}}
{{ $index + 1 }} {{ $attachment->original_name }}
@if($isImage || $isPdf) @endif Download @if($canUpdate && isset($attachment->id) && $attachment->id > 0) @endif
{{-- Document Preview --}}
@if($isImage)
{{ $attachment->original_name }}
@elseif($isPdf) @else

Preview tidak tersedia untuk tipe file ini.

@endif
@endforeach
@else
Belum ada dokumen PO yang diupload.
@endif
{{-- check flag js on dmenu --}} @if ($jsmenu == '1') @if (view()->exists("js.{$dmenu}")) @push('addjs') {{-- file js in folder (resources/views/js) --}} @include('js.' . $dmenu); @endpush @else @push('addjs') @endpush @endif @endif @endsection @push('js') @endpush