@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) {{-- section content --}} @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
{{ $title_menu }}
{{-- alert --}} @include('components.alert')

@if($dmenu) {{-- Action Column First --}} {{-- Vendor Information --}} {{-- Contact Persons --}} {{-- Directors --}} {{-- Bank Accounts --}} {{-- Quality Environment --}} {{-- Agreement Document --}} {{-- Status & Approver --}} @else {{-- For other menus, use default header --}} @foreach ($table_header as $header) @endforeach @endif {{-- retrieve table detail --}} @foreach ($table_detail as $detail) @php $primary = ''; foreach ($table_primary as $p) { $primary == '' ? ($primary = $detail->{$p->field}) : ($primary = $primary . ':' . $detail->{$p->field}); } // For lsvndr, use id directly since it has no sys_table primary key mapping if($dmenu) { $primary = $detail->id; } $vcount = $loop->iteration; // Get related data for lsvndr if($dmenu) { $contacts = DB::table('tr_contact_person')->where('vendor_id', $detail->id)->get(); $directors = DB::table('tr_director')->where('vendor_id', $detail->id)->get(); $banks = DB::table('tr_bank')->where('vendor_id', $detail->id)->get(); $qualityEnvs = DB::table('tr_vendor_quality_environment')->where('vendor_id', $detail->id)->get(); $approved_by = DB::table('users')->where('username', $detail->approved_by)->first(); $approver = DB::table('users')->where('username', $detail->approver)->first(); } @endphp @if($dmenu) {{-- Action Dropdown Column First --}} {{-- Vendor Information --}} {{-- Contact Persons --}} {{-- Directors --}} {{-- Bank Accounts --}} {{-- Quality Environment --}} {{-- Agreement Document --}} {{-- Status --}} {{-- SAP Status --}} @else {{-- For other menus, use default foreach --}} @foreach ($table_header as $field) @php $string = $field->field; @endphp {{-- Keep existing logic for other menus --}} @if ($field->type == 'enum') @elseif ($field->type == 'file') @else @endif @endforeach @endif @endforeach
Action NoOld Code Vendor SAP Code Vendor Corporation Vendor Name Address 1 Address 2 Address 3 CityContact PersonsStatus Status UploadNo{{ $header->alias }}
{{ $loop->iteration }}{{ $detail->old_code_vendor }} {{ $detail->sap_code_vendor ?? '-' }} {{ $detail->corp }} {{ $detail->name }} {{ $detail->office_address1 }} {{ $detail->office_address2 ?? '-' }} {{ $detail->office_address3 ?? '-' }} {{ $detail->city_name ?? '-' }} @if($contacts->count() > 0) @else No Data @endif @if($detail->status == 'Pending') Pending @elseif($detail->status == 'Proposed') Proposed @elseif($detail->status == 'Approved') Approved @elseif($detail->status == 'Rejected') Rejected @elseif($detail->status == 'Finish') Finish @endif @if($detail->sap_status == 'Belum Upload') Belum Upload @elseif($detail->sap_status == 'Proses') Proses @elseif($detail->sap_status == 'Sudah Upload') Sudah Upload @elseif($detail->sap_status == 'Update PPN') Update PPN @elseif($detail->sap_status == 'Update') Update @endif {{ $loop->iteration }} {{-- Existing enum logic --}} {{-- Existing file logic --}} {{ $detail->$string }}
{{-- 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