<div>
    <div class="row mb-2">
        <!-- Form for Pagination -->
        <div id="paginationButtons" class="col-auto m-auto btn-group">
            <!-- Start Button -->
            <a class="btn btn-outline-primary" href="?page=0" <?= $view->pageNumber <= 0 ? 'disabled' : '' ?>><i class="bi bi-chevron-double-left"></i> Start</a>
            <!-- Back Button -->
            <a class="btn btn-outline-primary" href="?page=<?=max($view->pageNumber - 1, 0)?> " <?= $view->pageNumber <= 0 ? 'disabled' : '' ?>><i class="bi bi-chevron-left"></i> Back</a>
            <!-- Dynamic Page Buttons -->
            <?php
            $totalPages = $view->paginator->getTotalPages();
            var_dump($totalPages);
            for ($i = $view->pageNumber - 2; $i <= $view->pageNumber + 2; $i++) {
                if ($i >= 0 && $i < $totalPages): ?>
                    <a href="?page=<?= $i ?>"
                            class="btn <?= $i === $view->pageNumber ? 'btn-dark' : 'btn-outline-primary' ?>"
                        <?= $i === $view->pageNumber ? 'disabled' : '' ?>>
                        <?= $i + 1 ?>
                    </a>
                <?php endif;
            } ?>
            <!-- Forward Button -->
            <a class="btn btn-outline-primary" href="?page=<?=min($view->pageNumber + 1, $totalPages)?> " <?= $view->pageNumber >= $totalPages - 1 ? 'disabled' : '' ?>>Forward <i class="bi bi-chevron-right"></i></a>
            <!-- End Button -->
            <a class="btn btn-outline-primary" href="?page=<?= $totalPages - 1 ?>"<?= $view->pageNumber >= $totalPages - 1 ? 'disabled' : '' ?>>End <i class="bi bi-chevron-double-right"></i></a>
        </div>
    </div>
</div>
