View file m/stats.php

File size: 23.79Kb
<?php
session_start();
define('NTOP', 1);
$title = 'Statistics';
require_once('../system/connect.php');
require_once('../system/core.php');
require_once('../system/function.php');
require_once('head.php');


$isset = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `id` = '".$id."'");
if(mysql_num_rows($isset) == 0)
	{
		echo '<div class="topni">';
		echo 'Сайта нет в базе! <br/>';
		echo '</div>';
	}
else
	{	
		$online_sait = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait_online` WHERE `id_sait` = '".$id."'"));
		$sait_comm = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait_comments` WHERE `id_sait` = '".$id."'"));
		$user = mysql_fetch_array($isset);
		if($user['ban'] == 1)
			{
				echo '<div class="topni">';
				echo 'Сайта забанен! <br/>';
				echo '</div>';
				require_once('foot.php');
				exit;
			}
		if($user['status'] == 0)
			{
				echo '<div class="topni">';
				echo 'Вы не можете смотреть статистику данного сайта , так как он проходит модерацию! <br/>';
				echo '</div>';
				require_once('foot.php');
				exit;
			}
				echo '<div class="title2"><strong>'.$user['name'].'</strong> <small>['.$online_sait.' user online]</small></div>';
				switch($act)
					{
						default:
						
                        mysql_query("UPDATE `top_sait` SET  `count` = `count`+1 WHERE `id` = '".$id."'");
						$category = mysql_fetch_array(mysql_query("SELECT * FROM `".$prefix."cat` WHERE `id` = '".$user['category']."'"));
						$rat_plus = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."reputation` WHERE `id_sait` = '".$id."' AND `type` = 'plus'"));
						$rat_minus = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."reputation` WHERE `id_sait` = '".$id."' AND `type` = 'minus'"));
						$all_rat = $rat_plus + $rat_minus;
						if($rat_plus > 0)
							{
								$procent_plus = round(($rat_plus/$all_rat)*100,1);
							}
						else
							{
								$procent_plus = '0';
							}
						if($rat_minus > 0)
							{
								$procent_minus = round(($rat_minus/$all_rat)*100,1);
							}
						else
							{
								$procent_minus = '0';
							}
						$proverka_reputation = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."reputation` WHERE `ip` = '".$ip."' AND `time` > '".(time()-86400)."' AND `id_sait` = '".$id."'"));
						
						
						echo '<div class="main"><img src="http://mini.s-shot.ru/140x320/240/png/?http://'.$user['url'].'" align="top" alt="Скриншот сайта '.$user['url'].'"/></div>';
						
						echo '<div class="title"><strong>General</strong></div>';
						echo '<div class="main">name: <strong>'.$user['name'].'</strong><br/>';
						echo 'siteЃ: <a href="http://'.$set['home'].'/out/'.$user['id'].'"><strong>'.$user['url'].'</strong></a><br/>';
						echo 'category: <a href="http://'.$set['home'].'/m/category/view/'.$user['category'].'"><strong>'.$category['name'].'</strong></a><br/>';
						echo 'description: '.$user['about'].'</div>';
						echo '<div class="main">Views: '.$user['count'].'</div>';
						echo '<div class="title"><strong>Site Rating</strong></div>';
						echo '<div class="topni"><font color=green><strong>for</strong></font> : <strong>'.$rat_plus.'</strong> ['.$procent_plus.'%]<br/>';
						echo '<font color=red><strong>against</strong></font> : <strong>'.$rat_minus.'</strong> ['.$procent_minus.'%]';
						if($proverka_reputation == 0)
							{
								echo '<hr><strong>vote</strong>: ';
								echo '<a href="http://'.$set['home'].'/m/stats.php?act=reputation_za&id='.$id.'">for</a> | <a href="http://'.$set['home'].'/m/stats.php?act=reputation_protiv&id='.$id.'">against</a></div>';
							}
						echo '</div>';
						
						
						echo '<div class="topni"><a href="/stats/'.$id.'/com">site comments</a> ['.$sait_comm.']</div>';
						
						echo '<div class="title"><strong>Popularity in the search engines</strong></div>';
						echo '<div class="main">- Google PR: <b>'.$user['pr'].'</b><br /> 
						- Ranked: <b>'.$user['cy'].'</b><br /></div>';
						echo '<div class="title"><strong>Impress Count TIC and PR</strong></div>';
						echo '<div class="main"><a href="http://'.$set['home'].'/stat/10"><img src="http://'.$set['home'].'/info/'.$user['id'].'" alt="SEO анализ сайта '.$user['url'].'"/></a>';
						
						echo '</br>- <a href="http://'.$set['home'].'/stats/'.$id.'/seo">image codes</a></div>';


			                          echo '<div class="main">';
			echo 'info
			| <a href="http://'.$set['home'].'/stats/'.$id.'/yday">statistic</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/hours">hourly</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/ip">list IP</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/operators">operators</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/online">online</a>';
			echo '</div>';
				break;
		


