{include file="left.tpl"}

<script src="../modules/editors/tinymce/tinymce.min.js"></script>
<script>
	jQuery(document).ready(function($)
	{
		init_tinymce('text', 'lite', '{file_manager_theme}', '{file_manager}', '<? echo md5($conf->code); ?>');

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

			event.preventDefault();

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

			$.ajax({
				type: 'POST',
				url: '../ajax/actions_a.php',
				data: data,
				contentType: false,
				processData: false,
			}).done(function(data){
				NProgress.done();

				$('#load_file_result').html(data);
				$('#load_file_form')[0].reset();
			});
		});
	});
</script>

<div class="content float-right">
	<div class="block">
		<div class="header">Задать вопрос</div>
		<div class="block-content">
			<div class="form-input">
				<label for="name">Тема вопроса</label>
				<input type="text" id="name" maxlength="255" autocomplete="off">
			</div>
			<div class="form-input">
				<label>Сообщение</label>
			</div>
			<textarea id="text" maxlenght="2000"></textarea>

			<div class="form-input">
				<label>Файл</label>
			</div>
			<form enctype="multipart/form-data" action="../ajax/actions_a.php" method="post" id="load_file_form">
				<input type="hidden" id="token" name="token" value="{token}">
				<input type="hidden" id="load_file" name="load_file" value="1">
				<input type="hidden" id="phpaction" name="phpaction" value="1">
				<input class="imginput" type="file" id="file" name="file">
				<div class="space m-t-5"></div>
				<div class="btn float-left" onclick="$('#load_file_form').submit()">Загрузить</div>
				<div id="load_file_result" class="float-right"></div>
			</form>

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

			<div class="bs-callout bs-callout-info bs-mini-info m-t-5 m-r-5 m-b-5 m-l-5">
				<p>Допустимое расширение файла: rar, zip, 7z, jpg, jpeg, png.</p>
			</div>

			<div class="message-send">
				<div class="btn green float-left" onclick="add_ticket()">Создать</div>
				<div class="float-right" id="ticket_result"></div>
			</div>
			<div class="clear"></div>
		</div>
	</div>
</div>