52 lines
1.6 KiB
PHP
52 lines
1.6 KiB
PHP
<div class="d-flex flex-wrap justify-content-between align-items-center mt-5 gap-3">
|
|
<div class="text-muted fs-7">
|
|
Halaman {{ $users->currentPage() }} dari {{ $users->lastPage() }} ({{ $users->total() }} data)
|
|
</div>
|
|
|
|
@php
|
|
$current = $users->currentPage();
|
|
$last = $users->lastPage();
|
|
$start = max(1, $current - 2);
|
|
$end = min($last, $current + 2);
|
|
@endphp
|
|
|
|
<div class="d-flex align-items-center gap-2" id="progressPager">
|
|
@if ($users->onFirstPage())
|
|
<button type="button" class="btn btn-sm btn-light" disabled>Sebelumnya</button>
|
|
@else
|
|
<a class="btn btn-sm btn-light" href="{{ $users->previousPageUrl() }}">Sebelumnya</a>
|
|
@endif
|
|
|
|
<div class="d-flex align-items-center gap-1">
|
|
@if ($start > 1)
|
|
<a class="btn btn-sm btn-light" href="{{ $users->url(1) }}">1</a>
|
|
@if ($start > 2)
|
|
<span class="px-2 text-muted">...</span>
|
|
@endif
|
|
@endif
|
|
|
|
@for ($i = $start; $i <= $end; $i++)
|
|
@if ($i === $current)
|
|
<button type="button" class="btn btn-sm btn-primary" disabled>{{ $i }}</button>
|
|
@else
|
|
<a class="btn btn-sm btn-light" href="{{ $users->url($i) }}">{{ $i }}</a>
|
|
@endif
|
|
@endfor
|
|
|
|
@if ($end < $last)
|
|
@if ($end < $last - 1)
|
|
<span class="px-2 text-muted">...</span>
|
|
@endif
|
|
<a class="btn btn-sm btn-light" href="{{ $users->url($last) }}">{{ $last }}</a>
|
|
@endif
|
|
</div>
|
|
|
|
@if ($users->hasMorePages())
|
|
<a class="btn btn-sm btn-light" href="{{ $users->nextPageUrl() }}">Berikutnya</a>
|
|
@else
|
|
<button type="button" class="btn btn-sm btn-light" disabled>Berikutnya</button>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|