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


	<?php 
		if(!empty($detail['0']->popis))
		{		
			$popis = explode('|', $detail['0']->popis);
			if(count($popis) > 0)
			{
				echo '<ul>';
				foreach($popis as $k => $v)
				{
					if(strlen(trim($v))>0)echo '<li> - '.$v.'</li>';
				}
				echo '</ul>';
			}
		}
		echo '<p>Reklama 728x90px</p>';
	?>

<!-- Adresa -->
<p>
	<?php 
		if(!empty($detail['0']->ulice) or !empty($detail['0']->obec) or !empty($detail['0']->psc))
			echo '<b>'.$words[9].' <a href="#mapa" onclick="showMap(\'mapa\')">['.$words[14].']</a></b><br>';
		if(!empty($detail['0']->ulice))
		{
			echo $detail['0']->ulice.'<br>';
		}
		if(!empty($detail['0']->obec))
		{
			echo $detail['0']->obec.'<br>';
		}
		if(!empty($detail['0']->psc))
		{
			echo $detail['0']->psc.'<br>';
		}
	?>
	<?php 
		if(!empty($detail['0']->ulice_post) or !empty($detail['0']->posta))
		{
			echo '<b>'.$words[10].'</b><br>';
			if(!empty($detail['0']->ulice_post))
			{
				echo $detail['0']->ulice_post.'<br>';
			}
			if(!empty($detail['0']->posta))
			{
				echo $detail['0']->posta.'<br>';
			}
		}
	?>
</p>
	
	<?php 
		if(!empty($detail['0']->tel))
		{
			echo '<fieldset><legend>'.$words[11].'</legend>';
			$tel = explode(',', $detail['0']->tel);
			if(count($tel) > 0)
			{	
				foreach($tel as $k => $v)
				{
					if($k < 5)echo $v.'<br>';
				}
			}
			echo '</fieldset>';
		}
	?>

	<?php 
		if(!empty($detail['0']->fax))
		{
			echo '<fieldset><legend>'.$words[41].'</legend>';
			$fax = explode(',', $detail['0']->fax);
			if(count($fax) > 0)
			{	
				foreach($fax as $k => $v)
				{
					if($k < 5)echo $v.'<br>';
				}
			}
			echo '</fieldset>';
		}
	?>
	
	<?php 
		if(!empty($detail['0']->email))
		{
			$email = explode(',', $detail['0']->email);
			if(count($email) > 0)
			{
				echo '<fieldset><legend>'.$words[12].'</legend>';
				foreach($email as $k => $v)
				{
					echo '<a href="mailto:'.$v.'">'.$v.'</a><br>';
				}
				echo '</fieldset>';
			}
		}
	?>

	<?php 
		if(!empty($detail['0']->www))
		{
			$www = explode(',', $detail['0']->www);
			if(count($www) > 0)
			{
				echo '<fieldset><legend>'.$words[13].'</legend>';
				foreach($www as $k => $v)
				{
					echo '<a href="http://'.trim(str_replace('http://', '', $v)).'" rel="nofollow">'.$v.'</a><br>';
				}
				echo '</fieldset>';
			}
		}
	?>

	<?php
		//zarazeni
		if(!empty($kategorie) and !empty($lokality))
		{
			echo '<fieldset class="info"><legend>'.$words[28].'</legend>';
			foreach($kategorie as $vk)
			{
				echo '<a href="http://'.$vk['cool_name'].'.'.$domains[1].'.'.$domains[2].'/" title="'.$vk['new_name'].'">'.$vk['new_name'].'</a> - ';
				foreach($lokality as $vl)
				{
					echo '<a href="http://'.$vk['cool_name'].'.'.$domains[1].'.'.$domains[2].'/katalog/'.$vl['cool_name'].'/" title="'.$vk['new_name'].' - '.$vl['lokalita'].'">'.$vl['lokalita'].'</a> ';
				}
				echo '<br>';
			}
			echo '</fieldset>';
		}
	?>
	
	<?php
		if(!empty($detail['0']->ulice_post) or !empty($detail['0']->posta))
			echo '<fieldset id="mapa" class="info"><legend><a href="#mapa" onclick="showMap(\'mapa\')">['.$words[14].']</a></legend></fieldset>';
			/*echo '<iframe id="mapa" frameborder="0"
			src="http://www.katalog.loc/"
			width="750" height="800"></iframe>';*//*http://maps.google.com/maps?q='.$detail['0']->ulice_post.' '.$detail['0']->posta.'&ie=UTF8&z=15&om=1*/
	?>
	
	<?php
		//hodnoceni
		echo '<fieldset class="info"><h2>'.$words[65].'</h2>';
		echo '<div><a href="'.base_url().'spravovat/hodnoceni/'.$detail['0']->id.'/" rel="nofollow">'.$words[77].'</a></div>';
		if($hodnoceni[0]['pocet'] > 0)
		{
			echo $words[75].': <b>'.$hodnoceni[0]['pocet'].'x</b> <br>';
			echo $words[76].': <b>'.round($hodnoceni[0]['suma'] / $hodnoceni[0]['pocet'], 2).'</b>';
		}//else echo '0';
		echo '</fieldset>';
	?>
	
	<?php
		//diskuze
		echo '<fieldset id="dis"><legend><a href="#dis" onclick="showElement(\'dis\')">'.$words[60].'</a></legend>';
		echo '<div><a href="'.base_url().'spravovat/novy_prispevek/'.$detail['0']->id.'/" rel="nofollow">'.$words[62].'</a></div>';
		if(!empty($diskuze))
		{
			foreach($diskuze as $v)
			{
				echo '<p>'.$v['text'].'<br>';
				if(empty($v['autor']))echo 'anonym ';
				else echo $v['autor'];
				echo ' '.date("d.m. Y", $v['datum']).'</p>';
			}
		}else echo $words[61];
		echo '</fieldset>';
	?>

<p>
	<a href="<?=base_url()?>spravovat/editovat/<?=$detail['0']->id?>/" rel="nofollow"><?=$words[15]?></a>
	<a href="#dis" onclick="showElement('dis')"><?=$words[60]?></a>
</p>

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