
<?php




/* Script security */
if(!defined("MONENGINE")) {
	header("Location: index.php");
	exit();
}
/* Other code */












$vkcom  = '<div id="vk_comments"></div>
<script type="text/javascript">
VK.Widgets.Comments("vk_comments", {limit: 15, width: "772", attach: "*"});
</script>';
require_once LOCALE.LOCALESET."serv.php";

$server_id = $_GET['id'];
	
$take_server = dbquery("SELECT * FROM ".DB_SERVERS." WHERE server_id = ".mysql_real_escape_string($server_id)."");
if(mysql_num_rows($take_server) == 0) {
	displayMessage('Выбранный сервер не существует, либо был удалён.', 'error');
} else {
	$server_data = dbarray_fetch($take_server);

	$site = "";	
	if($server_data['server_site'] !="") {
		$site = "<a href='http://".$server_data['server_site']."' target='_blank'>".$server_data['server_site']." </a>";
	}
		
	$icq = "";
	if($server_data['server_icq'] !="") {
		$icq = $server_data['server_icq']." <img src='http://status.icq.com/online.gif?icq=".$server_data['server_icq']."&img=26'>";
	}
	$status="<font color='#B53333'><b>Offline</b></font>";
	if($server_data['server_status'] == 1) $status = "<font color='#6e8d4c'><b>Online</b></font>";

	$last_update = $settings['last_update'];
	$time_diff = time() - $last_update;
	
	if($time_diff >= 60) {
		$time_lasted = floor($time_diff / 60)." минут";
	} else {
		$time_lasted = $time_diff." секунд";
	}
	
	
	
	echo "
				<div class='progress progress-striped active'>
  <div class='bar' style='width: 100%; '>Сервер: <b>{$server_data['server_name']}</b></div>
</div>

			<div class='cont'>

		 ";
	// Start of server page



// kkenchi end

	echo "<table cellspacing='0' cellpadding='0' width='100%' class='info_tbl'>";
	// Left col (info)
	echo "<td valign='top' width='340' style='padding-bottom:20px;'>";
	
	
	$percent_loaded = floor(($server_data['server_players'] / $server_data['server_maxplayers']) * 100);
	
	switch($percent_loaded) {
		case ($percent_loaded <= 40):
			$load_color = 'green';
			break;
		case ($percent_loaded <= 80):
			$load_color = 'yellow';
			break;
		case ($percent_loaded <= 100):
			$load_color = 'red';
			break;
		default:
			$load_color = 'green';
			break;
	}



		echo "<center><img src='/images/maps/monitor.png'><img src='/images/maps/cs16/{$server_data['server_map']}.jpg' style='width: 181px;
height: 114px;
opacity: 1;
border: none;
position: relative;
bottom: 181px;'></center>";

	echo	

	"
			<div style='position: relative;	bottom: 100px;'>
			<div style='text-align:center;padding-right:50px;'>
				<table align='center' cellpadding='0' cellspacing='0' width='236' height='30'>
					<tr class=''progress progress-striped active'>
						<td class='load_bar load_$load_color' width='".(($percent_loaded == 0) ? "1" : "$percent_loaded")."%' valign='middle'>
							<div style='position:absolute;'>
								<nobr>Загруженность сервера $percent_loaded%</nobr>
							</div>&nbsp;
						</td>
						<td>&nbsp;</td>
					</tr>
				</table>
			</div>
			
			<div class='block_line'>
				<div class='block address'>
					<div class='t'>Адрес сервера:</div>
					<div class='block_line_small'>{$server_data['server_ip']}</div>
				</div>
			</div>			

			<div class='block_line'>
				<div class='block map'>
					<div class='t'>Текущая карта:</div>
					<div class='block_line_small'>{$server_data['server_map']}</div>
				</div>
			</div>

			<div class='block_line'>
				<div class='block players'>
					<div class='t'>Игроки:</div>
					<div class='block_line_small'>{$server_data['server_players']}/{$server_data['server_maxplayers']}</div>
				</div>
			</div>

			
			";
	if(!empty($site)) {
		echo "
			<div class='block_line' style='margin-bottom:0;'>
				<div class='block site'>
					<div class='t'>Сайт сервера:</div>
					<div class='dup'><small>$site</small></div><br>

				</div>
			</div>

			<div class='block_line' style='margin-bottom:0;'>
				<div class='block skype'>
					<div class='t'>Cкайп Админа:</div>
					<div class='dup1'>{$server_data['server_skype']}</div><br>

				</div>
			</div>

			</div>



	";
	
				
			
	}
	echo "</td>";

		echo "
			<div class='box_rounded'>
				<div class='box_title'>Информация о сервере <b>{$server_data['server_name']}</b>  :</div>
				<br><br>id сервера: {$server_data['server_id']}<br />
				Статус сервера: $status<br />
				".((!empty($icq)) ? "Связь с администратором сервера <b>ICQ#$icq</b><br />" : "")."	
				Дата регистрации: <b>".@date("d.m.Y H:i", $server_data['server_regdata'])."</b><br />
				".(($server_data['server_status'] == 1) ? "Работает" : "Не работает")." с ".@date("d.m.Y H:i", $server_data['status_change'])."<br />
				Информация о сервере загружена $time_lasted назад<br />	
			</div>
			<div class='box_rounded'>
			<center><div class='tiss'>Зайти на сервер <b>{$server_data['server_name']}</b>  :</div></center><br>
			<center>{$server_data['server_ip']}</center>
					<center><a href='steam://connect/{$server_data['server_ip']}'><div class='con'></div></a></center><br>
					<center><a href='http://csserva4ok.ru/'>Дешовый Хостинг Игровых серверов</a></center><br>


			</div>
			<div class='box_rounded'>
			<center>

			".(!empty($server_data['about']) ? "
				<div style='padding-bottom:3px;'><b><div class='tiss'>Описание сервера владельцом:</div></b></div><br>
				<center>{$server_data['server_ip']}<br>{$server_data['server_name']}</center>
			<span style='color:#999999;'>{$server_data['about']}</span>

			</center>
			</div>

			<div style='clear:both;'></div>" : "")."
	";

	

	
	// Center col /*(banners)*/ comments
	echo "<td valign='top' style='padding-top: 20px; padding-right:10px;'><div style='padding:10px;background-color: #84a0d8;-webkit-border-radius: 6px;-moz-border-radius: 6px;border-radius: 6px; '>";
	$com_error = '';
	$errors = Array();
	if(count($_POST)>0){
		$com_name = $_POST['com_name'];
		
		
			 {
			$server_id = mysql_real_escape_string($server_id);
			$com_name = mysql_real_escape_string(htmlspecialchars($com_name));
			$result = mysql_query("INSERT INTO ".DB_COMMENTS." (server_id, username, text, date) VALUES ('$server_id', '$com_name', '$com_text', '".time()."')");
		}
		if (isset($_POST['but1']))
{
print "";
} 
	}

   

	echo "
	<div style='font-size: 18px;color:#EEEEEE;padding-bottom:5px;position:'>Оставить отзыв о сервере:</div>
	".$vkcom."<br>

	<div style='font-size: 18px;color:#EEEEEE;padding-bottom:5px;'>Кнопки Проголосуй:</div>
	<div style='padding:10px;background-color: #5e77a7;-webkit-border-radius: 6px;-moz-border-radius: 6px;border-radius: 6px;'>
	<center> Кнопки Проголосуй - Ставь на Свои Сайты и Форумы</center>
	<hr><br>
	<center><div style='padding-top:4px;'></div>
	<img id='toglink0' src='/dk/userbar.gif' /></a>
<div class='togblock' id='togblock0'>
	<br>HTML-код:<br>
	<textarea rows='1' cols='76'><a href='http://g-mon.ru/server/{$server_data['server_ip']}' target='_blank'><img src='http://g-mon.ru/dk/userbar.gif' /></a></textarea></p>
	BB-код:<br>
	<textarea rows='1' cols='76'>[url=http://g-mon.ru/server/{$server_data['server_ip']}/][img]http://g-mon.ru/dk/userbar.gif[/img][/url]</textarea></p><br>
	</div><br>

						<div class='block_line_small'>
<div align='center'><span><a style='cursor:pointer;color:#04ff00;size:12px;' onclick='userbar1(this)'><img id='toglink0' src='/dk/userbar/1.jpg' /></a><div style='display: none;'>
<br>
<font color='#ffffff'><b>HTML-код:</b></font><br>
<textarea rows='1' cols='76'><a href='".$settings['site_url']."server/{$server_data['server_ip']}' target='_blank'><img src='".$settings['site_url']."dk/userbar/1.jpg' /></a></textarea></p>
<br>
<font color='#ffffff'><b>BB-код:</b></font><br>
<textarea rows='1' cols='76'>[url=".$settings['site_url']."server/{$server_data['server_ip']}/][img]".$settings['site_url']."dk/userbar/1.jpg[/img][/url]</textarea></p><br>
</div></span></div>



<div align='center'><span><a style='cursor:pointer;color:#04ff00;size:12px;' onclick='userbar2(this)'><img id='toglink0' src='/dk/userbar/2.jpg' /></a><div style='display: none;'>
<br>
<font color='#ffffff'><b>HTML-код:</b></font><br>
<textarea rows='1' cols='76'><a href='".$settings['site_url']."server/{$server_data['server_ip']}' target='_blank'><img src='".$settings['site_url']."dk/userbar/2.jpg' /></a></textarea></p>
<br>
<font color='#ffffff'><b>BB-код:</b></font><br>
<textarea rows='1' cols='76'>[url=".$settings['site_url']."server/{$server_data['server_ip']}/][img]".$settings['site_url']."dk/userbar/2.jpg[/img][/url]</textarea></p><br>
</div></span></div>



<div align='center'><span><a style='cursor:pointer;color:#04ff00;size:12px;' onclick='userbar3(this)'><img id='toglink0' src='/dk/userbar/3.jpg' /></a><div style='display: none;'>
<br>
<font color='#ffffff'><b>HTML-код:</b></font><br>
<textarea rows='1' cols='76'><a href='".$settings['site_url']."server/{$server_data['server_ip']}' target='_blank'><img src='".$settings['site_url']."dk/userbar/3.jpg' /></a></textarea></p>
<br>
<font color='#ffffff'><b>BB-код:</b></font><br>
<textarea rows='1' cols='76'>[url=".$settings['site_url']."server/{$server_data['server_ip']}/][img]".$settings['site_url']."dk/userbar/3.jpg[/img][/url]</textarea></p><br>
</div></span></div>



<div align='center'><span><a style='cursor:pointer;color:#04ff00;size:12px;' onclick='userbar4(this)'><img id='toglink0' src='/dk/userbar/4.jpg' /></a><div style='display: none;'>
<br>
<font color='#ffffff'><b>HTML-код:</b></font><br>
<textarea rows='1' cols='76'><a href='".$settings['site_url']."server/{$server_data['server_ip']}' target='_blank'><img src='".$settings['site_url']."dk/userbar/4.jpg' /></a></textarea></p>
<br>
<font color='#ffffff'><b>BB-код:</b></font><br>
<textarea rows='1' cols='76'>[url=".$settings['site_url']."server/{$server_data['server_ip']}/][img]".$settings['site_url']."dk/userbar/4.jpg[/img][/url]</textarea></p><br>
</div></span></div>


<div align='center'><span><a style='cursor:pointer;color:#04ff00;size:12px;' onclick='userbar5(this)'><img id='toglink0' src='/dk/userbar/5.jpg' /></a><div style='display: none;'>
<br>
<font color='#ffffff'><b>HTML-код:</b></font><br>
<textarea rows='1' cols='76'><a href='".$settings['site_url']."server/{$server_data['server_ip']}' target='_blank'><img src='".$settings['site_url']."dk/userbar/5.jpg' /></a></textarea></p>
<br>
<font color='#ffffff'><b>BB-код:</b></font><br>
<textarea rows='1' cols='76'>[url=".$settings['site_url']."server/{$server_data['server_ip']}/][img]".$settings['site_url']."dk/userbar/5.jpg[/img][/url]</textarea></p><br>
</div></span></div>

<div align='center'><span><a style='cursor:pointer;color:#04ff00;size:12px;' onclick='userbar6(this)'><img id='toglink0' src='/dk/userbar/6.jpg' /></a><div style='display: none;'>
<br>
<font color='#ffffff'><b>HTML-код:</b></font><br>
<textarea rows='1' cols='76'><a href='".$settings['site_url']."server/{$server_data['server_ip']}' target='_blank'><img src='".$settings['site_url']."dk/userbar/6.jpg' /></a></textarea></p>
<br>
<font color='#ffffff'><b>BB-код:</b></font><br>
<textarea rows='1' cols='76'>[url=".$settings['site_url']."server/{$server_data['server_ip']}/][img]".$settings['site_url']."dk/userbar/6.jpg[/img][/url]</textarea></p><br>
</div></span></div>

<div align='center'><span><a style='cursor:pointer;color:#04ff00;size:12px;' onclick='userbar7(this)'><img id='toglink0' src='/dk/userbar/7.jpg' /></a><div style='display: none;'>
<br>
<font color='#ffffff'><b>HTML-код:</b></font><br>
<textarea rows='1' cols='76'><a href='".$settings['site_url']."server/{$server_data['server_ip']}' target='_blank'><img src='".$settings['site_url']."dk/userbar/7.jpg' /></a></textarea></p>
<br>
<font color='#ffffff'><b>BB-код:</b></font><br>
<textarea rows='1' cols='76'>[url=".$settings['site_url']."server/{$server_data['server_ip']}/][img]".$settings['site_url']."dk/userbar/7.jpg[/img][/url]</textarea></p><br>
</div></span></div>
					
					
					</div>


	
				</center>



	</div>



	</div>
	<div class='clearfix'></div>
	</form>";
	echo "</div><br>";

	echo "</div>";
	echo "</td>";




////
				
	echo "</td>";

	echo "</table>";
	echo "</div>";
}

?>


	
	
	























































	<script type="text/javascript">
	function userbar1(xdata){
	obj=xdata.parentNode.childNodes[1].style; tmp=(obj.display!='block') ?
	'block' : 'none'; obj.display=tmp; return false; } 
	</script> 
	
	<script type="text/javascript">
	function userbar2(xdata){
	obj=xdata.parentNode.childNodes[1].style; tmp=(obj.display!='block') ?
	'block' : 'none'; obj.display=tmp; return false; } 
	</script> 
	
	<script type="text/javascript">
	function userbar3(xdata){
	obj=xdata.parentNode.childNodes[1].style; tmp=(obj.display!='block') ?
	'block' : 'none'; obj.display=tmp; return false; } 
	</script> 
	
	<script type="text/javascript">
	function userbar4(xdata){
	obj=xdata.parentNode.childNodes[1].style; tmp=(obj.display!='block') ?
	'block' : 'none'; obj.display=tmp; return false; } 
	</script> 
	
	<script type="text/javascript">
	function userbar5(xdata){
	obj=xdata.parentNode.childNodes[1].style; tmp=(obj.display!='block') ?
	'block' : 'none'; obj.display=tmp; return false; } 
	</script> 
	
	<script type="text/javascript">
	function userbar6(xdata){
	obj=xdata.parentNode.childNodes[1].style; tmp=(obj.display!='block') ?
	'block' : 'none'; obj.display=tmp; return false; } 
	</script> 
		<script type="text/javascript">
	function userbar7(xdata){
	obj=xdata.parentNode.childNodes[1].style; tmp=(obj.display!='block') ?
	'block' : 'none'; obj.display=tmp; return false; } 
	</script> 


	
	<script>
	(function($) {
	$(function() {
	
	$('ul.tabs').delegate('li:not(.current)', 'click', function() {
	$(this).addClass('current').siblings().removeClass('current')
	.parents('div.section').find('div.box').hide().eq($(this).index()).fadeIn(550);
	})
	
	})
	})(jQuery)
	</script>