".$cat_name["title"]."
";
echo "";
$subcat = $product->getSubCategoriesId($cat, false, null);
$index = 0;
echo "";
for ($i = 0; $i < ceil(count($subcat) / 3); $i++) {
echo "
";
echo "
";
}
else if ($search!="") {
if($total > 0) echo ""; $subcat_name = $product->getCategory($subcat[$index], $_SESSION["LANGUAGE"], DEFAULT_LANGUAGE); echo "» ".$subcat_name["title"]." (".$product->countCategoryItems($subcat[$index], true).")"; $index++; echo " | "; } } echo "
".$total." ".$L["SEARCH_RESULTS"]." \"".$search."\"
";
}
if ($db->nf() > 0) {
echo "";
echo "";
echo "";
echo "
";
echo " ";
echo "";
while ($db->next_record()) $product->drawProducts($db->f("ref"));
loadAddCartPopUp();
//SEM OCORRENCIAS
} else {
if ($cat!="") {
echo "";
echo" ";
echo"
";
echo "".$L["ORGANIZE_TEXT"].":
";
echo"";
echo "A categoria seleccionada não possui artigos.";
echo "
";
}
if ($search!="") {
echo "".$L["MAIN_TITLE_NORESULTS"]."
".$L["TITLE1_NORESULTS"].":
".$L["TEXT1_NORESULTS"]."
".$L["TITLE2_NORESULTS"].":
".$L["TEXT2_NORESULTS"].".
".$L["TITLE3_NORESULTS"].":
".$L["TEXT3_NORESULTS"]."
"; echo "
";
//INICIA PAGINACAO ** GOOGLE STYLE
if ($last > 1) {
$offsetToFirst = $page - 1;
$offsetToLast = $last - $page;
if ($offsetToFirst <= (PAGINATION_HITS / 2))
$PaginationStart = $page - $offsetToFirst;
else if (($offsetToFirst > (PAGINATION_HITS / 2)) && ($offsetToLast <= (PAGINATION_HITS / 2)))
$PaginationStart = $page - (PAGINATION_HITS / 2) - ((PAGINATION_HITS / 2) - $offsetToLast);
else $PaginationStart = $page - (PAGINATION_HITS / 2);
$PaginationEnd = $PaginationStart + PAGINATION_HITS;
if ($PaginationEnd > $last) $PaginationEnd = $last;
if ($PaginationStart < 1) $PaginationStart = 1;
//SETA DO ANTERIOR
if ($page > 1) {
if($last>PAGINATION_HITS+1 && $offsetToFirst>PAGINATION_HITS/2 ) echo "<< ";
echo "< ";
}
for ($i = $PaginationStart; $i <= $PaginationEnd; $i++) {
//PAGINA ACTUAL
if ($page == $i) echo "$i";
//OUTRAS PAGINAS
else echo "".$i." ";
}
//SETA DO PROXIMO
if ($page < $last){
echo "> ";
if($last>(PAGINATION_HITS+1) && $offsetToLast>PAGINATION_HITS/2) echo ">> ";
}
}
$product_ini = ($page-1)*MAX_PRODUCTS_PER_PAGE + 1;
$product_fin = $page*MAX_PRODUCTS_PER_PAGE;
if ($product_fin > $total) $product_fin = $total;
echo "
";
if($total != 0){
echo "".$L['TEXT_RESULTS_PAGE'][0]."".$product_ini."".$L['TEXT_RESULTS_PAGE'][1]." ".$product_fin." ".$L['TEXT_RESULTS_PAGE'][2]." ".$total." | ".$last."".$L['TEXT_RESULTS_PAGE'][3]."
";
}
}
echo "