This commit is contained in:
Dwi Swandhana
2026-04-20 09:59:14 +07:00
parent f52b4a42e1
commit e3086919b7
@@ -6,10 +6,6 @@
overflow-x: auto;
}
.glassreport-pagination nav {
display: block;
}
.glassreport-pagination .pagination {
display: inline-flex;
flex-wrap: wrap;
@@ -34,6 +30,28 @@
line-height: 1.4;
text-align: center;
border-radius: 4px;
border: 1px solid #dee2e6;
background: #fff;
color: #495057;
text-decoration: none;
}
.glassreport-pagination .page-item.active .page-link {
background: #4c5667;
border-color: #4c5667;
color: #fff;
}
.glassreport-pagination .page-item.disabled .page-link {
color: #adb5bd;
background: #f8f9fa;
cursor: not-allowed;
}
.glassreport-pagination .pagination-summary {
margin-bottom: 10px;
font-size: 13px;
color: #6c757d;
}
</style>
<div class="wrapper">
@@ -80,7 +98,56 @@
@endforeach
@if(method_exists($orderbydate, 'links'))
<div class="mt-3 glassreport-pagination">
{{ $orderbydate->links() }}
<div class="pagination-summary">
Menampilkan {{ $orderbydate->firstItem() ?? 0 }} sampai {{ $orderbydate->lastItem() ?? 0 }} dari {{ $orderbydate->total() }} pemeriksaan
</div>
@php
$currentPage = $orderbydate->currentPage();
$lastPage = $orderbydate->lastPage();
$startPage = max(1, $currentPage - 4);
$endPage = min($lastPage, $currentPage + 4);
@endphp
<ul class="pagination">
<li class="page-item {{ $orderbydate->onFirstPage() ? 'disabled' : '' }}">
@if($orderbydate->onFirstPage())
<span class="page-link">Previous</span>
@else
<a class="page-link" href="{{ $orderbydate->previousPageUrl() }}">Previous</a>
@endif
</li>
@if($startPage > 1)
<li class="page-item"><a class="page-link" href="{{ $orderbydate->url(1) }}">1</a></li>
@if($startPage > 2)
<li class="page-item disabled"><span class="page-link">...</span></li>
@endif
@endif
@for($page = $startPage; $page <= $endPage; $page++)
<li class="page-item {{ $page === $currentPage ? 'active' : '' }}">
@if($page === $currentPage)
<span class="page-link">{{ $page }}</span>
@else
<a class="page-link" href="{{ $orderbydate->url($page) }}">{{ $page }}</a>
@endif
</li>
@endfor
@if($endPage < $lastPage)
@if($endPage < $lastPage - 1)
<li class="page-item disabled"><span class="page-link">...</span></li>
@endif
<li class="page-item"><a class="page-link" href="{{ $orderbydate->url($lastPage) }}">{{ $lastPage }}</a></li>
@endif
<li class="page-item {{ $orderbydate->hasMorePages() ? '' : 'disabled' }}">
@if($orderbydate->hasMorePages())
<a class="page-link" href="{{ $orderbydate->nextPageUrl() }}">Next</a>
@else
<span class="page-link">Next</span>
@endif
</li>
</ul>
</div>
@endif
</div>