		<!-- **************************** MESACNY VYPIS NAVSTEV *****************************-->
		<div id="melodia_div">
		<?php
			
			$query = "SELECT datum, navstev, stranok FROM mobile_navstev_dnes WHERE stranok > 0";
			$result = $dba->GetResult($query);
			$statx = array();
			while($row = mysql_fetch_array($result))
			{
				$dat = explode('.', $row['datum']);
				if(!key_exists($dat[2], $statx))
				{
					$statx[$dat[2]] = array();
					$year_echo[$dat[2]] = true;
				}
				if(!key_exists($dat[1], $statx[$dat[2]]))
				{
					$statx[$dat[2]][$dat[1]] = array();
				}
				
				if(!key_exists('navstev', $statx[$dat[2]][$dat[1]]))
				{
					$statx[$dat[2]][$dat[1]]['navstev'] = $row['navstev'];
				}
				else 
				{
					$statx[$dat[2]][$dat[1]]['navstev'] += $row['navstev'];
				}
				if(!key_exists('stranok', $statx[$dat[2]][$dat[1]]))
				{
					$statx[$dat[2]][$dat[1]]['stranok'] = $row['stranok'];
				}
				else 
				{
					$statx[$dat[2]][$dat[1]]['stranok'] += $row['stranok'];
				}
			}
//			dump($statx);
			echo "<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\">";
			echo "<tr><td><b>Rok</b></td><td><b>Mesiac</b></td><td><b>Návštev</b></td><td><b>Stránok</b></td><td><b>Str/Návšteva</b></td></tr>";
			foreach($statx as $rok => $mesiace)
			{
				$stripe = false;
				foreach($mesiace as $mesiac => $udaje)
				{
					$bg_color = ($stripe) ? ' bgcolor="#333333"' : '';
					$stripe = !$stripe;
					echo "<tr>";
					if($year_echo[$rok])
					{
						$stripe = !$stripe;
						echo "<td rowspan=\"".sizeof($statx[$rok])."\">$rok</td>";
						$year_echo[$rok] = false;
					}
					echo "<td>$mesiac</td><td>".$udaje['navstev']."</td><td>".$udaje['stranok']."</td><td width='15%'>".round($udaje['stranok']/$udaje['navstev'], 2)."</td></tr>";
				}
			}
			echo "</table>";
		
		?>
		</div>