<!--******************************POČTY POZADI A KATEGORII************************************-->
		<div id="melodia_div">
			<?php 
			
			foreach($categories as $key_cat => $category)
			{
				foreach($rozlisenia as $resolution)
				{
					$poc_poz[$key_cat][$resolution['res']] = 0;
					$poc_res[$resolution['res']] = 0;
				}
				$poc_cat[$key_cat] = 0;
			}
			
			$total = 0;
			$query = "SELECT cat, res FROM mobile_pozadia where cat<>0 and res<>2";
			$result = $dba->GetResult($query);
			while($row=mysql_fetch_array($result))
			{
				$poc_poz[$row['cat']][$row['res']]++;
				$poc_cat[$row['cat']]++;
				$poc_res[$row['res']]++;
				$total++;
			}
			
			echo "<table id=\"stats_table01\" border='0' cellspacing=\"0\" cellpadding=\"0\">";
			echo "<tr>";
			echo "<td>&nbsp;</td>";
			foreach($rozlisenia as $rozlisenie) echo "<td align=\"center\"><b>".$rozlisenie['menu']."</b></td>";
			echo "<td align=\"center\"><b>spolu</b></td>";
			echo "</tr>";
			foreach($categories as $key_cat => $category)
			{
				echo "<tr id=\"stats_table01\" width='100'><td><b>".$category."</b></td>";
				foreach($rozlisenia as $key_res => $resolution)
				{
					echo "<td align=\"center\">".$poc_poz[$key_cat][$resolution['res']]."</td>";
				}
				echo "<td align=\"center\"><b>".$poc_cat[$key_cat]."</b></td>";
				echo "</tr>";
			}
			echo "<tr><td><b>spolu:</b></td>";
			foreach($poc_res as $k => $pr) echo "<td align=\"center\"><b>$pr</b></td>";
			echo "<td align=\"center\" id=\"red\"><b>$total<b/></td>";
			echo "</tr>";
			echo "</table>";
			
			unset($poc_cat);
			unset($poc_poz);
			unset($poc_res);
			?>
		</div>
		
		
		<!--*******************************************************************************************-->