		<div id="page-wrapper">
            <div class="row">
                <ol class="breadcrumb" style="margin-top: 10px;">
				  <li><a href="/admin">Главная</a></li>
				  <li><a href="/admin/servers">Сервера</a></li>
				  <li class="active"><?=$server['server_name']?> (<?=$server['server_ip']?>:<?=$server['server_port']?>)</li>
				</ol>
                <div class="col-lg-6">
					<form class="form-horizontal" role="form" method="POST" action="">
						<div class="panel panel-default">
						<div class="panel-heading">
						Основное
						</div>
						</div>
						  <div class="form-group">
							<label class="col-lg-3 control-label">IP:</label>
							<div class="col-lg-6">
							  <input type="text" class="form-control" name="ip" value="<?=$server['server_ip']?>">
							</div>
						  </div>
						<div class="form-group">
							<label class="col-lg-3 control-label">Port:</label>
							<div class="col-lg-6">
							  <input type="text" class="form-control" name="port" value="<?=$server['server_port']?>">
							</div>
						  </div>
						 <div class="form-group">
							<label class="col-lg-3 control-label">Сайт:</label>
							<div class="col-lg-6">
							  <input type="text" class="form-control" name="weburl" value="<?=$server['server_weburl']?>">
							</div>
						  </div>
						  <div class="form-group">
							<label class="col-lg-3 control-label">Голоса:</label>
							<div class="col-lg-6">
							<input type="text" class="form-control" name="vote" value="<?=$server['server_vote']?>">
							</div>
						  </div>
						  <div class="form-group">
								<label class="col-lg-3 control-label">Добавлен:</label>
								<div class="col-lg-6">
								<input type="text" class="form-control" name="add_time" value="<?=$server['server_add_time']?>" disabled>
								</div>
						  </div>
						<div class="panel panel-default">
						<div class="panel-heading">
						Платные услуги
						</div>
						</div>
						<div class="form-group">
							<label class="col-lg-3 control-label">VIP:</label>
							<div class="col-lg-6">
							<?if(!$server['server_vip_time'] == '0'):?>
							<input type="text" class="form-control" name="vip" value="До <?=$server['server_vip_time']?>" disabled>
							<?else:?>
							<select id="month" class="form-control" name="month" onChange="updateForm()">
							  <option disabled selected>Выберите срок услуги</option>
							  <option value="1">1 месяц</option>
							  <option value="3">3 месяца</option>
							  <option value="6">6 месяцев</option>
							  <option value="12">1 год</option>
							</select>
							<?endif;?>
							</div>
						</div>
						<div class="form-group">
							<label class="col-lg-3 control-label">Выделение:</label>
							<div class="col-lg-6">
							<div class="input-group">
							<?php if(!$server['server_selection_time'] != '0000-00-00 00:00:00'): ?>
							<input type="text" class="form-control" name="selection" value="До <?=$server['server_selection_time']?>" disabled>
							<span class="input-group-addon <?=$server['server_selection_type']?>"></span>
							<?else:?>
							<select id="color" class="form-control" name="color" onChange="updateForm()">
							  <option disabled selected>Выберите цвет</option>
							  <option value="red">Красный</option>
							  <option value="blue">Синий</option>
							  <option value="green">Зеленый</option>
							  <option value="yellow">Желтый</option>
							</select>
							<?endif;?>
							</div>
							</div>
						</div>
						<div class="form-group">
							<div class="col-lg-offset-5 col-lg-4">
								<input type="hidden" name="edit" value="save">
								<input class="btn btn-default" value="Сохранить" type="submit" name="submit">
							</div>
						</div>
						</form>
				</div>
				<div class="col-lg-6">
					<div class="panel panel-default">
					<div class="panel-heading">
					Статистика
					</div>
					</div>
					Игроки: <b><?=$server['server_players']?>/<?=$server['server_maxplayers']?></b><br>
					<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>
		<script>
			function updateForm() {
				var type = $("#type option:selected").val();
				var color = $("#color option:selected").val();
				if(type == 1){
					var price = '<?=$price['color']?>';
					$('#colorBlock').css('display', 'block');
					$('#monthBlock').css('display', 'block');
				} 
				if(type == 2) {
					var price = '<?=$price['vip']?>';
					$('#colorBlock').css('display', 'none');
					$('#monthBlock').css('display', 'block');
				} 
				
					var month = $("#month option:selected").val();
					if(month == 1){
						var price = price;
					}
					if(month == 3){
						var price = price*3;
					}
					if(month == 6){
						var price = price*6;
					}
					if(month == 12){
						var price = price*12;
					}
				
				$('#price').val(price + ' руб.');
			}
		</script>