case 'seo':
echo '<div class="main">Code full PR:</br>';
echo '<img src="http://'.$set['home'].'/info/'.$user['id'].'" alt="SEO &#1072;&#1085;&#1072;&#1083;&#1080;&#1079; &#1089;&#1072;&#1081;&#1090;&#1072; '.$user['url'].'"/></br>';
echo '<textarea cols="25" rows="4"><a href="http://'.$set['home'].'/stat/'.$user['id'].'"><img src="http://'.$set['home'].'/info/'.$user['id'].'" alt="SEO &#1072;&#1085;&#1072;&#1083;&#1080;&#1079; &#1089;&#1072;&#1081;&#1090;&#1072; '.$user['url'].'"/></a></textarea>';
echo '</div>';
echo '<div class="main">Code small PR:</br>';
echo '<img src="http://'.$set['home'].'/info/'.$user['id'].'/pr" alt="SEO &#1072;&#1085;&#1072;&#1083;&#1080;&#1079; &#1089;&#1072;&#1081;&#1090;&#1072; '.$user['url'].'"/></br>';
echo '<textarea cols="25" rows="4"><a href="http://'.$set['home'].'/stat/'.$user['id'].'"><img src="http://'.$set['home'].'/info/'.$user['id'].'/pr" alt="SEO &#1072;&#1085;&#1072;&#1083;&#1080;&#1079; &#1089;&#1072;&#1081;&#1090;&#1072; '.$user['url'].'"/></a></textarea>';
echo '</div>';
echo '<div class="main">Ranked Code:</br>';
echo '<img src="http://'.$set['home'].'/info/'.$user['id'].'/cy" alt="SEO &#1072;&#1085;&#1072;&#1083;&#1080;&#1079; &#1089;&#1072;&#1081;&#1090;&#1072; '.$user['url'].'"/></br>';
echo '<textarea cols="25" rows="4"><a href="http://'.$set['home'].'/stat/'.$user['id'].'"><img src="http://'.$set['home'].'/info/'.$user['id'].'/cy" alt="SEO &#1072;&#1085;&#1072;&#1083;&#1080;&#1079; &#1089;&#1072;&#1081;&#1090;&#1072; '.$user['url'].'"/></a></textarea>';
echo '</div>';
break;





		
		case 'com':		
			if(isset($_POST['ok']))
							{
								$name = isset($user_data) ? $user_data['login'] : 'site comments';
								$comment = filter($_POST['comment']);
								$test = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait_comments` WHERE `name` = '".$name."' AND `text` = '".$comment."' AND `time` > '".(time()-500)."' AND `id_sait` = '".$id."'"));
								if($test == 0)
									{
										$error = '';
										if(empty($comment))
											{
												$error .= '&#1053;&#1077;&#1090; &#1086;&#1090;&#1079;&#1099;&#1074;&#1072;<br/>';
											}
										if($user_data)
											{
												if($user_data['antiflud'] + $set['antiflud_time'] > time())
													{
														$error .= '&#1042;&#1099; &#1087;&#1080;&#1089;&#1072;&#1083;&#1080; &#1089;&#1086;&#1086;&#1073;&#1097;&#1077;&#1085;&#1080;&#1077; &#1084;&#1077;&#1085;&#1100;&#1096;&#1077; &#1095;&#1077;&#1084; '.$set['antiflud_time'].' &#1089;&#1077;&#1082;&#1091;&#1085;&#1076; &#1085;&#1072;&#1079;&#1072;&#1076;! <br/>';
													}
											}
										else
											{
												if($set['guest_antiflud'] + $set['antiflud_time'] > time())
													{
														$error .= 'you must be logged '.$set['antiflud_time'].' thats an error! <br/>';
													}									
											}
										if(mb_strlen($comment) > 100)
											{
												$error .= '&#1054;&#1090;&#1079;&#1099;&#1074; &#1089;&#1086;&#1076;&#1077;&#1088;&#1078;&#1080;&#1090; &#1073;&#1086;&#1083;&#1100;&#1096;&#1077; 100 &#1089;&#1080;&#1084;&#1074;&#1086;&#1083;&#1086;&#1074;<br/>';
											}
										if(!empty($error))
											{
												echo '<div class="topni">';
												echo $error;
												echo '</div>';
											}
										else
											{

												$comment = mysql_query("INSERT INTO `".$prefix."sait_comments` SET `name` = '".$name."', `text` = '".$comment."', `time` = '".time()."', `id_sait` = '".$id."'");
												if($user_data)
													{
														$update_antiflud = mysql_query("UPDATE `".$prefix."users` SET `antiflud` = '".time()."' WHERE `id` = '".$user_data['id']."'");
													}
												else
													{
														$update_antiflud_guest = mysql_query("UPDATE `".$prefix."settings` SET `value` = '".time()."' WHERE `name` = 'guest_antiflud'");
													}
												if($comment)
													{
														echo '<div class="main">';
														echo '&#1054;&#1090;&#1079;&#1099;&#1074; &#1076;&#1086;&#1073;&#1072;&#1074;&#1083;&#1077;&#1085;!<br/>';
														echo '</div>';
													}
												else
													{
														echo '<div class="topni">';
														echo '&#1054;&#1090;&#1079;&#1099;&#1074; &#1085;&#1077; &#1076;&#1086;&#1073;&#1072;&#1074;&#1083;&#1077;&#1085;!<br/>';
														echo '</div>';
													}
											}
									}	
							}
						echo '<div class="title2">comment area</div>';
						$count = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait_comments` WHERE `id_sait` = '".$id."'"));
						if($count > 0)
							{
								$total=intval(($count-1)/$page_sait_comments)+1; 
								$page=abs(intval($_GET['page'])); 
								if(empty($page) OR $page < 0)
									{
										$page = 1; 
									}
								if($page > $total)
									{
										$page = $total; 
									}
								$past=intval($count/$page_sait_comments);  
								$start=$page*$page_sait_comments-$page_sait_comments; 
								$comments = mysql_query("SELECT * FROM `".$prefix."sait_comments` WHERE `id_sait` = '".$id."' ORDER BY `time` DESC LIMIT ".$start.",".$page_sait_comments."");
								while($row = mysql_fetch_array($comments)) 
									{
										$start++;
										echo '<div class="topni"><span class="o">'.$start.'</span> <b>'.$row['name'].'</b> ['.data($row['time']).']</div>';
										echo '<div class="main">';
										echo $row['text'].'<br/>';
										echo '</div>';
									}
								navigation($count,$page_sait_comments,$page,'http://'.$set['home'].'/stats/'.$id.'/com/',$total);
							}
						else
							{
								echo '<div class="main">';
								echo 'add your comment!<br/>';
								echo '</div>';
							}
						if(!$user_data)
                        {
                         echo '<div class="main"><b>You must be logged in to comment on sites !!!!</b></div>';
				        }
                         else
				        {
						echo '<div class="title2">Your comments</div>';
						echo '<div class="main">';
						echo '
						<form action="/stats/'.$id.'/com" method="post">
						Enter comment [max. 100]:<br/>
						<textarea name="comment" cols="38" rows="8"></textarea><br/>
						';

						echo '<input name="ok" type="submit" value="submit" />
						</form>
						</div>';
						}
		break;	
		

				
	case 'yday':		
			
        $yday_start = mktime(0, 0, 0, date("m"), (date("d")-1), date("Y"));
		$yday_finish = mktime(23, 59, 59, date('m'), (date('d')-1), date('Y'));
		$yday_host = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."hosts` WHERE `time` BETWEEN '".$yday_start."' AND '".$yday_finish."' AND `id_sait` = '".$id."'"));
		$yday_hit = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."hits` WHERE `time` BETWEEN '".$yday_start."' AND '".$yday_finish."' AND `id_sait` = '".$id."'"));
		$yday_in = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."go` WHERE `time` BETWEEN '".$yday_start."' AND '".$yday_finish."' AND `type` = 'in' AND `id_sait` = '".$id."'"));
		$yday_out = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."go` WHERE `time` BETWEEN '".$yday_start."' AND '".$yday_finish."' AND `type` = 'out' AND `id_sait` = '".$id."'"));

		echo '<div class="main"><strong>today</strong><br />
