$cat=$_REQUEST[cat]; $pasta = $_SERVER['DOCUMENT_ROOT']."/unidades/".$cat; $cache = opendir($pasta); $a=0; $temp=0; $pg=$_REQUEST[pg]; if ($pg == 1){ while(false !== ($item = readdir($cache))){ if(($item==".")||($item==".."))continue; if(!is_dir($pasta."/".$item)){ if(substr($item,-4,4) == ".htm"){ $a++; $x=$item; $x = str_replace(".htm", "", $x); if ($x>$temp){ $temp2=$x; $a=$temp2; } } } } } if($pg==1){ $x=$a; if ($x==0){ echo ("Não há unidades cadastradas nesta categoria."); } $x++; } else { $pg=$_REQUEST[pg]; $x=$_REQUEST[x]; } while($temp<5 && ($x!==0)){ $temp++; //include arquivos $arquivo = $cat."/".$x.".htm"; if (file_exists($arquivo)){ include $arquivo; echo " --------------------------------------------------------------------------------------------------------"; } else { $x--; $arquivo = $cat."/".$x.".htm"; if (file_exists($arquivo)){ include $arquivo; echo " --------------------------------------------------------------------------------------------------------"; } } //fim include arquivos $x--; }//FIN DO WHILE ?>
| if($pg>1){ $volta=$pg-1; $xtemp=$x+10; echo" Voltar "; } //voltar ?> |
if($x>0){
$avanca=$pg+1;
echo"
Avançar
";
}
?>
|