<?

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';
} else {
    if ( !defined( 'MISOFT' ) ) { exit(); }
}
$all_user_s6 = mysql_fetch_array( mysql_query( "SELECT COUNT(id) as count, SUM(paid) as sum, SUM(allpay) as pay FROM user WHERE reyting >= '".$config_site['status_meaning_6a']."'" ) );

$all_user_s5 = mysql_fetch_array( mysql_query( "SELECT COUNT(id) as count, SUM(paid) as sum, SUM(allpay) as pay FROM user WHERE reyting >= '".$config_site['status_meaning_5a']."' 
												AND reyting <= '".$config_site['status_meaning_5b']."'" ) );
$all_user_s4 = mysql_fetch_array( mysql_query( "SELECT COUNT(id) as count, SUM(paid) as sum, SUM(allpay) as pay FROM user WHERE reyting >= '".$config_site['status_meaning_4a']."' 
												AND reyting <= '".$config_site['status_meaning_4b']."'" ) );
$all_user_s3 = mysql_fetch_array( mysql_query( "SELECT COUNT(id) as count, SUM(paid) as sum, SUM(allpay) as pay FROM user WHERE reyting >= '".$config_site['status_meaning_3a']."' 
												AND reyting <= '".$config_site['status_meaning_3b']."'" ) );
$all_user_s2 = mysql_fetch_array( mysql_query( "SELECT COUNT(id) as count, SUM(paid) as sum, SUM(allpay) as pay FROM user WHERE reyting >= '".$config_site['status_meaning_2a']."'
												AND reyting <= '".$config_site['status_meaning_2b']."'" ) );
$all_user_s1 = mysql_fetch_array( mysql_query( "SELECT COUNT(id) as count, SUM(paid) as sum, SUM(allpay) as pay FROM user WHERE reyting >= '".$config_site['status_meaning_1a']."'
												AND reyting <= '".$config_site['status_meaning_1b']."'" ) );
?>
<div class="content_bar content_bar_fix_chain">
  <article class="postBox">
	
	<div class="h2-title-header"><h2><a>Рейтинг и Статусы</a></h2></div>
	
	<div class="image_career_p"></div>
	<div class="textPreview" style="">
	  <p class="earnings_text" style="color: #545454;">
		В системе <b><?=$config_site['sitename']?></b> пользователи могут иметь различные статусы аккаунта. Статус пользователя повышается в зависимости от его рейтинга. От вашего статуса и рейтинга, зависит ваш заработок в системе. Чем выше ваш статус, тем больше ваш заработок и больше различных преимуществ.
	  </p>
	</div>
	
	<div class="status-description-container">
	  <iframe width="462" height="260" src="<?=$config_site['link_video_status']?>" frameborder="0" allow="autoplay: on; encrypted-media" allowfullscreen></iframe>
	  <table class="standartTable" width="462px">
		<thead>
		  <th>Статус</th>
		  <th style="width: 17%; text-align: center;">Количество</th>
		  <th style="width: 17%; text-align: center;">Введено</th>
		  <th style="width: 17%; text-align: center;">Выведено</th>
		</thead>
		<tr>
		  <td ><?=$config_site['status_name_6']?></td>
		  <td class="centralizaor"><?=$all_user_s6['count']?> чел.</td>
		  <td class="centralizaor"><?=$all_user_s6['sum']?></td>
		  <td class="centralizaor"><?=$all_user_s6['pay']?></td>
		</tr>
		<tr>
		  <td ><?=$config_site['status_name_5']?></td>
		  <td class="centralizaor"><?=$all_user_s5['count']?> чел.</td>
		  <td class="centralizaor"><?=$all_user_s5['sum']?></td>
		  <td class="centralizaor"><?=$all_user_s5['pay']?></td>
		</tr>
		<tr>
		  <td ><?=$config_site['status_name_4']?></td>
		  <td class="centralizaor"><?=$all_user_s4['count']?> чел.</td>
		  <td class="centralizaor"><?=$all_user_s4['sum']?></td>
		  <td class="centralizaor"><?=$all_user_s4['pay']?></td>
		</tr>
		<tr>
		  <td ><?=$config_site['status_name_3']?></td>
		  <td class="centralizaor"><?=$all_user_s3['count']?> чел.</td>
		  <td class="centralizaor"><?=$all_user_s3['sum']?></td>
		  <td class="centralizaor"><?=$all_user_s3['pay']?></td>
		</tr>
		<tr>
		  <td ><?=$config_site['status_name_2']?></td>
		  <td class="centralizaor"><?=$all_user_s2['count']?> чел.</td>
		  <td class="centralizaor"><?=$all_user_s2['sum']?></td>
		  <td class="centralizaor"><?=$all_user_s2['pay']?></td>
		</tr>
		<tr>
		  <td ><?=$config_site['status_name_1']?></td>
		  <td class="centralizaor"><?=$all_user_s1['count']?> чел.</td>
		  <td class="centralizaor"><?=$all_user_s1['sum']?></td>
		  <td class="centralizaor"><?=$all_user_s1['pay']?></td>
		</tr>
	  </table>
	
	</div>	

	<span class="status-title-left"><i class="fa fa-question-circle" aria-hidden="true"></i> За что начисляется рейтинг?</span>
	<ul class="list-style3">
	  <li><span>Регистрация в системе +<?=$config['reyting']?> бал.</span></li>
	  <li><span>Привлечение реферала +<?=$config['refreyting']?> бал.</span></li>
	  <li><span>Подарить подарок +<?=$config['giftreyting']?> бал.</span></li>
	  <li><span>Съеденное яблоко +<?=$config['everybonus']?> бал.</span></li>
	  <? if($config['maxBonus24hRATING'] > 0 AND $config['minBonus24hRATING'] > 0) { ?><li><span>Ежедневный бонус от <?=$config['minBonus24hRATING']?> до <?=$config['maxBonus24hRATING']?> бал.</span></li><? } ?>
	  <li><span>Новая тема на форуме +<?=$config['new_topic_reyting']?> бал.</span></li>
	</ul>
 
	<span class="status-title-right" ><i class="fa fa-question-circle" aria-hidden="true"></i> За что отнимается рейтинг?</span>
	<ul class="list-style4">
	  <li><span>Отсутствие 7 суток -10.0 бал.</span></li>
	  <li><span>Бан на форуме -50.0 бал.</span></li>
	  <li><span>Бан в чате -15.0 бал.</span></li>
	</ul>
 
	<span class="status-money-title-left"><i class="fa fa-question-circle" aria-hidden="true"></i> За что начисляются вознаграждения? </span>
	<ul class="list-style5">
	  <li><span>Привлечение реферала +<?=$config['refBonusPrice']?> <?=$config['valutaname']?></span></li>
	  <? if($config['maxBonus24hRUB'] > 0 AND $config['minBonus24hRUB'] > 0) { ?><li><span>Ежедневный бонус от <?=$config['minBonus24hRUB']?> до <?=$config['maxBonus24hRUB']?> <?=$config['valutaname']?></span></li><? } ?>
	  <li><span>Бонус от реферера +любая сумма.</span></li>
	  <!--li><span>Вариант действия №4 -0.1 бал.</span></li-->
	</ul>
	
	
	<br><br><br><br><br>
	<div class="alert alert-info" role="alert" id="info_reg_1">
	  <i class="fa fa-info-circle" aria-hidden="true"></i> Внимание! Обязательно активируйте свой аккаунт, в противном случае вы не сможете использовать
	  <div style="padding-left: 17px;">наш сервис!</div>
	</div>
	
	<div style=" margin: 0 auto;">
	  <table class="standartTable">
		<thead>
		  <th>Описание</th>
		  <th style="width: 17%; text-align: center;"><?=$config_site['status_name_1']?></th>
		  <th style="width: 17%; text-align: center;"><?=$config_site['status_name_2']?></th>
		  <th style="width: 17%; text-align: center;"><?=$config_site['status_name_3']?></th>
		</thead>
		<tr>
		  <td >Рейтинг</td>
		  <td class="centralizaor"><?=$config_site['status_meaning_1a']?>-<?=$config_site['status_meaning_1b']?></td>
		  <td class="centralizaor"><?=$config_site['status_meaning_2a']?>-<?=$config_site['status_meaning_2b']?></td>
		  <td class="centralizaor"><?=$config_site['status_meaning_3a']?>-<?=$config_site['status_meaning_3b']?></td>
		</tr>
		<tr>
		  <td>доход от реферала I ур. <span style="color: #999999;">серфинг, тесты</span></td>
		  <td class="centralizaor"><?=$config['st1'] * 100?>%</td>
		  <td class="centralizaor"><?=$config['st2'] * 100?>%</td>
		  <td class="centralizaor"><?=$config['st3'] * 100?>%</td>
		</tr>
		<tr>
		  <td>доход от реферала I ур. <span style="color: #999999;">задания</span></td>
		  <td class="centralizaor"><?=$config['st13'] * 100?>%</td>
		  <td class="centralizaor"><?=$config['st14'] * 100?>%</td>
		  <td class="centralizaor"><?=$config['st15'] * 100?>%</td>
		</tr>
		<tr>
		  <td>доход от реферала II ур. <span style="color: #999999;">серфинг, тесты</span></td>
		  <td class="centralizaor"><?=$config['st7']?></td>
		  <td class="centralizaor"><?=$config['st8']?></td>
		  <td class="centralizaor"><?=$config['st9']?></td>
		</tr>
		<tr>
		  <td>участие в ярмарке рефералов</td>
		  <td class="centralizaor"><? if($config['referer_min_rating'] > $config_site['status_meaning_1b']) {?>только покупка<?} else {?>полное<?} ?></td>
		  <td class="centralizaor"><? if($config['referer_min_rating'] > $config_site['status_meaning_2b']) {?>только покупка<?} else {?>полное<?} ?></td>
		  <td class="centralizaor"><? if($config['referer_min_rating'] > $config_site['status_meaning_3b']) {?>только покупка<?} else {?>полное<?} ?></td>
		</tr>
		<tr>
		  <td>оставлять отзывы на стене</td>
		  <td class="centralizaor">-</td>
		  <td class="centralizaor">да</td>
		  <td class="centralizaor">да</td>
		</tr>
		<tr>
		  <td>максимальная сумма вывода в сутки</td>
		  <td class="centralizaor">15</td>
		  <td class="centralizaor">50</td>
		  <td class="centralizaor">100</td>
		</tr>
	  </table>
	  <br>
	  <table class="standartTable">
		<thead>
		  <th>Описание</th>
		  <th style="width: 17%; text-align: center;"><?=$config_site['status_name_4']?></th>
		  <th style="width: 17%; text-align: center;"><?=$config_site['status_name_5']?></th>
		  <th style="width: 17%; text-align: center;"><?=$config_site['status_name_6']?></th>
		</thead>
		<tr>
		  <td >Рейтинг</td>
		  <td class="centralizaor"><?=$config_site['status_meaning_4a']?>-<?=$config_site['status_meaning_4b']?></td>
		  <td class="centralizaor"><?=$config_site['status_meaning_5a']?>-<?=$config_site['status_meaning_5b']?></td>
		  <td class="centralizaor"><?=$config_site['status_meaning_6a']?></td>
		</tr>
		<tr>
		  <td>доход от реферала I ур. <span style="color: #999999;">серфинг, тесты</span></td>
		  <td class="centralizaor"><?=$config['st4'] * 100?>%</td>
		  <td class="centralizaor"><?=$config['st5'] * 100?>%</td>
		  <td class="centralizaor"><?=$config['st6'] * 100?>%</td>
		</tr>
		<tr>
		  <td>доход от реферала I ур. <span style="color: #999999;">задания</span></td>
		  <td class="centralizaor"><?=$config['st16'] * 100?>%</td>
		  <td class="centralizaor"><?=$config['st17'] * 100?>%</td>
		  <td class="centralizaor"><?=$config['st18'] * 100?>%</td>
		</tr>
		<tr>
		  <td>доход от реферала II ур. <span style="color: #999999;">серфинг, тесты</span></td>
		  <td class="centralizaor"><?=$config['st10']?></td>
		  <td class="centralizaor"><?=$config['st11']?></td>
		  <td class="centralizaor"><?=$config['st12']?></td>
		</tr>
		<tr>
		  <td>участие в ярмарке рефералов</td>
		  <td class="centralizaor"><? if($config['referer_min_rating'] > $config_site['status_meaning_4b']) {?>только покупка<?} else {?>полное<?} ?></td>
		  <td class="centralizaor"><? if($config['referer_min_rating'] > $config_site['status_meaning_5b']) {?>только покупка<?} else {?>полное<?} ?></td>
		  <td class="centralizaor"><? if($config['referer_min_rating'] > $config_site['status_meaning_6a']) {?>только покупка<?} else {?>полное<?} ?></td>
		</tr>
		<tr>
		  <td>оставлять отзывы на стене</td>
		  <td class="centralizaor">да</td>
		  <td class="centralizaor">да</td>
		  <td class="centralizaor">да</td>
		</tr>
		<tr>
		  <td>максимальная сумма вывода в сутки</td>
		  <td class="centralizaor">200</td>
		  <td class="centralizaor">300</td>
		  <td class="centralizaor">500</td>
		</tr>
	  </table>
	</div>
  </article>
</div>