{include file="left.tpl"}

<script src="../modules/editors/tinymce/tinymce.min.js"></script>
<script>
	jQuery(document).ready(function($)
	{
		init_tinymce('signature', 'lite', '{file_manager_theme}', '', '');

		get_user_shilings_operations('{id}');

		$('#edit_user_avatar_form').submit(function(event)
		{
			NProgress.start();

			event.preventDefault();

			var data = new FormData($('#edit_user_avatar_form')[0]);

			$.ajax({
				type: 'POST',
				url: '../ajax/actions_z.php',
				data: data,
				contentType: false,
				processData: false,
			}).done(function (html){
				$('#edit_user_avatar_result').html(html);
				$('#edit_user_avatar_form')[0].reset();
			});

			NProgress.done();
		});
	});
</script>

<div class="content float-right">
	<div class="block">
		<div class="header">Редактирование профиля</div>
		<div class="block-content">
			<div class="form-input">
				<label for="clear_type">Очистка / удаление</label>
				<select id="clear_type">
					<option value="1">Удалить пользователя</option>
					<option value="2">Очистить активность пользователя</option>
					<option value="3">Удалить все сообщения из чата</option>
					<option value="4">Удалить все сообщения и темы с форума</option>
					<option value="5">Удалить все комментарии</option>
				</select>
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="dell_user({id}, 1)">Выполнить</div>
			</div>

			<div class="clear"></div>

			<div class="form-input">
				<label for="user_group">Группа</label>
				<select id="user_group">{user_groups}</select>
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="admin_change_group({id})">Сохранить</div>
			</div>

			<div class="clear"></div>

			<div class="form-input">
				<label for="user_login">Логин</label>
				<input type="text" id="user_login" maxlength="30" autocomplete="off" value="{login}" placeholder="Введите логин">
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="admin_change_login({id})">Сохранить</div>
				<div class="float-right" id="login_result"></div>
			</div>

			<div class="clear"></div>

			<div class="form-input">
				<label for="user_password">Пароль</label>
				<input type="text" id="user_password" autocomplete="off" placeholder="Введите пароль">
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="admin_change_password({id})">Сохранить</div>
				<div class="float-right" id="password_result"></div>
			</div>

			<div class="clear"></div>

			<div class="form-input">
				<label for="user_name">Имя</label>
				<input type="text" id="user_name" maxlength="15" autocomplete="off" value="{name}" placeholder="Введите имя">
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="admin_change_name({id})">Сохранить</div>
			</div>

			<div class="clear"></div>

			<div class="form-input">
				<label for="user_nick">Ник на сервере</label>
				<input type="text" id="user_nick" maxlength="15" autocomplete="off" value="{nick}" placeholder="Введите ник">
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="admin_change_nick({id})">Сохранить</div>
			</div>

			<div class="clear"></div>

			<div class="form-input">
				<label for="user_steam_id">SteamID</label>
				<input type="text" id="user_steam_id" maxlength="32" autocomplete="off" value="{steam_id}" placeholder="Введите SteamID">
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="admin_change_steam_id({id})">Сохранить</div>
			</div>

			<div class="clear"></div>

			<div class="form-input">
				<label>Дата рождения</label>
				<select class="m-b-5" id="birth_day">{birth_day}</select>
				<select class="m-b-5" id="birth_month">{birth_month}</select>
				<select id="birth_year">{birth_year}</select>
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="admin_change_birth({id})">Сохранить</div>
			</div>

			<div class="clear"></div>

			<div class="form-input">
				<label for="user_skype">Skype</label>
				<input type="text" id="user_skype" maxlength="32" autocomplete="off" value="{skype}" placeholder="Введите логин skype">
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="admin_change_skype({id})">Сохранить</div>
			</div>

			<div class="clear"></div>

			<div class="form-input">
				<label for="user_telegram">Телеграм</label>
				<input type="text" id="user_telegram" maxlength="50" autocomplete="off" value="{telegram}" placeholder="Введите логин телеграм">
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="admin_change_telegram({id})">Сохранить</div>
			</div>

			<div class="clear"></div>

			<div class="form-input">
				<label for="user_vk">Вконтакте</label>
				<input type="text" id="user_vk" maxlength="15" autocomplete="off" value="{vk}" placeholder="Введите id вконтакте">
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="admin_change_vk({id})">Сохранить</div>
			</div>

			<div class="clear"></div>

			<div class="form-input">
				<label for="user_email">Mail</label>
				<input type="text" id="user_email" maxlength="255" autocomplete="off" value="{email}" placeholder="Введите почту">
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="admin_change_email({id})">Сохранить</div>
			</div>

			<div class="clear"></div>

			<? if('{active}' == '0') {?>
				<div class="bs-callout bs-callout-info bs-mini-info m-t-5 m-b-5">
					<p>E-mail не подтвержден, пользователь не активирован. <a href="#" onclick="admin_activate_user({id}); return false"><u>Активировать</u></a></p>
				</div>

				<div class="space"></div>
			<? } ?>

			<div class="form-input">
				<label>Аватарка</label>
			</div>
			<div class="upload-image">
				<img id="avatar" src="../{avatar}" class="float-left">
				<form enctype="multipart/form-data" action="ajax/actions_z.php" method="post" id="edit_user_avatar_form" class="float-right">
					<input type="hidden" id="token" name="token" value="{token}">
					<input type="hidden" id="id" name="id" value="{id}">
					<input type="hidden" id="admin_change_avatar" name="admin_change_avatar" value="1">
					<input type="hidden" id="phpaction" name="phpaction" value="1">
					<input class="imginput" type="file" id="user_avatar" accept="image/*" name="user_avatar">
					<div class="space"></div>
					<div class="btn float-left" onclick="$('#edit_user_avatar_form').submit()">Загрузить</div>
					<div id="edit_user_avatar_result" class="float-right"></div>
				</form>
			</div>

			<div class="clear"></div>

			<div class="form-input">
				<label for="input_keywords">Подпись</label>
				<textarea id="signature" rows="5">{signature}</textarea>
			</div>
			<div class="message-send">
				<div class="btn green float-left" onclick="admin_change_signature({id})">Сохранить</div>
				<div class="float-right" id="edit_signature_result"></div>
			</div>

			<div class="clear"></div>
		</div>
	</div>

	<div class="block">
		<div class="header">Последние операции</div>
		<div class="block-content">
			<div class="bs-callout bs-callout-info bs-mini-info"><p>Общая прибыль с пользователя: </b>{shilings}</p></div>
		</div>
		<table class="table-list">
			<thead>
				<tr>
					<th align="left">Сумма</th>
					<th align="left">Тип</th>
					<th align="left">Дата</th>
				</tr>
			</thead>
			<tbody id="operations"></tbody>
		</table>
	</div>
</div>