
<?php
$path = isset($url) ? $url : 'search/index/';
?>

        <div class="pull-right">
            <?php
                echo form_open($path . $params, array('class' => 'pull-left form-inline page-limit-selector'));
                $arrayListRows = array("25" => "25", "50" => "50", "100" => "100", "250" => "250", "500" => "500", "1000" => "1000");
                echo form_dropdown('rows', $arrayListRows, array(0 => $number_of_rows), ' data-toggle="cfe-collapse-dropdown" data-btn-css-class="btn-cfe-paginator" data-cfe-caret-text="'.$number_of_rows.'"  data-cfe-submit-on-change="true"');
                echo form_close();
            ?>
        </div>
        <div class="pull-right pagination">
        <ul class="pull-left">
            <?php if ($pg['page'] > $pg['first'] && $pg['start'] > $pg['first']) { ?>
                <li>
                    <a href="<?php echo site_url($path . $params . 'rows/' . $number_of_rows . '/page/' . $pg['first']) ?>" title="Go to First Page">First</a>
                </li>

            <?php } ?>

            <?php if ($pg['page'] > $pg['first'] && $pg['start'] > $pg['first']) { ?>
                <li><a href="<?php echo site_url($path . $params . 'rows/' . $number_of_rows . '/page/' . htmlspecialchars($pg['prevSet'])) ?>" title="Go to Previous Page <?= htmlspecialchars($pg['prevSet']) ?>">&laquo;</a></li>
            <?php } ?>

            <?php
            for ($i = $pg['start']; $i <= $pg['end']; $i++) {
                if ($i == $pg['page']) {
                    $current_class = 'active';
                } else {
                    $current_class = "";
                }
                ?>

                <li class="<?= htmlspecialchars($current_class) ?>">

                <a href="<?php echo site_url($path . $params . 'rows/' . $number_of_rows . "/page/$i") ?>" title="Go to Page <?php echo $i ?>"><?php echo $i; ?></a>

                </li>

            <?php } ?>

                <?php if ($pg['page'] != $pg['last'] && $pg['end'] < $pg['last']) { ?>
                 <li>
                    <a href="<?php echo site_url($path . $params . 'rows/' . $number_of_rows . '/page/' . htmlspecialchars($pg['nextSet'])) ?>" title="Go to page <?= htmlspecialchars($pg['nextSet']) ?>">&raquo;</a>
                </li>
                <?php } ?>

                <?php if ($pg['page'] != $pg['last'] && $pg['end'] < $pg['last']) { ?>
                <li>
                    <a href="<?php echo site_url($path . $params . 'rows/' . $number_of_rows . '/page/' . $pg['last']) ?>" title="Go to Last Page" class="last">Last</a>
                </li>
                <?php } ?>

        </ul>
        </div>
