<?php include_once('header.php'); ?>

<h1><?= $h1 ?></h1>

<?php 

if(!empty($result) and count($result)>0)
{
	//Strankovanie
	if(!empty($itemsPerPage) and $pocetStranok > 1)
	{
		echo '<p class="info centered">';
		if(($do - $itemsPerPage) > 0)
		{
			echo '<a href="'.base_url().$controller.'/'.$this->uri->segment(2).'/">'.$words[17].'</a>&nbsp;&nbsp;';	
		}
		for($i=$start;$i<$do;$i++)
		{
			echo '<a href="'.base_url().$controller.'/'.$this->uri->segment(2);
			if($i > 0)echo '/'.$i;
			echo '/">';
			if($aktPage == $i)echo '<b>['.($i+1).']</b></a>&nbsp;&nbsp;';
			else echo ($i+1).'</a>&nbsp;&nbsp;';
		}
		if(($start + $itemsPerPage) < $pocetStranok)
		{
			echo '<a href="'.base_url().$controller.'/'.$this->uri->segment(2).'/'.($pocetStranok-1).'/">'.$words[18].'</a>&nbsp;';
		}
		echo '</p>';
	}
	?>
	
	<div id="ads"><?php include_once('ads_vypis_right.php'); ?></div>	
	
	<?php
	
	include_once('vypis.php');
	
	//Strankovanie
	if(!empty($itemsPerPage) and $pocetStranok > 1)
	{
		echo '<p class="info centered">';
		if(($do - $itemsPerPage) > 0)
		{
			echo '<a href="'.base_url().$controller.'/'.$this->uri->segment(2).'/">'.$words[17].'</a>&nbsp;&nbsp;';	
		}
		for($i=$start;$i<$do;$i++)
		{
			echo '<a href="'.base_url().$controller.'/'.$this->uri->segment(2);
			if($i > 0)echo '/'.$i;
			echo '/">';
			if($aktPage == $i)echo '<b>['.($i+1).']</b></a>&nbsp;&nbsp;';
			else echo ($i+1).'</a>&nbsp;&nbsp;';
		}
		if(($start + $itemsPerPage) < $pocetStranok)
		{
			echo '<a href="'.base_url().$controller.'/'.$this->uri->segment(2).'/'.($pocetStranok-1).'/">'.$words[18].'</a>&nbsp;';
		}
		echo '</p>';
	}
}else echo '<p class="info">'.$words[22].'.</p>';

?>

<?php include_once('footer.php'); ?>
