{{-- resources/views/sentimen/index.blade.php --}} @extends('layouts.user_type.auth') @section('content')
@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
Data Sentimen Dana (terlabel.csv)
@if (count($headerDana)) @foreach ($headerDana as $col) @endforeach @foreach ($paginatorDana as $row) @foreach ($row as $cell) @endforeach @endforeach
{{ $col }}
{{ $cell }}
@else

File terlabel.csv tidak ditemukan atau kosong.

@endif
@if (count($headerDana))
{{-- Left: items per page + summary --}}
@foreach (request()->except(['per_page_dana', 'page_dana']) as $k => $v) @endforeach
{{ $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
Data Sentimen GoPay (terlabelgopay.csv)
@if (count($headerGo)) @foreach ($headerGo as $col) @endforeach @foreach ($paginatorGo as $row) @foreach ($row as $cell) @endforeach @endforeach
{{ $col }}
{{ $cell }}
@else

File terlabelgopay.csv tidak ditemukan atau kosong.

@endif
@if (count($headerGo))
@foreach (request()->except(['per_page_go', 'page_go']) as $k => $v) @endforeach
{{ $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
Data Sentimen ShopeePay (terlabeshopepay.csv)
@if (count($headerShopee)) @foreach ($headerShopee as $col) @endforeach @foreach ($paginatorShopee as $row) @foreach ($row as $cell) @endforeach @endforeach
{{ $col }}
{{ $cell }}
@else

File terlabeshopepay.csv tidak ditemukan atau kosong.

@endif
@if (count($headerShopee))
@foreach (request()->except(['per_page_shopee', 'page_shopee']) as $k => $v) @endforeach
{{ $paginatorShopee->firstItem() }}–{{ $paginatorShopee->lastItem() }} of {{ $paginatorShopee->total() }}
@endif
@endsection