{if(is_auth())}
	<div class="server server_line">
		<div class="td">
			{if('{rcon}' == '1' && count($commands) > 0 && is_auth() && is_worthy_specifically("v", {id}))}
				<span class="c-p" data-toggle="modal" data-target="#server-management-modal{id}">
					⚙️
				</span>
			{/if}
			<a href="steam://connect/{address}">{name}</a>
		</div>
		<div class="td">
			{game}
		</div>
		<div id="map{id}" class="td" data-container="body" data-toggle="popover" data-placement="top" data-content='<img src="{map_img}">'>
			{map_name}
			<script>$('#map{id}').popover({ html: true, animation: true, trigger: "hover" });</script>
		</div>
		<div class="td">
			<a href="steam://connect/{address}">{address}</a>
		</div>
		<div class="td">
			<div class="progress online_line" onclick="get_players({id});" class="c-p" data-toggle="modal" data-target="#server-players-modal{id}">
				<div class="progress-bar progress-bar-{color}" role="progressbar" style="width: {percentage}%;"></div>
				<div class="players_val">{now}/{max}</div>
			</div>
		</div>
		<div class="btn-group td">
			<a type="button" class="btn btn-default" href="../admins?server={id}"><span class="glyphicon glyphicon-user"></span></a>
			<a type="button" class="btn btn-default" href="../banlist?server={id}"><span class="glyphicon glyphicon-ban-circle"></span></a>
			<a type="button" class="btn btn-default" href="../bans/?server={id}"><span class="glyphicon glyphicon-info-sign"></span></a>
		</div>
	</div>

	<div id="server-players-modal{id}" class="modal fade">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<h4 class="modal-title">Игроки</h4>
				</div>
				<div class="modal-body">
					<div class="table-responsive mb-0">
						<table class="table table-bordered">
							<thead>
							<tr>
								<td>#</td>
								<td>Ник</td>
								<td>Убийств</td>
								<td>Время</td>
								{if('{rcon}' == '1' && is_auth() && is_worthy_specifically("s", {id}))}
									<td>Действие</td>
								{/if}
							</tr>
							</thead>
							<tbody id="server-players{id}" class="server_players">
							<tr><td colspan="10"><center><img src="{site_host}templates/{template}/img/loader.gif?v={cache}"></center></td></tr>
							</tbody>
						</table>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>
				</div>
			</div>
		</div>
	</div>
	{if('{rcon}' == '1' && count($commands) > 0 && is_auth() && is_worthy_specifically("v", {id}))}
		<div id="server-management-modal{id}" class="modal fade" style="text-align: left">
			<div class="modal-dialog modal-lg">
				<div class="modal-content">
					<div class="modal-header">
						<h4 class="modal-title">Управление сервером</h4>
					</div>
					<div class="modal-body">
						<div class="input-group">
							<span class="input-group-btn">
								<button
										class="btn btn-default"
										type="button"
										onclick='doRconCommandOnServer(
												$("#server-management-command-id{id}").val(),
												$("#server-management-command-id{id} option:selected").attr("data-command-params"),
										{id}
												);'
								>
									Выполнить
								</button>
							</span>
							<span class="input-group-btn w-100">
								<select id="server-management-command-id{id}" class="form-control">
									{for($l = 0; $l < count($commands); $l++)}
										<option value="{{$commands[$l]->id}}" data-command-params='{{$commands[$l]->params}}'>
											{{$commands[$l]->title}}
										</option>
									{/for}
								</select>
							</span>
						</div>

						<pre class="mt-10" id="server-management-command-sending-result{id}" style="display: none"></pre>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>
					</div>
				</div>
			</div>
		</div>
	{/if}
{else}
	<tr class="server_line">
		<td>{i}</td>
		<td>{name}</td>
		<td>
			<div class="progress online_line">
				<div class="progress-bar progress-bar-{color}" role="progressbar" style="width: {percentage}%;"></div>
				<div class="players_val">{now}/{max}</div>
			</div>
		</td>
		<td>{map_name}</td>
		<td><a href="steam://connect/{address}">{address}</a></td>
	</tr>
{/if}