<?php
/*
* @ServerMon v1.1
* @Developed by Maksa988
* @www.Server-Mon.ru
* @Copyright (C) 2014
*/
 if(!defined('SMON'))
	die('Hacking attempt!');
	
?>
<div class="servermon-page">
<div class="left-server-block" style="border: none; width: 720px;">
		<ul class="nav nav-tabs" role="tablist" style="margin-bottom: 20px;">
		  <li class="active"><a href="#info" role="tab" data-toggle="tab">Информация</a></li>
		  <li><a href="#banners" role="tab" data-toggle="tab">Банеры</a></li>
		  <li><a href="#statistic" role="tab" data-toggle="tab">Статистика</a></li>
		</ul>

		<div class="tab-content">
		  <div class="tab-pane active" id="info">
			<div class="serverimg">
		        <span style="width: 168px; font-size: 12px; text-align: center; float: left; margin: 0;">
					<img src="http://demo.lightmon.ru/media/maps/<?=$server['server_mapname']?>.jpg" width="160" height="120" style="border: 1px solid #000; float: left;">
					<img src="http://www.myarena.ru/images/foto_down.png" width="160" height="10" style="border: 0px; float: left;">
				</span>
				<span style="width: 168px; font-size: 12px; text-align: center; float: left; margin: 0;">
					Игроков: <b><?=$server['server_players']?></b>/<b><?=$server['server_maxplayers']?></b>
				</span>
			</div>
		    <div class="serverinfo" style="width: 520px;">
				<table class="table">    
					<tbody>    
						<tr>
							<td>Адрес сервер:</td>
							<td><?=$server['server_ip']?>:<?=$server['server_port']?> <a href="<?=$game['game_connect']?><?=$server['server_ip']?>:<?=$server['server_port']?>"><i class="glyphicon glyphicon-play"></i></a></td>
						</tr> 
						<tr>
							<td>Игра:</td>
							<td><img src="http://gs-monitor.com/media/icons/<?=$game['game_icon']?>.png"> <?=$game['game_name']?></td>
						</tr>
						<tr>
							<td>Загруженость сервера:</td>
							<td>
								<div class="progress">
								  <div class="progress-bar progress-bar-striped active"  role="progressbar" aria-valuenow="<?=$server['procent']?>" aria-valuemin="0" aria-valuemax="100" style="width: <?=$server['procent']?>%">
								  </div>
								</div>
							</td>
						</tr>   
						<tr>
							<td>Карта:</td>
							<td><?=$server['server_mapname']?></td>
						</tr>    
						<tr>
							<td>Игровой режим:</td>
							<td><?=$server['server_gamename']?></td>
						</tr>	
						<tr>
							<td>Сайт сервера:</td>
							<td><a href="<?=$server['server_weburl']?>" rel="nofollow" target="_blank"><?=$server['server_weburl']?></a></td>
						</tr>    
						<tr>
							<td>Рейтинг сервера:</td>
							<td>
								<span id="server-rating-<?=$server['server_id']?>">	
								<?if($server['server_vip_time'] != '0'):?>
									VIP
								<?else:?>
									<?=$server['server_vote']?>
								<?endif;?>
								<a class="servermon-vote" id="rating-up" data-rating="<?=$server['server_vote']?>" data-id="<?=$server['server_id']?>" title="Голосовать за сервер">
									<i class="glyphicon glyphicon-arrow-up"></i>
								</a>	
								</span>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		  </div>
		  <div class="tab-pane" id="banners">Временно недоступно</div>
		  <div class="tab-pane" id="statistic">
			<script type="text/javascript" src="https://www.google.com/jsapi"></script>
			<script type="text/javascript">
			  google.load("visualization", "1", {packages:["corechart"]});
			  google.setOnLoadCallback(drawChart);
			  function drawChart() {
				var data = google.visualization.arrayToDataTable([
				  ['Время', 'Количество игроков'],
				  <?foreach($stats as $item):?>
					  ["<?=date("H:i", strtotime($item['server_stats_date']))?>",  <?=$item['server_stats_players']?>],
				  <?endforeach;?>
				]);
		 
				var options = {
				  title: 'За сутки'
				};
		 
				var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
				chart.draw(data, options);
			  }
			</script>
			<div id="chart_div" style="width: 100%; height: 500px;"></div>
		  </div>
		</div>
		<center><img src="/images/4444.png"></center>
</div>
</div>