43 lines
2.2 KiB
PHP
43 lines
2.2 KiB
PHP
@if ($totalPages > 1)
|
|
<div class="team2-units-report-pagination {{ $paginationPosition ?? '' }} d-flex flex-wrap justify-content-between align-items-center gap-2">
|
|
<div class="text-muted small mb-0">
|
|
Page {{ $currentPage }} of {{ $totalPages }} ({{ number_format($totalDoctors) }} doctors)
|
|
</div>
|
|
<nav aria-label="Doctor report pagination">
|
|
<ul class="pagination pagination-sm mb-0">
|
|
<li class="page-item @if($currentPage <= 1) disabled @endif">
|
|
<a class="page-link" href="{{ $currentPage <= 1 ? '#' : $pageBase . '&page=' . ($currentPage - 1) }}">Previous</a>
|
|
</li>
|
|
@php
|
|
$startPage = max(1, $currentPage - 2);
|
|
$endPage = min($totalPages, $currentPage + 2);
|
|
@endphp
|
|
@if ($startPage > 1)
|
|
<li class="page-item">
|
|
<a class="page-link" href="{{ $pageBase }}&page=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 @if($page === $currentPage) active @endif">
|
|
<a class="page-link" href="{{ $pageBase }}&page={{ $page }}">{{ $page }}</a>
|
|
</li>
|
|
@endfor
|
|
@if ($endPage < $totalPages)
|
|
@if ($endPage < $totalPages - 1)
|
|
<li class="page-item disabled"><span class="page-link">...</span></li>
|
|
@endif
|
|
<li class="page-item">
|
|
<a class="page-link" href="{{ $pageBase }}&page={{ $totalPages }}">{{ $totalPages }}</a>
|
|
</li>
|
|
@endif
|
|
<li class="page-item @if($currentPage >= $totalPages) disabled @endif">
|
|
<a class="page-link" href="{{ $currentPage >= $totalPages ? '#' : $pageBase . '&page=' . ($currentPage + 1) }}">Next</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
@endif
|