<nav class="mb-2">
    <ul class="pagination mb-0">
        <li class="page-item <?php if ( $page == 1 ) : ?>disabled<?php endif; ?>">
            <a class="page-link text-danger" href="<?php echo URL_APP; ?>/project/?projectId=<?php echo $pid; ?>&view=<?php echo $view; ?>&page=1">
                <span aria-hidden="true">&laquo;</span>
            </a>
        </li>
        <li class="page-item text-danger <?php if ( $page == 1 ) : ?>disabled<?php endif; ?>">
            <a class="page-link text-danger" href="<?php echo URL_APP; ?>/project/?projectId=<?php echo $pid; ?>&view=<?php echo $view; ?>&page=<?php echo $page - 1; ?>">
                <span aria-hidden="true">&lsaquo;</span>
            </a>
        </li>
<?php 
            for ( $c = ($page - 2); $c <= ($page + 2); $c++ ) :
                if ( $c < 1 || $c > $numPages ) {
                    continue;
                }
?>
            <li class="page-item <?php if ( $page == $c ) : ?>active<?php endif; ?>">
                <a class="page-link text-danger" href="<?php echo URL_APP; ?>/project/?projectId=<?php echo $pid; ?>&view=<?php echo $view; ?>&page=<?php echo $c; ?>"><?php echo $c; ?></a>
            </li>
        <?php endfor; ?>
        <li class="page-item <?php if ( $page == $numPages ) : ?>disabled<?php endif; ?>">
            <a class="page-link text-danger" href="<?php echo URL_APP; ?>/project/?projectId=<?php echo $pid; ?>&view=<?php echo $view; ?>&page=<?php echo $page + 1; ?>">
                <span aria-hidden="true">&rsaquo;</span>
            </a>
        </li>
        <li class="page-item <?php if ( $page == $numPages ) : ?>disabled<?php endif; ?>">
            <a class="page-link text-danger" href="<?php echo URL_APP; ?>/project/?projectId=<?php echo $pid; ?>&view=<?php echo $view; ?>&page=<?php echo $numPages; ?>">
                <span aria-hidden="true">&raquo;</span>
            </a>
        </li>
    </ul>
</nav>