<?
  ### Версия ПО (ДМ) 1.0.0.0 ( (c)2018 MISOFT Продукт защищен регистрацией патента и авторских прав! www.misoft.studio )
  ######################################################################################################################

  if ( $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' ) {
    define( 'ROOT_DIR', $_SERVER['DOCUMENT_ROOT'] );
    session_start();
    header( 'Content-type: text/html; charset=windows-1251' );
    include_once ROOT_DIR . '/engine/config.php';
    include_once ROOT_DIR . '/engine/function.php';
    
	
	
  } else {
    if ( !defined( 'MISOFT' ) ) { exit(); }
  }
  
  #Определяем протокол, и формируем адрес домена.
	if(isset($_SERVER['HTTPS'])) {
	   $prefix = 'https://';
	} else {
	$prefix = 'http://';
	}
    $location = $prefix.$_SERVER['HTTP_HOST'];
  
  if ( !isset( $_SESSION['iduser'] ) ) {
    echo '<div style="margin-left: -10px;" class="alert alert-info alert-dismissible fade in" role="alert">
		<button type="button" class="close" data-dismiss="alert" aria-label="Close">
			<span aria-hidden="true">&times;</span>
		</button>
		<h5 class="alert-heading"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Внимание!</h5>
		<p style="font-size: 14px;">Вы не авторизированы. Доступ к этой странице разрешен только авторизованным пользователям. <br>Пожалуйста, воспользуйтесь формой авторизации.</p>
		<p style="font-size: 14px;" class="m-b-0">Для перехода в форму авторизации нажмите <a class="a_link" href="/login" >login</a>.</p>
	  </div>';
  } else {
  
    include_once ROOT_DIR . '/modules/referrals/menu.php';
  	
  ?><script type="text/javascript" src="/theme/js/clipboard.min.js"></script>
    <script type="text/javascript">
	  $(document).ready(function() {
        $('.pred-mail-ref-ava').tipTip({defaultPosition:'right'});
	  });
	  
	  var cb = new Clipboard('.btn'); // класс кнопки
	  cb.on('success', function(e){
		alert("Скопировано в буфер обмена");
		window.setTimeout(function(){e.clearSelection();}, 1500);
	  });
    </script>
    <div class="content_bar">
	  <article class="postBox">
	    <div class="h2-title-header"><h2><a>Реферальные материалы</a></h2></div>
	    <div class="image_banner_p"></div>
	    <div class="textPreview" style="">
		  <p class="earnings_text" style="color: #545454;">
		    Основа хорошего заработка на <?=$config_site['sitename'];?> — рефералы. Это пользователи, которые зарегистрируются на нашем проекте по вашему приглашению, пройдя по специальной реферальской ссылке или баннеру.
		  </p>
	    </div>
		
	    <div class="div_centralizator_offtext" >
		  <div class="ref-links-block">
		    <div class=""> 
			  Реферальная ссылка 
			</div>
		    <div class="ref-link-color" id="ref-link"> 
			  <?=$location?>/r=<?=$_SESSION['iduser']?>
			</div>
			<button type="button" class="btn btn-primary btn-sm" data-clipboard-action="copy" data-clipboard-target="#ref-link" >
			  <i class="fa fa-clone" aria-hidden="true"></i> Копировать ссылку
			</button>
		  </div>
		</div>
		<div class="div_centralizator_offtext" >
		<div class="ref-links-menu">
		  <ul class="nav nav-tabs" id="myTab" role="tablist">
		    <li class="nav-item">
			  <a class="nav-link active" data-toggle="tab" href="#b1" role="tab" aria-controls="b1">468x60</a>
		    </li>
		    <li class="nav-item">
			  <a class="nav-link" data-toggle="tab" href="#b2" role="tab" aria-controls="b2">100x100</a>
		    </li>
		    <li class="nav-item">
			  <a class="nav-link" data-toggle="tab" href="#b3" role="tab" aria-controls="b3">200x300</a>
		    </li>
		    <li class="nav-item">
			  <a class="nav-link" data-toggle="tab" href="#b4" role="tab" aria-controls="b4">240x400</a>
		    </li>
		  </ul>
		  <div class="ref-links-menu-title">
		    Используйте любые нижеприведённые баннеры для приглашения рефералов. </br>Вы можете скопировать код баннера, для дальнейшего размещения на своём сайте или блоге.
		  </div>
		  <div class="tab-content">
			<div class="tab-pane active" id="b1" role="tabpanel">
			  <div class="ref-links-banner">
			    <div class="banner_gorizontal "><img src="<?=$location?>/temp/prom/b_468x60.gif" width="468" height="60" alt="" class="avatar" /></div>
				<div class="ref-links-button ref-links-textarea">
			      <code id="a_1">&lt;a href="<?=$location?>/r=<?=$_SESSION['iduser']?>" target="_blank"&gt;&lt;img src="<?=$location?>/temp/prom/b_468x60.gif" width="468" height="60" alt="" /&gt;&lt;/a&gt;</code>
				  <div class="ref-links-button">
				    <button type="button" class="btn btn-success btn-sm" data-clipboard-action="copy" data-clipboard-target="#a_1" >
				      <i class="fa fa-clone" aria-hidden="true"></i> Копировать код
				    </button>
				    <a href="<?=$location?>/temp/prom/b_468x60.gif" download >
				      <button type="button" class="btn btn-success btn-sm"  >
				        <i class="fa fa-download" aria-hidden="true"></i> Скачать баннер
				      </button>
				    </a>
				  </div>
			    </div>
			  </div>
			  <div class="ref-links-banner">
			    <div class="banner_gorizontal "><img src="<?=$location?>/temp/prom/b_468x60.gif" width="468" height="60" alt="" class="avatar" /></div>
				<div class="ref-links-button ref-links-textarea">
			      <code id="a_2">&lt;a href="<?=$location?>/r=<?=$_SESSION['iduser']?>" target="_blank"&gt;&lt;img src="<?=$location?>/temp/prom/b_468x61.gif" width="468" height="60" alt="" /&gt;&lt;/a&gt;</code>
				  <div class="ref-links-button">
				    <button type="button" class="btn btn-success btn-sm" data-clipboard-action="copy" data-clipboard-target="#a_2" >
				      <i class="fa fa-clone" aria-hidden="true"></i> Копировать код
				    </button>
				    <a href="<?=$location?>/temp/prom/b_468x60.gif" download >
				      <button type="button" class="btn btn-success btn-sm"  >
				        <i class="fa fa-download" aria-hidden="true"></i> Скачать баннер
				      </button>
				    </a>
				  </div>
			    </div>
			  </div>
			  <div class="ref-links-banner">
			    <div class="banner_gorizontal "><img src="<?=$location?>/temp/prom/b_468x60.gif" width="468" height="60" alt="" class="avatar" /></div>
				<div class="ref-links-button ref-links-textarea">
			      <code id="a_3">&lt;a href="<?=$location?>/r=<?=$_SESSION['iduser']?>" target="_blank"&gt;&lt;img src="<?=$location?>/temp/prom/b_468x62.gif" width="468" height="60" alt="" /&gt;&lt;/a&gt;</code>
				  <div class="ref-links-button">
				    <button type="button" class="btn btn-success btn-sm" data-clipboard-action="copy" data-clipboard-target="#a_3" >
				      <i class="fa fa-clone" aria-hidden="true"></i> Копировать код
				    </button>
				    <a href="<?=$location?>/temp/prom/b_468x60.gif" download >
				      <button type="button" class="btn btn-success btn-sm"  >
				        <i class="fa fa-download" aria-hidden="true"></i> Скачать баннер
				      </button>
				    </a>
				  </div>
			    </div>
			  </div>
			</div>
			
			<div class="tab-pane" id="b2" role="tabpanel">
			  <div class="ref-links-banner">
			    <div class="banner_gorizontal "><img src="<?=$location?>/temp/prom/b_468x60.gif" width="100" height="100" alt="" class="avatar" /></div>
				<div class="ref-links-button ref-links-textarea">
			      <code id="b_1">&lt;a href="<?=$location?>/r=<?=$_SESSION['iduser']?>" target="_blank"&gt;&lt;img src="<?=$location?>/temp/prom/a_100x100.gif" width="100" height="100" alt="" /&gt;&lt;/a&gt;</code>
				  <div class="ref-links-button">
				    <button type="button" class="btn btn-success btn-sm" data-clipboard-action="copy" data-clipboard-target="#b_1" >
				      <i class="fa fa-clone" aria-hidden="true"></i> Копировать код
				    </button>
				    <a href="<?=$location?>/temp/prom/b_468x60.gif" download >
				      <button type="button" class="btn btn-success btn-sm"  >
				        <i class="fa fa-download" aria-hidden="true"></i> Скачать баннер
				      </button>
				    </a>
				  </div>
			    </div>
			  </div>
			  <div class="ref-links-banner">
			    <div class="banner_gorizontal "><img src="<?=$location?>/temp/prom/b_468x60.gif" width="100" height="100" alt="" class="avatar" /></div>
				<div class="ref-links-button ref-links-textarea">
			      <code id="b_2">&lt;a href="<?=$location?>/r=<?=$_SESSION['iduser']?>" target="_blank"&gt;&lt;img src="<?=$location?>/temp/prom/b_100x100.gif" width="100" height="100" alt="" /&gt;&lt;/a&gt;</code>
				  <div class="ref-links-button">
				    <button type="button" class="btn btn-success btn-sm" data-clipboard-action="copy" data-clipboard-target="#b_2" >
				      <i class="fa fa-clone" aria-hidden="true"></i> Копировать код
				    </button>
				    <a href="<?=$location?>/temp/prom/b_468x60.gif" download >
				      <button type="button" class="btn btn-success btn-sm"  >
				        <i class="fa fa-download" aria-hidden="true"></i> Скачать баннер
				      </button>
				    </a>
				  </div>
			    </div>
			  </div>
			  <div class="ref-links-banner">
			    <div class="banner_gorizontal "><img src="<?=$location?>/temp/prom/b_468x60.gif" width="100" height="100" alt="" class="avatar" /></div>
				<div class="ref-links-button ref-links-textarea">
			      <code id="b_3">&lt;a href="<?=$location?>/r=<?=$_SESSION['iduser']?>" target="_blank"&gt;&lt;img src="<?=$location?>/temp/prom/v_100x100.gif" width="100" height="100" alt="" /&gt;&lt;/a&gt;</code>
				  <div class="ref-links-button">
				    <button type="button" class="btn btn-success btn-sm" data-clipboard-action="copy" data-clipboard-target="#b_3" >
				      <i class="fa fa-clone" aria-hidden="true"></i> Копировать код
				    </button>
				    <a href="<?=$location?>/temp/prom/b_468x60.gif" download >
				      <button type="button" class="btn btn-success btn-sm"  >
				        <i class="fa fa-download" aria-hidden="true"></i> Скачать баннер
				      </button>
				    </a>
				  </div>
			    </div>
			  </div>
			</div>
			
			<div class="tab-pane" id="b3" role="tabpanel">
			  <div class="ref-links-banner">
			    <div class="banner_gorizontal "><img src="<?=$location?>/temp/prom/b_468x60.gif" width="200" height="300" alt="" class="avatar" /></div>
				<div class="ref-links-button ref-links-textarea">
			      <code id="c_1">&lt;a href="<?=$location?>/r=<?=$_SESSION['iduser']?>" target="_blank"&gt;&lt;img src="<?=$location?>/temp/prom/a_200x300.gif" width="200" height="300" alt="" /&gt;&lt;/a&gt;</code>
				  <div class="ref-links-button">
				    <button type="button" class="btn btn-success btn-sm" data-clipboard-action="copy" data-clipboard-target="#c_1" >
				      <i class="fa fa-clone" aria-hidden="true"></i> Копировать код
				    </button>
				    <a href="<?=$location?>/temp/prom/b_468x60.gif" download >
				      <button type="button" class="btn btn-success btn-sm"  >
				        <i class="fa fa-download" aria-hidden="true"></i> Скачать баннер
				      </button>
				    </a>
				  </div>
			    </div>
			  </div>
			  <div class="ref-links-banner">
			    <div class="banner_gorizontal "><img src="<?=$location?>/temp/prom/b_468x60.gif" width="200" height="300" alt="" class="avatar" /></div>
				<div class="ref-links-button ref-links-textarea">
			      <code id="c_2">&lt;a href="<?=$location?>/r=<?=$_SESSION['iduser']?>" target="_blank"&gt;&lt;img src="<?=$location?>/temp/prom/b_200x300.gif" width="200" height="300" alt="" /&gt;&lt;/a&gt;</code>
				  <div class="ref-links-button">
				    <button type="button" class="btn btn-success btn-sm" data-clipboard-action="copy" data-clipboard-target="#c_2" >
				      <i class="fa fa-clone" aria-hidden="true"></i> Копировать код
				    </button>
				    <a href="<?=$location?>/temp/prom/b_468x60.gif" download >
				      <button type="button" class="btn btn-success btn-sm"  >
				        <i class="fa fa-download" aria-hidden="true"></i> Скачать баннер
				      </button>
				    </a>
				  </div>
			    </div>
			  </div>
			  <div class="ref-links-banner">
			    <div class="banner_gorizontal "><img src="<?=$location?>/temp/prom/b_468x60.gif" width="200" height="300" alt="" class="avatar" /></div>
				<div class="ref-links-button ref-links-textarea">
			      <code id="c_3">&lt;a href="<?=$location?>/r=<?=$_SESSION['iduser']?>" target="_blank"&gt;&lt;img src="<?=$location?>/temp/prom/c_200x300.gif" width="200" height="300" alt="" /&gt;&lt;/a&gt;</code>
				  <div class="ref-links-button">
				    <button type="button" class="btn btn-success btn-sm" data-clipboard-action="copy" data-clipboard-target="#c_3" >
				      <i class="fa fa-clone" aria-hidden="true"></i> Копировать код
				    </button>
				    <a href="<?=$location?>/temp/prom/b_468x60.gif" download >
				      <button type="button" class="btn btn-success btn-sm"  >
				        <i class="fa fa-download" aria-hidden="true"></i> Скачать баннер
				      </button>
				    </a>
				  </div>
			    </div>
			  </div> 
			</div>
			
			<div class="tab-pane" id="b4" role="tabpanel">
			  <div class="ref-links-banner">
			    <div class="banner_gorizontal "><img src="<?=$location?>/temp/prom/b_468x60.gif" width="240" height="400" alt="" class="avatar" /></div>
				<div class="ref-links-button ref-links-textarea">
			      <code id="d_1">&lt;a href="<?=$location?>/r=<?=$_SESSION['iduser']?>" target="_blank"&gt;&lt;img src="<?=$location?>/temp/prom/a_200x300.gif" width="240" height="400" alt="" /&gt;&lt;/a&gt;</code>
				  <div class="ref-links-button">
				    <button type="button" class="btn btn-success btn-sm" data-clipboard-action="copy" data-clipboard-target="#d_1" >
				      <i class="fa fa-clone" aria-hidden="true"></i> Копировать код
				    </button>
				    <a href="<?=$location?>/temp/prom/b_468x60.gif" download >
				      <button type="button" class="btn btn-success btn-sm"  >
				        <i class="fa fa-download" aria-hidden="true"></i> Скачать баннер
				      </button>
				    </a>
				  </div>
			    </div>
			  </div>
			  <div class="ref-links-banner">
			    <div class="banner_gorizontal "><img src="<?=$location?>/temp/prom/b_468x60.gif" width="240" height="400" alt="" class="avatar" /></div>
				<div class="ref-links-button ref-links-textarea">
			      <code id="d_2">&lt;a href="<?=$location?>/r=<?=$_SESSION['iduser']?>" target="_blank"&gt;&lt;img src="<?=$location?>/temp/prom/b_200x300.gif" width="240" height="400" alt="" /&gt;&lt;/a&gt;</code>
				  <div class="ref-links-button">
				    <button type="button" class="btn btn-success btn-sm" data-clipboard-action="copy" data-clipboard-target="#d_2" >
				      <i class="fa fa-clone" aria-hidden="true"></i> Копировать код
				    </button>
				    <a href="<?=$location?>/temp/prom/b_468x60.gif" download >
				      <button type="button" class="btn btn-success btn-sm"  >
				        <i class="fa fa-download" aria-hidden="true"></i> Скачать баннер
				      </button>
				    </a>
				  </div>
			    </div>
			  </div>
			  <div class="ref-links-banner">
			    <div class="banner_gorizontal "><img src="<?=$location?>/temp/prom/b_468x60.gif" width="240" height="400" alt="" class="avatar" /></div>
				<div class="ref-links-button ref-links-textarea">
			      <code id="d_3">&lt;a href="<?=$location?>/r=<?=$_SESSION['iduser']?>" target="_blank"&gt;&lt;img src="<?=$location?>/temp/prom/c_200x300.gif" width="240" height="400" alt="" /&gt;&lt;/a&gt;</code>
				  <div class="ref-links-button">
				    <button type="button" class="btn btn-success btn-sm" data-clipboard-action="copy" data-clipboard-target="#d_3" >
				      <i class="fa fa-clone" aria-hidden="true"></i> Копировать код
				    </button>
				    <a href="<?=$location?>/temp/prom/b_468x60.gif" download >
				      <button type="button" class="btn btn-success btn-sm"  >
				        <i class="fa fa-download" aria-hidden="true"></i> Скачать баннер
				      </button>
				    </a>
				  </div>
			    </div>
			  </div>
			</div>
		  </div>
	    </div>
	    </div>
		
		</br>
	  </article>
    </div>

<? } ?>