<!-- **************************** MAIN STATS *****************************-->
	  	<div id="melodia_div">
	  	<table width="100%">
		  <tr>
		    <td width="50%" valign="top">
		    <?php
			$query = "SELECT * FROM mobile_counter ORDER BY ID ASC";
			$result = $dba->GetResult($query);
			while($row = mysql_fetch_array($result))
			{	
				echo $row['name'].' : '.$row['status'].'<br />';	
			}
			?>
			</td>
		    <td valign="top">
		    <?php
		    
		    $stats = array
		    (
		    	array
		    	(
		    		'what' => 'count(ID)',
		    		'from' => 'mobile_navstev_dnes',
		    		'as'   => 'pocet_dni'
		    	),
		    	array
		    	(
		    		'what' => 'sum(navstev)',
		    		'from' => 'mobile_navstev_dnes',
		    		'as'   => 'total_navstev'
		    	),
		    	array
		    	(
		    		'what' => 'sum(navstev)',
		    		'from' => 'mobile_dload_dnes',
		    		'as'   => 'total_stiahnuti'
		    	),
		    	array
		    	(
		    		'what' => 'count(ID)',
		    		'from' => 'mobile_users',
		    		'as'   => 'total_users'
		    	),
		    	array
		    	(
		    		'what' => 'count(ID)',
		    		'from' => 'mobile_melody',
		    		'as'   => 'total_melody'
		    	),
		    	array
		    	(
		    		'what' => 'count(ID)',
		    		'from' => 'mobile_games',
		    		'as'   => 'total_games'
		    	),
		    	array
		    	(
		    		'what' => 'count(ID)',
		    		'from' => 'mobile_video',
		    		'as'   => 'total_video'
		    	),
		    	array
		    	(
		    		'what' => 'sum(status)',
		    		'from' => 'mobile_img_cat',
		    		'as'   => 'img_category'
		    	),
		    	array
		    	(
		    		'what' => 'sum(status)',
		    		'from' => 'mobile_img_res',
		    		'as'   => 'img_resol'
		    	),
		    	array
		    	(
		    		'what' => 'sum(navstev)',
		    		'from' => 'mobile_dload_dnes',
		    		'as'   => 'total_dload'
		    	),
		    );
		    
		    foreach($stats as $stat)
		    {
		    	$query = "SELECT ".$stat['what']." AS ".$stat['as']." FROM ".$stat['from'];
		    	$result = $dba->GetResult($query);
		    	$row = mysql_fetch_array($result);
		    	$xxx[$stat['as']] = $row[$stat['as']];
		    }
		    echo round($xxx['total_navstev']/$xxx['pocet_dni'], 2).' návštev/deň<br />';
		    echo round($xxx['total_stiahnuti']/$xxx['pocet_dni'], 2).' stiahnutí/deň<br />';
		    echo $xxx['total_users'].' registrovaných užívateľov<br />';
		    echo $xxx['total_melody'].' melódií<br />';
		    echo $xxx['total_games'].' hier<br />';
		    echo $xxx['total_video'].' videí<br />';
		    echo $xxx['total_dload'].' stiahnutí<br />';
		    
		    ?>
		    </td>
		  </tr>	  
	  	</table>
		</div>