host: '.$user['hosts'].' | hit: '.$user['hits'].'<br />
in: '.$user['in'].' | out: '.$user['out'].'</div>
<div class="main"><strong>yesterday</strong><br />
&host: '.$yday_host.' | hit: '.$yday_hit.'<br />
in: '.$yday_in.' | out: '.$yday_out.'</div>
<div class="main"><strong>total</strong><br />
host: '.$user['all_hosts'].' | hit: '.$user['all_hits'].'<br />
in: '.$user['all_in'].' | out: '.$user['all_out'].'</div>';

echo '<div class="main">';
		echo '<a href="http://'.$set['home'].'/stats/'.$id.'">info</a> | <strong>statistics</strong> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/hours">hourly</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/ip">list IP</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/operators">operators</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/online">online</a></div>';

break;
			
				
	
	  case 'hours':
	echo '<div class="title"><strong>hourly stats: [host/hits]</strong></div><div class="main">';
		for($hour = 0; $hour< 24; $hour++)
		{
		$start_time = mktime($hour, 0, 0, date("m"), date("d"), date("Y"));
		$finish_time = mktime($hour+1, 0, 0, date("m"), date("d"), date("Y"));
		$hosts = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."hosts` WHERE `time` BETWEEN '".$start_time."' AND '".$finish_time."' AND `id_sait` = '".$id."'"));
		$hits = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."hits` WHERE `time` BETWEEN '".$start_time."' AND '".$finish_time."' AND `id_sait` = '".$id."'"));
			if(strlen($hour) == 1)
			{
			$hour = '0'.$hour;
			}
			if(strlen($hour + 1) == 1)
			{
			$f = '0'.($hour + 1);
			}
				else
			{
			$f = $f + 1;
			}
     if($hosts > 0 || $hits > 0){
		echo ''.$hour.':00 - '.($f).':00: ['.$hosts.'/'.$hits.']</br><hr>';
             }
		}
		echo '</div>';
		
	echo '<div class="main">';
	echo '<a href="http://'.$set['home'].'/stats/'.$id.'">info</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/yday">statistics</a> | <strong>hourly</strong> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/ip">list IP </a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/operators">operators</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/online">online</a></div>';
		break;
	case 'ip':
		$start_time = mktime(00, 00, 00, date("m"), date("d"), date("Y"));
		$finish_time = mktime(23, 59, 59, date("m"), date("d"), date("Y"));
		$al = mysql_query("SELECT COUNT(`ip`) FROM `".$prefix."hits` WHERE `time` BETWEEN '".$start_time."' AND '".$finish_time."' AND `id_sait` = '".$id."'");
		$all = mysql_result($al,0);
		$count = mysql_num_rows(mysql_query("SELECT DISTINCT `ip` as `ip`, COUNT(`ip`) AS `count` FROM `".$prefix."hits` WHERE `time` BETWEEN '".$start_time."' AND '".$finish_time."' AND `id_sait` = '".$id."' GROUP BY `ip`"));
			if($count > 0)
		{
		echo '<div class="title"><strong>IP: [range/percentages]</strong></div><div class="main">';
	$total=intval(($count-1)/$pages)+1; 
	$page=abs(intval($_GET['page'])); 
	if(empty($page) OR $page < 0)
	{
	$page = 1; 
	}
	if($page > $total)
	{
	$page = $total; 
	}
	$past=intval($count/$pages);  
	$start=$page*$pages-$pages; 
	     $query = mysql_query("SELECT DISTINCT `ip` as `ip`, COUNT(`ip`) AS `count` FROM `".$prefix."hits` WHERE `time` BETWEEN '".$start_time."' AND '".$finish_time."' AND `id_sait` = '".$id."'  GROUP BY `ip` LIMIT ".$start.",".$pages."");
		while($stata = mysql_fetch_array($query))
		{
		$procent = ($stata['count'] / $all) * 100;
		echo ''.$stata['ip'].': [<b>'.$stata['count'].'</b>/<b>'.round($procent, 1).'%</b>]</br><hr>';
		}
		echo '</div>';
	navigation($count,$pages,$page,'http://'.$set['home'].'/stats/'.$id.'/ip/',$total);
		}
	else
		{
		echo '&#1053;&#1077;&#1090; &#1089;&#1090;&#1072;&#1090;&#1080;&#1089;&#1090;&#1080;&#1082;&#1080; &#1087;&#1086; IP &#1076;&#1083;&#1103; &#1101;&#1090;&#1086;&#1075;&#1086; &#1089;&#1072;&#1081;&#1090;&#1072; &#1089;&#1077;&#1075;&#1086;&#1076;&#1085;&#1103;.<br/>';
		}
	echo '<div class="main">';
	echo '<a href="http://'.$set['home'].'/stats/'.$id.'">info</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/yday">statistics</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/hours">hourly</a> | <strong>list IP</strong> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/operators">operators</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/online">online</a></div>';
	break;
	     case 'operators':
