echo "

Wykonane budowy

Wybierz jedną z poniższych galerii

"; global $page, $gp_index, $gp_menu, $dirPrefix, $langmessage; $results = common::Descendants($page->gp_index,$gp_menu); $total = count($results)+0; $len = 20; $total_pages = ceil($total/$len); $current_page = 0; if( isset($_REQUEST['pg']) && is_numeric($_REQUEST['pg']) ){ if( $_REQUEST['pg'] <= $total_pages ){ $current_page = $_REQUEST['pg']; }else{ $current_page = ($total_pages-1); } } $start = $current_page*$len; $end = min($start+$len,$total); $results = array_slice($results,$start,$len,true); echo ''; foreach ($results as $index) { $title = array_search($index, $gp_index); //echo ''; echo ''.$title.'
'; } if( $total_pages > 1 ){ echo '

'; for($i=0;$i<$total_pages;$i++){ if( $i == $current_page ){ echo ''.($i+1).' '; continue; } $query = ''; if( $i > 0 ){ $query .= '&pg='.$i; } echo common::Link($page->title,($i+1),$query).' '; } echo '

'; }