<div class="col-lg-9 order-is-first">
	<div class="block" data-aos="flip-left">
		<div class="block_head">
			Информация
		</div>
		{include file="../../../modules_extra/demoview/templates/standart/instructions.tpl"}
	</div>
	
	<div class="block">
		<div class="block_head mb-3">
			Добавить демо
		</div>

		<div class="form-group">
		<label>
		<h4>
			Сервер
			</h4>
			</label>
			<select id="server" class="form-control" onchange="local_change_server();">
				{servers}
			</select>
		</div>
		
		
		<div class="form-group">
			<label for="accused">
				<h4>Индентификатор обвиняемого</h4>
			</label>

			<input type="text" class="form-control" id="accused" maxlength="256" placeholder="Введите ник / steam_id / логин на сайте">
			<button class="btn btn-outline-primary mt-3" onclick="findTheAccused()">Найти</button>

			<div id="find-result-table" class="table-responsive mb-0 mt-3" style="display: none">
				<table class="table table-bordered">
					<thead>
						<tr>
							<td>Действие</td>
							<td>Профиль</td>
							<td>Индентификатор</td>
							<td>Услуги</td>
						</tr>
					</thead>
					<tbody id="find-result">
						<tr>
							<td colspan="10">
								<div class="loader"></div>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		
		<div id="none">
			<div class="form-group">
			<label>
			<h4>Ник админа, который запросил демо:</h4>
			</label>
				<input type="text" class="form-control" id="nick" maxlength="250" autocomplete="off" placeholder="Напимер: 666" required>
			</div>
			<div class="form-group">
				<label>
					<h4>
					Скриншоты <small>(максимальное количество: 5)</small>
					</h4>
					</label>
				<div id="imgs"></div>
				<div class="input-group">
					<form enctype="multipart/form-data" action="../modules_extra/demoview/ajax/actions.php" method="POST" id="add_img_form">
						<input type="hidden" id="token" name="token" value="{token}">
						<input type="hidden" id="add_demo_img" name="add_demo_img" value="1">
						<input type="hidden" id="phpaction" name="phpaction" value="1">

						<div class="">
							<input type="file" class="file-input" id="demo_img" accept="image/*" name="demo_img">
						</div>

						<div id="img_result" class="mt-1"></div>
						<button class="btn btn-outline-primary" type="submit">Загрузить</button>
					</form>
				</div>
				<input value="" type="hidden" id="screens" autocomplete="off">
			</div>
			<div class="form-group">
			<label>
				<h4>
				Ссылка на демо <small>(<span style="color:#c1221b;">Обязательно</span>)</small><br>
				<small>Рекомендованные файлообменники: ( <a href="https://dropmefiles.com/" target="_blank">dropmefiles.com</a> | <a href="https://wdfiles.ru/" target="_blank">wdfiles.ru</a> | <a href="http://transfiles.ru/" target="_blank">transfiles.ru</a> | <a href="https://www.mediafire.com/" target="_blank">mediafire.com</a> | <a href="https://zippyshare.com/" target="_blank">zippyshare.com</a> )</small>
				</h4>
					</label>
				<input type="text" class="form-control" id="demo" maxlength="250" autocomplete="off" placeholder="Ссылка на демо" required>
			</div>
		</div>
		<div id="new_result"></div>
		<button id="create_btn" onclick="add_demoview();" type="button" class="btn btn-primary mt-3">Создать</button>
	</div>
</div>

<script>
	$("#add_img_form").submit(function (event){
		NProgress.start();
		event.preventDefault();
		var data = new FormData($('#add_img_form')[0]);
		$.ajax({
			type: "POST",
			url: "../modules_extra/demoview/ajax/actions.php",
			data: data,
			contentType: false,
			processData: false,
		}).done(function (html) {
			NProgress.done();
			$("#img_result").empty();
			$("#img_result").append(html);
			$('#add_img_form')[0].reset();
		});
	});
</script>

<div class="col-lg-3 order-is-last">
	{if(is_auth())}
		{include file="/home/navigation.tpl"}
	{else}
		{include file="/index/authorization.tpl"}
	{/if}
</div>