$start_time = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$finish_time = mktime(23, 59, 59, date("m"), date("d"), date("Y"));
$all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."hits` WHERE `time` BETWEEN '".$start_time."' AND '".$finish_time."' AND `id_sait` = '".$id."'"));
$opera = mysql_query("SELECT DISTINCT `".$prefix."hits`.`operator`, COUNT(`".$prefix."hits`.`operator`) AS `count`, `".$prefix."ip_name`.`operator` as `name` FROM `".$prefix."hits`, `".$prefix."ip_name` WHERE `".$prefix."hits`.`id_sait` = '".$id."' AND `".$prefix."hits`.`time` BETWEEN '".$start_time."' AND '".$finish_time."' AND `".$prefix."hits`.`operator` = `".$prefix."ip_name`.`id` GROUP BY `".$prefix."hits`.`operator` ORDER BY 2 DESC");
$oper_count = mysql_num_rows($opera);
if($oper_count > 0)
{
echo '<div class="title">operators: [handlers]</div><div class="main">';
	$total=intval(($oper_count-1)/$pages)+1; 
	$page=abs(intval($_GET['page'])); 
	if(empty($page) OR $page < 0)
		{
	$page = 1; 
		}
	if($page > $total)
		{
	$page = $total; 
		}
	$past=intval($oper_count/$pages);  
	$start=$page*$pages-$pages; 
$oper = mysql_query("SELECT DISTINCT `".$prefix."hits`.`operator`, COUNT(`".$prefix."hits`.`operator`) AS `count`, `".$prefix."ip_name`.`operator` as `name` FROM `".$prefix."hits`, `".$prefix."ip_name` WHERE `".$prefix."hits`.`id_sait` = '".$id."' AND `time` BETWEEN '".$start_time."' AND '".$finish_time."' AND `".$prefix."hits`.`operator` = `".$prefix."ip_name`.`id` GROUP BY `".$prefix."hits`.`operator` ORDER BY 2 DESC LIMIT ".$start.",".$pages."");
while($op = mysql_fetch_array($oper)){

$strana = mysql_fetch_array(mysql_query("SELECT * FROM `".$prefix."ip_name` WHERE `operator` = '".$op['name']."'"));

$procent = ($op['count'] / $all) * 100;
echo '['.$strana['coun'].']'.$op['name'].' ('.$strana['country'].'): [<b>'.$op['count'].'/'.round($procent, 2).'%</b>]</br><hr>';}
echo '</div>';
navigation($oper_count,$pages,$page,'http://'.$set['home'].'/stats/'.$id.'/operators/',$total);
}else{
echo '<div class="main">&#1053;&#1077;&#1090; &#1089;&#1090;&#1072;&#1090;&#1080;&#1089;&#1090;&#1080;&#1082;&#1080; &#1087;&#1086; &#1086;&#1087;&#1077;&#1088;&#1072;&#1090;&#1086;&#1088;&#1072;&#1084; &#1076;&#1083;&#1103; &#1101;&#1090;&#1086;&#1075;&#1086; &#1089;&#1072;&#1081;&#1090;&#1072; &#1089;&#1077;&#1075;&#1086;&#1076;&#1085;&#1103;.</div>';}

	echo '<div class="main"> <a href="http://'.$set['home'].'/stats/'.$id.'">info</a>  
