    <div id="register_form01">
	  <div id="menu01_head">:: statspanel</div>
	  <div id="melodie_01">
		
		<?php 
		
		$stats_modules = array
		(
			0 => array
			(
				'name' => 'Denný výpis návštev',
				'script_name' => 'daily_visits',
			),
			1 => array
			(
				'name' => 'Denný výpis návštev grafy',
				'script_name' => 'daily_visits_graphs',
			),
			2 => array
			(
				'name' => 'Mesačný výpis návštev',
				'script_name' => 'monthly_visits',
			),
			3 => array
			(
				'name' => 'Posledné stiahnutia',
				'script_name' => 'last_dload',
			),
			4 => array
			(
				'name' => 'Odkazovače',
				'script_name' => 'referers',
			),
			5 => array
			(
				'name' => 'Melódie čo nemáme',
				'script_name' => 'not_owned_melodies',
			),
//			13 => array
//			(
//				'name' => 'Melódie čo máme',
//				'script_name' => 'owned_melodies',
//			),
			6 => array
			(
				'name' => 'Reklama',
				'script_name' => 'ads',
			),
//			7 => array
//			(
//				'name' => 'Ankety',
//				'script_name' => 'ankety',
//			),
			8 => array
			(
				'name' => 'Rozlíšenia a kategórie',
				'script_name' => 'res_cat',
			),
			14 => array
			(
				'name' => 'Žánre a typy melódií',
				'script_name' => 'melody_count',
			),
			9 => array
			(
				'name' => 'Počet pozadí',
				'script_name' => 'images_count',
			),
			11 => array
			(
				'name' => 'Môj mobil',
				'script_name' => 'moj_mobil',
			),
			12 => array
			(
				'name' => 'Hľadané výrazy v google',
				'script_name' => 'google',
			),
			
		);
		
		require_once('stats_modules/main.php');
		
		if(session_is_registered('my_id') && in_array($_SESSION['my_id'], $admins)) 
		{  
			echo '<div id="melodia_div">';
			echo '<form action="index.php?module=stats" method="POST">';
			echo '<table width="100%" align="center"><tr><td width="50%" align="left">';
			$i = 0;
			foreach($stats_modules as $stat_key => $stat)
			{
				$i++;
				echo '<input type="checkbox" name="data['.$stat_key.']" value="1"';
				if((isset($_POST['data'][$stat_key]) && $_POST['data'][$stat_key] == 1) || !isset($_POST['submit']))
				{
					if((isset($_SESSION['show_stats']) && in_array($stat_key, $_SESSION['show_stats'])) || !isset($_SESSION['show_stats']) || (isset($_POST['data'][$stat_key]) && $_POST['data'][$stat_key] == 1))
					{
						echo 'checked';
					}
				}
				echo ' /> '.$stat['name'].'<br />';
				if($i == ceil(sizeof($stats_modules)/2))
				{
					echo '</td><td align="left">';
				}
			}
			echo '</td></tr><tr><td colspan="2" align="center"><input id="form_button01" type="submit" name="submit" value="Zobraz" /></td></tr></table>';
			echo '</form></div>';
			
			if(isset($_POST['data']) || isset($_SESSION['show_stats']))
			{
				if(isset($_SESSION['show_stats']) && !isset($_POST['submit']))
				{
					foreach($_SESSION['show_stats'] as $data)
					{
						require('stats_modules/'.$stats_modules[$data]['script_name'].'.php');
					}
				}
				if(isset($_POST['submit']))
				{
					$_SESSION['show_stats'] = array();
					foreach($_POST['data'] as $data_id => $data)
					{
						$_SESSION['show_stats'][] = $data_id;
						if($data==1)
						{
							require('stats_modules/'.$stats_modules[$data_id]['script_name'].'.php');
						}
					}
				}
			}
		} 
		?>
	  </div>
	</div>