<?
#Старт сессии
session_start();

#Подключаем базу
include '../engine/config.php';
include '../engine/classes/bbcode.class.php';
  
#Проверяем способ вызова файла
if ( !defined( 'MISOFT_ADMIN_DIRR' ) ) exit();

if ( !isset( $_SESSION['iduser'] ) or $config_user['account'] != 5 ) {
    echo '<div class="stabilisacion-engine"><div class="alert alert-danger" role="alert">
	  <strong>Внимание!</strong> Нарушен механизм безопасности! В силу безопасности и целостности сайта, выполнение скриптов остановлено. Ошибка №A1
	</div></div>';
	exit();
} else {
  
  $edit_task = mysql_fetch_array( mysql_query( "SELECT * FROM tasks WHERE id = '" . ( int ) $_GET['id'] . "' LIMIT 1" ) );
  $edit_task_reklamodatel = mysql_fetch_array( mysql_query( "SELECT username, userdel FROM user WHERE id = '" . ( int ) $edit_task['iduser'] . "' LIMIT 1" ) );
  ?>
    <script type="text/javascript">
      function config_1() {
		$.ajax ({
            url: 'ajax_update.php?func=edittask',
            type: 'POST',
			dataType: 'html',
			data: $("#editform").serialize(),
            success: function(data) {
              if(data == 1) {
                $('#block_title_error').fadeIn(0);
                $('#success_ajax').fadeIn(500);
                setTimeout(function() {
                    $('#success_ajax').fadeOut(500);
					$('#block_title_error').fadeOut(0);
					location.reload();
                }, 4000);
              } else {
				$('#block_title_error').fadeIn(0);
				$('#error_ajax').fadeIn(500).html(data);
                setTimeout(function() {
                    $('#error_ajax').fadeOut(500).html('&nbsp;');
					$('#block_title_error').fadeOut(0);
                }, 4000);
			  }
            }
        });
      }
	  
	  function qbb(a, b, c) {
	    textarea = document.getElementById(c);
	    if (document.selection && document.selection.createRange) textarea.focus(), sel = document.selection.createRange(), sel.text = a + sel.text + b;
	    else if (textarea.selectionStart || "0" == textarea.selectionStart) {
		  c = textarea.selectionStart;
		  var d = textarea.selectionEnd;
		  textarea.value = textarea.value.substring(0, c) + a + textarea.value.substring(c, d) + b + textarea.value.substring(d, textarea.value.length);
		  textarea.selectionStart = textarea.selectionEnd = d + a.length + b.length
	    } else textarea.value += a + b;
	    textarea.focus()
	  };
	  
	  function show_close() {
		if ($('#tmode').val() == '1') {
		  $('#execution').fadeIn(500);
		  $('#execution2').fadeIn(500);
		} else {
		  $('#execution').fadeOut(300);
		  $('#execution2').fadeOut(300);
		}
	  }

	  function show_ipfilter() {
		if ($('#ip').val() == '1' || $('#ip').val() == '2') {
		  $('#ip_on').fadeIn(500);
		} else {
		  $('#ip_on').fadeOut(300);
		}
	  }
    </script>
    <div class="content-wrapper">
	  <div class="container-fluid">
		<div class="row">
		  <div class="col-md-12">
		    <h2 class="page-title">Редактирование рекламной площадки.</h2>

			<div class="row">
			  <div class="col-md-6">
				<div class="panel panel-default">
				  <div class="panel-heading">Оплачиваемые задания (площадка ID:<?=( int ) $_GET['id']?>)</div>
				  <div class="panel-body">
					<form id="editform" action="" method="POST" class="form-horizontal">
					  <input type="hidden" name="idtask" id="idtask" value="<?=$edit_task['id']?>" />
					  
					  <div class="form-group">
						<label class="col-sm-2 control-label ">Заголовок</label>
						<div class="col-sm-10 input-size-one">
						  <input type="text" class="form-control" name="title" id="title" value="<?=$edit_task['title']?>">
						  <span class="help-block m-b-none"></span>
						</div>
					  </div>
					  
					  <div class="hr-dashed"></div>
					  <div class="form-group ">
						<label class="col-sm-2 control-label ">Описание</label>
						<div class="col-sm-10 input-size-one">
						  <div class="bbcode-panel-forum-post ">
							<span onclick="qbb('[b]','[/b]','text')" id="bb_b" title="Полужирный текст" class="bb-b-forum"><i class="fa fa-bold" aria-hidden="true"></i></span>
							<span onclick="qbb('[i]','[/i]','text')" id="bb_i" title="Наклонный текст" class="bb-i-forum"><i class="fa fa-italic" aria-hidden="true"></i></span>
							<span onclick="qbb('[u]','[/u]','text')" id="bb_u" title="Подчеркнутый текст" class="bb-u-forum"><i class="fa fa-underline" aria-hidden="true"></i></span>
							<span onclick="qbb('[s]','[/s]','text')" id="bb_s" title="Зачеркнутый текст" class="bb-s-forum"><i class="fa fa-strikethrough" aria-hidden="true"></i></span>
							<span onclick="qbb('[sub]','[/sub]','text')" id="bb_sub" title="Нижний индекс" class="bb-sub-forum"><i class="fa fa-subscript" aria-hidden="true"></i></span>
							<span onclick="qbb('[sup]','[/sup]','text')" id="bb_sup" title="Верхний индекс" class="bb-sup-forum"><i class="fa fa-superscript" aria-hidden="true"></i></span>
							<span onclick="qbb('[quotet]','[/quotet]','text')" class="bb_quotet" id="quotet" title="Цитировать текст"><i class="fa fa-quote-left" aria-hidden="true"></i></span>
							<span onclick="qbb('[video]','[/video]','text')" class="bb_youtube" id="video" title="Вставить видео"><i class="fa fa-youtube-play" aria-hidden="true"></i></span>
							<span onclick="qbb('[images]','[/images]','text')" class="bb_youtube" id="images_forum_post" title="Вставить изображение (поддерживаются форматы jpg/png/bmp/gif)."><i class="fa fa-picture-o" aria-hidden="true"></i></span>
							<span onclick="qbb('[a]','[/a]','text')" class="bb_link" id="link_forum" title="Вставить ссылку"><i class="fa fa-link" aria-hidden="true"></i></span>
						  </div>
						  <textarea name="text" id="text" style="padding-top: 38px; max-width: 632px; min-width: 632px;" class="form-control" rows="10"><?=parce_html_code( $edit_task['text'] )?></textarea>
						</div>
					  </div>
					  
					  <div class="hr-dashed"></div>
					  <div class="form-group ">
						<label class="col-sm-2 control-label label-size-fix">Проверка выполнения</label>
						<div class="col-sm-10 input-size-one">
						  <div class="bbcode-panel-forum-post ">
							<span onclick="qbb('[b]','[/b]','description')" id="bb_b" title="Полужирный текст" class="bb-b-forum"><i class="fa fa-bold" aria-hidden="true"></i></span>
							<span onclick="qbb('[i]','[/i]','description')" id="bb_i" title="Наклонный текст" class="bb-i-forum"><i class="fa fa-italic" aria-hidden="true"></i></span>
							<span onclick="qbb('[u]','[/u]','description')" id="bb_u" title="Подчеркнутый текст" class="bb-u-forum"><i class="fa fa-underline" aria-hidden="true"></i></span>
							<span onclick="qbb('[s]','[/s]','description')" id="bb_s" title="Зачеркнутый текст" class="bb-s-forum"><i class="fa fa-strikethrough" aria-hidden="true"></i></span>
							<span onclick="qbb('[sub]','[/sub]','description')" id="bb_sub" title="Нижний индекс" class="bb-sub-forum"><i class="fa fa-subscript" aria-hidden="true"></i></span>
							<span onclick="qbb('[sup]','[/sup]','description')" id="bb_sup" title="Верхний индекс" class="bb-sup-forum"><i class="fa fa-superscript" aria-hidden="true"></i></span>
							<span onclick="qbb('[quotet]','[/quotet]','description')" class="bb_quotet" id="quotet" title="Цитировать текст"><i class="fa fa-quote-left" aria-hidden="true"></i></span>
							<span onclick="qbb('[video]','[/video]','description')" class="bb_youtube" id="video" title="Вставить видео"><i class="fa fa-youtube-play" aria-hidden="true"></i></span>
							<span onclick="qbb('[images]','[/images]','description')" class="bb_youtube" id="images_forum_post" title="Вставить изображение (поддерживаются форматы jpg/png/bmp/gif)."><i class="fa fa-picture-o" aria-hidden="true"></i></span>
							<span onclick="qbb('[a]','[/a]','description')" class="bb_link" id="link_forum" title="Вставить ссылку"><i class="fa fa-link" aria-hidden="true"></i></span>
						  </div>
						  <textarea name="description" id="description" style="padding-top: 38px; max-width: 632px; min-width: 632px;" class="form-control" rows="10"><?=parce_html_code( $edit_task['text'] )?></textarea>
						</div>
					  </div>
					
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label label-size-fix">Вознаграждение исполнителю</label>
						<div class="col-sm-10 input-size-one">
						  <input type="text" class="form-control" name="price" id="price" value="<?=$edit_task['price']?>">
						  <span class="help-block m-b-none"></span> 
						</div>
					  </div>
					  
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label label-size-fix">Категория задания</label>
						<div class="col-sm-10">
						  <select class="select-form" name="tkategorian" id="tkategorian">
							<optgroup label="">
							  <option value="1" <? if( $edit_task['ShownKategories'] == '1' ) echo 'selected';?>>Только регистрация</option>
							  <option value="2" <? if( $edit_task['ShownKategories'] == '2' ) echo 'selected';?>>Только клики</option>
							  <option value="3" <? if( $edit_task['ShownKategories'] == '3' ) echo 'selected';?>>Регистрация с активностью</option>
							  <option value="4" <? if( $edit_task['ShownKategories'] == '4' ) echo 'selected';?>>Приглашение в рефералы</option>
							  <option value="5" <? if( $edit_task['ShownKategories'] == '5' ) echo 'selected';?>>Социальные сети</option>
							  <option value="6" <? if( $edit_task['ShownKategories'] == '6' ) echo 'selected';?>>YouTube</option>
							  <option value="7" <? if( $edit_task['ShownKategories'] == '7' ) echo 'selected';?>>Постинг в форумы и/или блоги</option>
							  <option value="8" <? if( $edit_task['ShownKategories'] == '8' ) echo 'selected';?>>Написать статью или пресс-релиз</option>
							  <option value="9" <? if( $edit_task['ShownKategories'] == '9' ) echo 'selected';?>>Отзыв/проголосовать</option>
							  <option value="10" <? if( $edit_task['ShownKategories'] == '10' ) echo 'selected';?>>Forex</option>
							  <option value="11" <? if( $edit_task['ShownKategories'] == '11' ) echo 'selected';?>>Bitcoin/Litecoin/Dogecoin</option>
							  <option value="12" <? if( $edit_task['ShownKategories'] == '12' ) echo 'selected';?>>Играть в игры</option>
							  <option value="13" <? if( $edit_task['ShownKategories'] == '13' ) echo 'selected';?>>Инвестировать</option>
							  <option value="14" <? if( $edit_task['ShownKategories'] == '14' ) echo 'selected';?>>Мобильные приложения</option>
							  <option value="15" <? if( $edit_task['ShownKategories'] == '15' ) echo 'selected';?>>Бонусы</option>
							  <option value="16" <? if( $edit_task['ShownKategories'] == '16' ) echo 'selected';?>>Прочее</option>
							</optgroup>
						  </select>
						</div>
					  </div>
					  
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label label-size-fix">Тип выполнения</label>
						<div class="col-sm-10">
						  <select class="select-form" name="tmode" id="tmode" onchange="show_close();">
							<optgroup label="">
							  <option value="0" <? if( $edit_task['many'] == 0 ) echo 'selected="selected"';?>>Одноразовое исполнение</option>
							  <option value="1" <? if( $edit_task['many'] == 1 ) echo 'selected="selected"';?>>Многоразовое исполнение</option>
							</optgroup>
						  </select>
						</div>
					  </div>
					  
					  <span style="<? if($edit_task['many'] == 0){echo 'display: none;';} else {echo '';} ?> " id="execution">
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label label-size-fix">Повторное выполнение до проверки</label>
						<div class="col-sm-10">
						  <select class="select-form" name="re_execution" id="re_execution">
							<optgroup label="">
							  <option value="0" <? if( $edit_task['re_execution'] == 0 ) echo 'selected';?>>Нет</option>
							  <option value="1" <? if( $edit_task['re_execution'] == 1 ) echo 'selected';?>>Да</option>
							</optgroup>
						  </select>
						</div>
					  </div>
					  </span>
					  
					  <span style="<? if($edit_task['many'] == 0){echo 'display: none;';} else {echo '';} ?>" id="execution2">
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label label-size-fix">Повтор каждые XX часов</label>
						<div class="col-sm-10">
						  <select class="select-form" name="pdays" id="pdays">
							<optgroup label="">
							  <option value="e">Параметр выключен</option>
							  <option value="0" <? if( $edit_task['executionTime'] == 0 ) echo 'selected';?>>Моментально</option>
							  <option value="3600" <? if( $edit_task['executionTime'] == 3600 ) echo 'selected';?>>1 час</option>
							  <option value="<?=3600*3;?>" <? if( $edit_task['executionTime'] == 3600*3 ) echo 'selected';?>>3 часа</option>
							  <option value="<?=3600*6;?>" <? if( $edit_task['executionTime'] == 3600*6 ) echo 'selected';?>>6 часов</option>
							  <option value="<?=3600*12;?>" <? if( $edit_task['executionTime'] == 3600*12 ) echo 'selected';?>>12 часов</option>
							  <option value="86400" <? if( $edit_task['executionTime'] == 86400 ) echo 'selected';?>>1 день (24 часа)</option>
							  <option value="<?=86400*2;?>" <? if( $edit_task['executionTime'] == 86400*2 ) echo 'selected';?>>2 дня (48 часов)</option>
							  <option value="<?=86400*3;?>" <? if( $edit_task['executionTime'] == 86400*3 ) echo 'selected';?>>3 дня (72 часа)</option>
							  <option value="<?=86400*5;?>" <? if( $edit_task['executionTime'] == 86400*5 ) echo 'selected';?>>5 дней (120 часов)</option>
							</optgroup>
						  </select>
						</div>
					  </div>
					  </span>
					  
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label label-size-fix">Срок выполнения</label>
						<div class="col-sm-10">
						  <select class="select-form" name="tdays" id="tdays">
							<optgroup label="">
							  <option value="3600" <? if( $edit_task['maxtime'] == 3600 ) echo 'selected="selected"';?>>1 час</option>
							  <option value="7200" <? if( $edit_task['maxtime'] == 7200 ) echo 'selected="selected"';?>>2 часа</option>
							  <option value="<?=3600*6;?>" <? if( $edit_task['maxtime'] == 3600*6 ) echo 'selected="selected"';?>>6 часов</option>
							  <option value="<?=3600*12;?>" <? if( $edit_task['maxtime'] == 3600*12 ) echo 'selected="selected"';?>>12 часов</option>
							  <option value="86400" <? if( $edit_task['maxtime'] == 86400 ) echo 'selected="selected"';?>>1 день</option>
							  <option value="<?=86400*2;?>" <? if( $edit_task['maxtime'] == 86400*2 ) echo 'selected="selected"';?>>2 дня</option>
							  <option value="<?=86400*3;?>" <? if( $edit_task['maxtime'] == 86400*3 ) echo 'selected="selected"';?>>3 дня</option>
							  <option value="<?=86400*4;?>" <? if( $edit_task['maxtime'] == 86400*4 ) echo 'selected="selected"';?>>4 дня</option>
							  <option value="<?=86400*5;?>" <? if( $edit_task['maxtime'] == 86400*5 ) echo 'selected="selected"';?>>5 дней</option>
							  <option value="<?=86400*6;?>" <? if( $edit_task['maxtime'] == 86400*6 ) echo 'selected="selected"';?>>6 дней</option>
							  <option value="<?=86400*7;?>" <? if( $edit_task['maxtime'] == 86400*7 ) echo 'selected="selected"';?>>7 дней</option>
							  <option value="<?=86400*10;?>" <? if( $edit_task['maxtime'] == 86400*10 ) echo 'selected="selected"';?>>10 дней</option>
							  <option value="<?=86400*15;?>" <? if( $edit_task['maxtime'] == 86400*15 ) echo 'selected="selected"';?>>15 дней</option>
							  <option value="<?=86400*20;?>" <? if( $edit_task['maxtime'] == 86400*20 ) echo 'selected="selected"';?>>20 дней</option>
							  <option value="<?=86400*30;?>" <? if( $edit_task['maxtime'] == 86400*30 ) echo 'selected="selected"';?>>30 дней</option>
							</optgroup>
						  </select>
						</div>
					  </div>
					  
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label label-size-fix">Ожидание между выполнениями</label>
						<div class="col-sm-10">
						  <select class="select-form" name="fdays" id="fdays">
							<optgroup label="">
							  <option value="0" <? if( $edit_task['nextExecutionOn'] == 0 ) echo 'selected';?>>Не использовать</option>
							  <option value="600" <? if( $edit_task['nextExecutionOn'] == 600 ) echo 'selected';?>>10 минут</option>
							  <option value="<?=600*2;?>" <? if( $edit_task['nextExecutionOn'] == 600*2 ) echo 'selected';?>>20 минут</option>
							  <option value="<?=600*3;?>" <? if( $edit_task['nextExecutionOn'] == 600*3 ) echo 'selected';?>>30 минут</option>
							  <option value="<?=600*5;?>" <? if( $edit_task['nextExecutionOn'] == 600*5 ) echo 'selected';?>>50 минут</option>
							  <option value="3600" <? if( $edit_task['nextExecutionOn'] == 3600 ) echo 'selected';?>>1 час</option>
							  <option value="<?=3600*2;?>" <? if( $edit_task['nextExecutionOn'] == 3600*2 ) echo 'selected';?>>2 часа</option>
							  <option value="<?=3600*3;?>" <? if( $edit_task['nextExecutionOn'] == 3600*3 ) echo 'selected';?>>3 часа</option>
							  <option value="<?=3600*4;?>" <? if( $edit_task['nextExecutionOn'] == 3600*4 ) echo 'selected';?>>4 часа</option>
							  <option value="<?=3600*5;?>" <? if( $edit_task['nextExecutionOn'] == 3600*5 ) echo 'selected';?>>5 часа</option>
							  <option value="<?=3600*6;?>" <? if( $edit_task['nextExecutionOn'] == 3600*6 ) echo 'selected';?>>6 часов</option>
							  <option value="<?=3600*12;?>" <? if( $edit_task['nextExecutionOn'] == 3600*12 ) echo 'selected';?>>12 часов</option>
							  <option value="86400" <? if( $edit_task['nextExecutionOn'] == 86400 ) echo 'selected';?>>1 день (24 часа)</option>
							  <option value="<?=86400*2;?>" <? if( $edit_task['nextExecutionOn'] == 86400*2 ) echo 'selected';?>>2 дня (48 часов)</option>
							  <option value="<?=86400*3;?>" <? if( $edit_task['nextExecutionOn'] == 86400*3 ) echo 'selected';?>>3 дня (72 часа)</option>
							  <option value="<?=86400*5;?>" <? if( $edit_task['nextExecutionOn'] == 86400*5 ) echo 'selected';?>>5 дней (120 часов)</option>
							</optgroup>
						  </select>
						</div>
					  </div>
					  
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label label-size-fix">IP – фильтр</label>
						<div class="col-sm-10">
						  <select class="select-form" name="ip" id="ip" onchange="show_ipfilter();">
							<optgroup label="">
							  <option value="0" <? if( $edit_task['ipFilter'] == 0 ) echo 'selected';?>>Разрешить с любого IP</option>
							  <option value="1" <? if( $edit_task['ipFilter'] == 1 ) echo 'selected';?>>Запретить при полном совпадении IP</option>
							  <option value="2" <? if( $edit_task['ipFilter'] == 2 ) echo 'selected';?>>Запретить при совпадении маски IP (11.11.11.ХХХ)</option>
							</optgroup>
						  </select>
						</div>
					  </div>
					
					  <span style="<? if($edit_task['ipFilter'] == 0){echo 'display: none;';} else {echo '';} ?>" id="ip_on">
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label ">Время действия IP фильтра</label>
						<div class="col-sm-10 input-size-one">
						  <input type="text" class="form-control" name="ipfilter" id="ipfilter" value="<?=$edit_task['timeIpFilter'] / 3600?>">
						  <span class="help-block m-b-none">Если Вы включили IP фильтр, то Вы можете задать время действия этого фильтра, от 1 часа до 10 дней. Этот параметр определяет, через сколько пользователь сможет приступить к заданию с таким же IP адресом. Например, Вы можете поставить 48 часов, и пользователи с одинаковыми IP адресами (в соответствии с настройкой IP фильтра) смогут выполнить Ваше задание раз в 48 часов. Указывать в количестве часов, например указав 24, будет значить 24 часа (1 сутки). Минимум 1 час, максимум 240 часов (10 суток).</span> 
						</div>
					  </div>
					  </span>
					
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label ">URL сайта</label>
						<div class="col-sm-10 input-size-one">
						  <input type="text" class="form-control" name="url" id="url" value="<?=$edit_task['url']?>">
						  <span class="help-block m-b-none"></span> 
						</div>
					  </div>
					
					  <div class="hr-dashed"></div>
					  <div class="form-group">
					    <label class="col-sm-2 control-label label-size-fix">Рекламодатель id</label>
					    <div class="col-sm-10 input-size-one">
						  <input type="text" class="form-control" name="iduser" id="iduser" value="<?=$edit_task['iduser']?>">
						  <span class="help-block m-b-none">Ник:&nbsp;<?=$edit_task_reklamodatel['username']?>&nbsp;<? if($edit_task_reklamodatel['userdel'] == 1) { echo '<font color="red">(пользователь удален)</font>';} ?></span> 
					    </div>
					  </div>
					 
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label ">Баланс</label>
						<div class="col-sm-10 input-size-one">
						  <input type="text" class="form-control" name="balance" id="balance" value="<?=$edit_task['balance']?>">
						  <span class="help-block m-b-none"></span> 
						</div>
					  </div>
					  
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label ">Геотаргетинг</label>
						<div class="col-sm-10">
						  <table class="table_geo_addtext">
							<tr>
							  <td style="width: 50%;">
							    <div class="checkbox checkbox-primary">
							      <input type="checkbox" name="geo_ru" id="geo_ru" value="ru" <? if( $edit_task['geo_ru'] == 'ru' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/ru.png" class="flagcountry" alt="" />&nbsp;&nbsp;Россия</label>
								</div>
							  </td>
							  <td style="width: 50%;">
							    <div class="checkbox checkbox-primary">
								  <input type="checkbox" name="geo_ua" id="geo_ua" value="ua" <? if( $edit_task['geo_ua'] == 'ua' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/ua.png" class="flagcountry" alt="" />&nbsp;&nbsp;Украина</label>
							    </div>
							  </td>
							</tr>
							<tr>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
								  <input type="checkbox" name="geo_by" id="geo_by" value="by" <? if( $edit_task['geo_by'] == 'by' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/by.png" class="flagcountry" alt="" />&nbsp;&nbsp;Белоруссия</label>
								</div>
							  </td>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
								  <input type="checkbox" name="geo_ge" id="geo_ge" value="ge" <? if( $edit_task['geo_ge'] == 'ge' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/ge.png" class="flagcountry" alt="" />&nbsp;&nbsp;Грузия</label>
								</div>
							  </td>
							</tr>
							<tr>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
								  <input type="checkbox" name="geo_md" id="geo_md" value="md" <? if( $edit_task['geo_md'] == 'md' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/md.png" class="flagcountry" alt="" />&nbsp;&nbsp;Молдова</label>
								</div>
							  </td>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
								  <input type="checkbox" name="geo_kz" id="geo_kz" value="kz" <? if( $edit_task['geo_kz'] == 'kz' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/kz.png" class="flagcountry" alt="" />&nbsp;&nbsp;Казакстан</label>
								</div>
							  </td>
							</tr>
							<tr>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
								  <input type="checkbox" name="geo_am" id="geo_am" value="am" <? if( $edit_task['geo_am'] == 'am' ) echo 'checked="selected"';?> />
								  <label>&nbsp;<img src="/theme/images/flags/am.png" class="flagcountry" alt="" />&nbsp;&nbsp;Армения</label>
								</div>
							  </td>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
								  <input type="checkbox" name="geo_tj" id="geo_tj" value="tj" <? if( $edit_task['geo_tj'] == 'tj' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/tj.png" class="flagcountry" alt="" />&nbsp;&nbsp;Таджикистан</label>
								</div>
							  </td>
							</tr>
							<tr>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
								  <input type="checkbox" name="geo_az" id="geo_az" value="az" <? if( $edit_task['geo_az'] == 'az' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/az.png" class="flagcountry" alt="" />&nbsp;&nbsp;Азербайджан</label>
								</div>
							  </td>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
								  <input type="checkbox" name="geo_uz" id="geo_uz" value="uz" <? if( $edit_task['geo_uz'] == 'uz' ) echo 'checked="selected"';?> />
								  <label>&nbsp;<img src="/theme/images/flags/uz.png" class="flagcountry" alt="" />&nbsp;&nbsp;Узбекистан</label>
								</div>
							  </td>
							</tr>
							<tr>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
								  <input type="checkbox" name="geo_pt" id="geo_pt" value="pt" <? if( $edit_task['geo_pt'] == 'pt' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/pt.png" class="flagcountry" alt="" />&nbsp;&nbsp;Португалия</label>
								</div>
							  </td>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
							      <input type="checkbox" name="geo_es" id="geo_es" value="es" <? if( $edit_task['geo_es'] == 'es' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/es.png" class="flagcountry" alt="" />&nbsp;&nbsp;Испания</label>
								</div>
							  </td>
							</tr>
							<tr>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
							      <input type="checkbox" name="geo_ee" id="geo_ee" value="ee" <? if( $edit_task['geo_ee'] == 'ee' ) echo 'checked="selected"';?> />
								  <label>&nbsp;<img src="/theme/images/flags/ee.png" class="flagcountry" alt="" />&nbsp;&nbsp;Эстония</label>
								</div>
							  </td>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
							      <input type="checkbox" name="geo_lv" id="geo_lv" value="lv" <? if( $edit_task['geo_lv'] == 'lv' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/lv.png" class="flagcountry" alt="" />&nbsp;&nbsp;Латвия</label>
								</div>
							  </td>
							</tr>
							<tr>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
							      <input type="checkbox" name="geo_lt" id="geo_lt" value="lt" <? if( $edit_task['geo_lt'] == 'lt' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/lt.png" class="flagcountry" alt="" />&nbsp;&nbsp;Литва</label>
								</div>
							  </td>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
							      <input type="checkbox" name="geo_us" id="geo_us" value="us" <? if( $edit_task['geo_us'] == 'us' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/us.png" class="flagcountry" alt="" />&nbsp;&nbsp;Америка</label>
								</div>
							  </td>
							</tr>
							<tr>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
							      <input type="checkbox" name="geo_gb" id="geo_gb" value="gb" <? if( $edit_task['geo_gb'] == 'gb' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/gb.png" class="flagcountry" alt="" />&nbsp;&nbsp;Англия</label>
								</div>
							  </td>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
							      <input type="checkbox" name="geo_fr" id="geo_fr" value="fr" <? if( $edit_task['geo_fr'] == 'fr' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/fr.png" class="flagcountry" alt="" />&nbsp;&nbsp;Франция</label>
								</div>
							  </td>
							</tr>
							<tr>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
							      <input type="checkbox" name="geo_de" id="geo_de" value="de" <? if( $edit_task['geo_de'] == 'de' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/de.png" class="flagcountry" alt="" />&nbsp;&nbsp;Германия</label>
								</div>
							  </td>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
							      <input type="checkbox" name="geo_cn" id="geo_cn" value="cn" <? if( $edit_task['geo_cn'] == 'cn' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/cn.png" class="flagcountry" alt="" />&nbsp;&nbsp;Китай</label>
								</div>
							  </td>
							</tr>
							<tr>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
							      <input type="checkbox" name="geo_it" id="geo_it" value="it" <? if( $edit_task['geo_it'] == 'it' ) echo 'checked="selected"';?> /> 
								  <label>&nbsp;<img src="/theme/images/flags/it.png" class="flagcountry" alt="" />&nbsp;&nbsp;Италия</label>
								</div>
							  </td>
							  <td style="width: 50%;">
								<div class="checkbox checkbox-primary">
							      <input type="checkbox" name="geo_all" id="geo_all" value="all" <? if( $edit_task['geo_all'] == 'all' ) echo 'checked="selected"';?> /> <label>Другие страны</label>
								</div>
							  </td>
							</tr>
						  </table>
						</div>
					  </div>
					  
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label label-size-fix">Задание будут видить пользователи с рейтингом от</label>
						<div class="col-sm-10 input-size-one">
						  <input type="text" class="form-control" name="openReyting" id="openReyting" value="<?=$edit_task['openReyting']?>">
						  <span class="help-block m-b-none"></span> 
						</div>
					  </div>
					  
					  <div class="hr-dashed"></div>
					  <div class="form-group">
						<label class="col-sm-2 control-label label-size-fix">Количество выполнений в сутки</label>
						<div class="col-sm-10 input-size-one">
						  <input type="text" class="form-control" name="TimeoutInExecution" id="TimeoutInExecution" value="<?=$edit_task['TimeoutInExecution']?>">
						  <span class="help-block m-b-none"></span> 
						</div>
					  </div>
					  
					  <div class="hr-dashed"></div>
					  <div class="form-group" >
					    <label class="col-sm-2 control-label "></label>
					    <div class="col-sm-10 input-size-one">
						  <div class="checkbox checkbox-primary">
						    <input type="checkbox" size="50" name="clearcookie" id="clearcookie" <?if( $edit_task['clearcookie'] == 1 ) echo 'checked="checked"'?> />
						    <label for="">
							  Чистить Cookie исполнителю
						    </label>
					      </div>
					    </div>
					  </div>
					  
					  <div class="hr-dashed"></div>
					  <div class="form-group" >
					    <label class="col-sm-2 control-label "></label>
					    <div class="col-sm-10 input-size-one">
						  <div class="checkbox checkbox-primary">
						    <input type="checkbox" size="50" name="openWmid" id="openWmid" <?if( $edit_task['openWmid'] == 1 ) echo 'checked="checked"'?> />
						    <label for="">
							  Только для позьзователей с подтвержденным WMID
						    </label>
					      </div>
					    </div>
					  </div>
					  
					  <div class="form-group error-form-fix" id="block_title_error">
					    <div class="hr-dashed"></div>
						<div class="alert alert-dismissible alert-info" id="success_ajax">
						  Изменения успешно сохранены!
						</div>
						<div class="alert alert-dismissible alert-danger" id="error_ajax">
						  Внимание ошибка!
						</div>
					  </div>
					
					  <div class="hr-dashed"></div>
					  <div class="form-group class-float-right">
						<div class="col-sm-8 col-sm-offset-2">
						  <button class="btn btn-primary" type="submit" onclick="config_1();return false;">Сохранить изменения</button>
						</div>
					  </div>
					  
					</form>
				  </div>
				</div>
			  </div>
			  
			</div>
		  </div>
		</div>
	  </div>
	</div>
  <?
} 
?>