		<div id="melodia_div">
		<?php
		
			$query = "SELECT time, log FROM mobile_visits_logs WHERE log not like '%http://4mobile%' AND log not like '%http://www.4mobile%' ORDER BY ID DESC limit 0, 2000";
			$result = $dba->GetResult($query);
			
			$ref = array();
			
			while($row = mysql_fetch_array($result))
			{
				if(!key_exists($row['time'], $ref))
				{
					$ref[$row['time']] = array();
				}
				$pos = 0;
				$count = 0;
				for($i=0; $i<strlen($row['log']); $i++)
				{
					if($row['log'][$i] == '/')
					{
						$pos = $i;
						$count ++;
					}
					if($count == 3)
					{
						break;
					}
				}
				$referer = substr($row['log'], 0, $pos);
				if(!key_exists($referer, $ref[$row['time']]))
				{
					$ref[$row['time']][$referer] = 1;
				}
				else 
				{
					$ref[$row['time']][$referer] ++;
				}
			}
			echo '<table width="100%" cellspacing="0">';
			$i = 0;
			foreach($ref as $day => $data)
			{
				arsort($data);
				$i ++;
				$color = ($i%2==0) ? ' bgcolor="#333333"' : '';
				echo '<tr'.$color.'><td width="40%" rowspan="'.sizeof($data).'" valign="top">'.$day.'</td>';
				$first = true;
				foreach($data as $k => $v)
				{
					if($first)
					{
						$first = false;
					}
					else 
					{
						echo "<tr$color>";
					}
					echo "<td>$k</td><td width=\"10%\">$v</td>";
					echo "</tr>";
				}
				echo "</tr>\n";
				if($i==7)
				{
					break;
				}
			}
			echo '</table>';
			unset($ref);
		?>
		</div>