| <a href="http://'.$set['home'].'/stats/'.$id.'/yday">statistics</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/hours">hourly</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/ip">list IP</a> | <strong>operators</strong> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/online">online</a></div>';
	break;


		case 'online':
		$all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait_online` WHERE `id_sait` = '".$id."'"));
		if($all != 0)
			{ 
	echo '<div class="title">UA: [IP/time]</div><div class="main">';
		$total=intval(($all-1)/$pages)+1; 
		$page=abs(intval($_GET['page'])); 
		if(empty($page) OR $page < 0)
			{
		$page = 1; 
			}
		if($page > $total)
			{
		$page = $total; 
			}
		$past=intval($all/$pages);  
		$start=$page*$pages-$pages; 
		   $onl = mysql_query("SELECT * FROM `".$prefix."sait_online` WHERE `id_sait` = '".$id."' LIMIT ".$start.",".$pages."");
			while($row = mysql_fetch_array($onl)) 
				{
	echo ''.$row['ua'].': ['.$row['ip'].'/'.data($row['time']).']</br><hr>';
									}
								echo '</div>';

		navigation($all,$pages,$page,'http://'.$set['home'].'/stats/'.$id.'/online/',$total);
		}
			else
		{
	echo '&#1053;&#1077;&#1090; &#1089;&#1090;&#1072;&#1090;&#1080;&#1089;&#1090;&#1080;&#1082;&#1080; &#1087;&#1086; &#1086;&#1085;&#1083;&#1072;&#1081;&#1085; &#1076;&#1083;&#1103; &#1101;&#1090;&#1086;&#1075;&#1086; &#1089;&#1072;&#1081;&#1090;&#1072; &#1089;&#1077;&#1075;&#1086;&#1076;&#1085;&#1103;.<br/>';
		}
	
	echo '<div class="main">';
		echo '<a href="http://'.$set['home'].'/stats/'.$id.'">info</a>  
| <a href="http://'.$set['home'].'/stats/'.$id.'/yday">statistics</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/hours">hourly</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/ip">list IP</a> 
| <a href="http://'.$set['home'].'/stats/'.$id.'/operators">operators</a> | <strong>online</strong></div>';
	
	break;
	
	          case 'reputation_za':
						$proverka_reputation = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."reputation` WHERE `ip` = '".$ip."' AND `time` > '".(time()-86400)."' AND `id_sait` = '".$id."'"));
						if($proverka_reputation == 0)
							{
								$repa = mysql_query("INSERT INTO `".$prefix."reputation` SET `type` = 'plus', `ip` = '".$ip."', `time` = '".time()."', `id_sait` = '".$id."'");
								if($repa)
									{
										echo '<div class="main">';
										echo '&#1056;&#1077;&#1087;&#1091;&#1090;&#1072;&#1094;&#1080;&#1103; &#1089;&#1072;&#1081;&#1090;&#1072; &#1091;&#1089;&#1087;&#1077;&#1096;&#1085;&#1086; &#1087;&#1086;&#1074;&#1099;&#1096;&#1077;&#1085;&#1072; &#1085;&#1072; 1 &#1077;&#1076;&#1080;&#1085;&#1080;&#1094;&#1091;!<br/>';
										echo '</div>';
									}
								else
									{
										echo '<div class="main">';
										echo '&#1056;&#1077;&#1087;&#1091;&#1090;&#1072;&#1094;&#1080;&#1103; &#1085;&#1077; &#1080;&#1079;&#1084;&#1077;&#1085;&#1077;&#1085;&#1072;!<br/>';
										echo '</div>';
									}
							}
							else
							{
								echo '<div class="main">';
								echo '&#1042;&#1099; &#1091;&#1078;&#1077; &#1075;&#1086;&#1083;&#1086;&#1089;&#1086;&#1074;&#1072;&#1083;&#1080; &#1079;&#1072; &#1101;&#1090;&#1086;&#1090; &#1089;&#1072;&#1081;&#1090; , &#1075;&#1086;&#1083;&#1086;&#1089;&#1086;&#1074;&#1072;&#1090;&#1100; &#1084;&#1086;&#1078;&#1085;&#1086; 1 &#1088;&#1072;&#1079; &#1079;&#1072; 24 &#1095;&#1072;&#1089;&#1072;!<br/>';
								echo '</div>';
							}
						
						echo '<div class="topni"><a href="http://'.$set['home'].'/stats/'.$id.'">&#1050; &#1089;&#1090;&#1072;&#1090;&#1080;&#1089;&#1090;&#1080;&#1082;&#1077; &#1089;&#1072;&#1081;&#1090;&#1072;</a></div>';
						break;
						case 'reputation_protiv':
						$proverka_reputation = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."reputation` WHERE `ip` = '".$ip."' AND `time` > '".(time()-86400)."' AND `id_sait` = '".$id."'"));
						if($proverka_reputation == 0)
							{
								$repa = mysql_query("INSERT INTO `".$prefix."reputation` SET `type` = 'minus', `ip` = '".$ip."', `time` = '".time()."', `id_sait` = '".$id."'");
								if($repa)
									{
										echo '<div class="main">';
										echo '&#1056;&#1077;&#1087;&#1091;&#1090;&#1072;&#1094;&#1080;&#1103; &#1089;&#1072;&#1081;&#1090;&#1072; &#1091;&#1089;&#1087;&#1077;&#1096;&#1085;&#1086; &#1087;&#1086;&#1085;&#1080;&#1078;&#1077;&#1085;&#1072; &#1085;&#1072; 1 &#1077;&#1076;&#1080;&#1085;&#1080;&#1094;&#1091;!<br/>';
										echo '</div>';
									}
								else
									{
										echo '<div class="main">';
										echo '&#1056;&#1077;&#1087;&#1091;&#1090;&#1072;&#1094;&#1080;&#1103; &#1085;&#1077; &#1080;&#1079;&#1084;&#1077;&#1085;&#1077;&#1085;&#1072;!<br/>';
										echo '</div>';
									}
							}
							else
							{
								echo '<div class="main">';
								echo '&#1042;&#1099; &#1091;&#1078;&#1077; &#1075;&#1086;&#1083;&#1086;&#1089;&#1086;&#1074;&#1072;&#1083;&#1080; &#1079;&#1072; &#1101;&#1090;&#1086;&#1090; &#1089;&#1072;&#1081;&#1090; , &#1075;&#1086;&#1083;&#1086;&#1089;&#1086;&#1074;&#1072;&#1090;&#1100; &#1084;&#1086;&#1078;&#1085;&#1086; 1 &#1088;&#1072;&#1079; &#1079;&#1072; 24 &#1095;&#1072;&#1089;&#1072;!<br/>';
								echo '</div>';
							}
						
						echo '<div class="topni"><a href="http://'.$set['home'].'/stats/'.$id.'">statistical info</a></div>';
						break;
	
	
					}
	}

require_once('foot.php');
?>