<?php
if(isset($count) && $count > 0){
    $xmlhttp = $sf_request->isXmlHttpRequest();
    $in_page_count = (isset($in_page_count) ? $in_page_count : 12);
    $active = $sf_request->getParameter('page', 1);
    $count = ceil($count / $in_page_count);
    if($count > 1){
        echo '<div class="pagination">';
        for($i = 1; $i <= $count; $i++){
            echo '<a ' . ($xmlhttp && $active != $i ? 'onclick="filter.submit(' . $i . ');return false;"' : '') . ' ' . ($active != $i ? 'href="?page=' . $i . '"' : '') . ' class="pagination__item ' . ($active == $i ? 'pagination__item_active' : '') . '">' . $i . '</a>';
        }
        echo '</div>';
    }
}
?>
