@php
$perPageOptions = [10, 25, 50, 100];
@endphp
{{-- === Table for Dana === --}}
@php
$pathDana = resource_path('views/terlabel.csv');
$allRowsDana = file_exists($pathDana) ? array_map('str_getcsv', file($pathDana)) : [];
$headerDana = count($allRowsDana) > 1 ? array_shift($allRowsDana) : [];
$perPageDana = (int) request()->get('per_page_dana', 10);
$currentPageDana = (int) request()->get('page_dana', 1);
$paginatorDana = new \Illuminate\Pagination\LengthAwarePaginator(
array_slice($allRowsDana, ($currentPageDana - 1) * $perPageDana, $perPageDana),
count($allRowsDana),
$perPageDana,
$currentPageDana,
[
'path' => url()->current(),
'pageName' => 'page_dana',
'query' => request()->except('page_dana'),
],
);
@endphp
@if (count($headerDana))
@foreach ($headerDana as $col)
{{ $col }}
|
@endforeach
@foreach ($paginatorDana as $row)
@foreach ($row as $cell)
{{ $cell }} |
@endforeach
@endforeach
@else
File terlabel.csv tidak ditemukan atau kosong.
@endif
@if (count($headerDana))
{{-- Left: items per page + summary --}}
{{ $paginatorDana->firstItem() }}–{{ $paginatorDana->lastItem() }} of
{{ $paginatorDana->total() }}
{{-- Right: pagination controls --}}
@endif
{{-- === Table for GoPay === --}}
@php
$pathGo = resource_path('views/terlabelgopay.csv');
$allRowsGo = file_exists($pathGo) ? array_map('str_getcsv', file($pathGo)) : [];
$headerGo = count($allRowsGo) > 1 ? array_shift($allRowsGo) : [];
$perPageGo = (int) request()->get('per_page_go', 10);
$currentPageGo = (int) request()->get('page_go', 1);
$paginatorGo = new \Illuminate\Pagination\LengthAwarePaginator(
array_slice($allRowsGo, ($currentPageGo - 1) * $perPageGo, $perPageGo),
count($allRowsGo),
$perPageGo,
$currentPageGo,
[
'path' => url()->current(),
'pageName' => 'page_go',
'query' => request()->except('page_go'),
],
);
@endphp
@if (count($headerGo))
@foreach ($headerGo as $col)
{{ $col }}
|
@endforeach
@foreach ($paginatorGo as $row)
@foreach ($row as $cell)
{{ $cell }} |
@endforeach
@endforeach
@else
File terlabelgopay.csv tidak ditemukan atau kosong.
@endif
@if (count($headerGo))
{{ $paginatorGo->firstItem() }}–{{ $paginatorGo->lastItem() }} of
{{ $paginatorGo->total() }}
@endif
{{-- === Table for ShopeePay === --}}
@php
$pathShopee = resource_path('views/terlabeshopepay.csv');
$allRowsShopee = file_exists($pathShopee) ? array_map('str_getcsv', file($pathShopee)) : [];
$headerShopee = count($allRowsShopee) > 1 ? array_shift($allRowsShopee) : [];
$perPageShopee = (int) request()->get('per_page_shopee', 10);
$currentPageShopee = (int) request()->get('page_shopee', 1);
$paginatorShopee = new \Illuminate\Pagination\LengthAwarePaginator(
array_slice($allRowsShopee, ($currentPageShopee - 1) * $perPageShopee, $perPageShopee),
count($allRowsShopee),
$perPageShopee,
$currentPageShopee,
[
'path' => url()->current(),
'pageName' => 'page_shopee',
'query' => request()->except('page_shopee'),
],
);
@endphp
@if (count($headerShopee))
@foreach ($headerShopee as $col)
{{ $col }}
|
@endforeach
@foreach ($paginatorShopee as $row)
@foreach ($row as $cell)
{{ $cell }} |
@endforeach
@endforeach
@else
File terlabeshopepay.csv tidak ditemukan atau kosong.
@endif
@if (count($headerShopee))
{{ $paginatorShopee->firstItem() }}–{{ $paginatorShopee->lastItem() }} of
{{ $paginatorShopee->total() }}
@endif