<?php if(!defined('FastCore')){exit('Opss!');}
# Заголовки
$opt = array(
'title' => 'Статистика',
'description' => 'Статистика нашего проекта, Вы можете посмотреть лидеров и активность игроков.'
);
# Статистика
$stats = $db->query("SELECT * FROM db_stats WHERE id = '1'")->fetchArray();
# Количество 24 часа
$times = time() - 60*60*24;
$users_rows = $db->query("SELECT reg FROM `db_users` WHERE `reg` > '$times'")->numRows();
$users24 = $users_rows;
?>
<div class="section section--head">
<div class="container">
<div class="row">
<!-- title -->
<div class="col-12 col-md-8 offset-md-2 col-lg-6 offset-lg-3">
<div class="section__title">
<h1>{!TITLE!}</h1>
</div>
</div>
<!-- end title -->
</div>
</div>
</div>
<section class="section section-lg pt-lg-0 mt--100">
<div class="container">
<div class="row">
<div class="col-lg-8 ml-lg-auto">
<div class="card bg-default" style="height: 480px;border: 2px solid rgba(255,255,255,0.05);
background: linear-gradient(150deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);">
<div class="card-header bg-transparent">
<div class="row align-items-center">
<div class="col">
<h6 class="text-light text-uppercase ls-1 mb-1">Статистика по дням</h6>
<h5 class="h3 text-white mb-0">ЖИВАЯ СТАТИСТИКА</h5>
</div>
<div class="col">
</div>
</div>
</div>
<div class="card-body p-2">
<!-- Chart -->
<div class="chart">
<canvas id="myChart" class="chart-canvas"></canvas>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card text-uppercase"style="border: 2px solid rgba(255,255,255,0.05);
background: linear-gradient(150deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);color: #ffffff;">
<div class="card-header bg-transparent">
<div class="row align-items-center">
<div class="col">
<h6 class="text-light text-uppercase ls-1 mb-1">Общая статистика за все время</h6>
<h5 class="h3 text-white mb-0">Статистика проекта</h5>
</div>
</div>
</div>
<div class="card-body">
<div style="display: block; height: 370px;">
<div class="row border-bottom">
<div class="col col-3"><div class="icon icon-shape icon-shape-primary rounded-circle mt-1"> <i class="far fa-user"></i> </div></div>
<div class="col col-9 pl-1"><p class="mb-2"><b class="h2"><?=$stats['users'];?> <small>чел.</small></b><br/><small class="h5">Пользователей</small></p></div>
</div>
<div class="row border-bottom pt-2">
<div class="col col-3"><div class="icon icon-shape icon-shape-primary rounded-circle mt-1"> <i class="fa fa-user-plus"></i> </div></div>
<div class="col col-9 pl-1"><p class="mb-2"><b class="h2">+<?=$users24;?> <small>чел.</small></b><br/><small class="h5">Новых за 24 часа</small></p></div>
</div>
<div class="row border-bottom pt-2">
<div class="col col-3"><div class="icon icon-shape icon-shape-primary rounded-circle mt-1"> <i class="fa fa-ruble-sign"></i> </div></div>
<div class="col col-9 pl-1"><p class="mb-2"><b class="h2"><?=round($stats['payments'],2);?> <small>RUB</small></b><br/><small class="h5">Выплачено</small></p></div>
</div>
<div class="row border-bottom pt-2">
<div class="col col-3"><div class="icon icon-shape icon-shape-primary rounded-circle mt-1"> <i class="fa fa-eye"></i> </div></div>
<div class="col col-9 pl-1"><p class="mb-2"><b class="h2"><?=$stats['views'];?> <small>ссылок</small></b><br/><small class="h5">Всего просмотров</small></p></div>
</div>
<div class="row pt-2">
<div class="col col-3"><div class="icon icon-shape icon-shape-primary rounded-circle mt-1"> <i class="fa fa-calendar-alt"></i> </div></div>
<div class="col col-9 pl-1"><p class="mb-2"><b class="h2"><?=intval(((time() - $config->start_time) / 86400 ) +1); ?> <small>дней</small></b><br/><small class="h5">Сервис работает</small></p></div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="container">
<div class="row blocklinks">
<?
$linksss = $db->query("SELECT * FROM db_links ORDER BY id DESC LIMIT 6")->fetchAll();
foreach ($linksss as $link) {
?>
<div class="col-lg-2 col-md-4 linklist">
<a href="/go/<?=$link['id'];?>" target="_blank">
<span class="bylnkzag" title="Переходов: <?=$link['count'];?>"><?=$link['text'];?></span>
</a>
</div>
<?
}
?>
<?php if ($uid) : ?>
<a class="buylink btn-danger" href="/user/links" title="Купить ссылку "><span class="fa fa-plus"></span></a>
<?php endif;?>
<?php if (!$uid) : ?>
<a class="buylink btn-primary" href="/links" title="Купить ссылку "><span class="fa fa-info"></span></a>
<?php endif;?>
</div>
</div>
<br>
<!-- Chart JS -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
<?php
// берем статистику
$sorterSt = $db->query('SELECT * FROM db_logstat WHERE id ORDER BY id DESC LIMIT 1')->fetchArray();
$idLog = $sorterSt['id']-7;
$logStats= $db->query('SELECT * FROM db_logstat LIMIT '.$idLog.',7')->fetchAll();
?>
<script>
var ctx = document.getElementById('myChart');
var labels_data = [<?php foreach($logStats as $ls){ echo '"'.date("d-m-Y",$ls['date_add']).'",';}?>];
var views_data = [<?php foreach($logStats as $ls2){ echo $ls2['surf_view'].',';}?>];
var regs_data = [<?php foreach($logStats as $ls3){ echo $ls3['regs'].',';}?>];
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: labels_data,
datasets: [{
label: 'Регистрации',
pointRadius: 5,
backgroundColor: '#2dce89',
borderColor: '#2dce89',
data: regs_data
}, {
label: 'Просмотры',
pointRadius: 5,
data: views_data
}]
},
options: {
tooltips: {
mode: 'index',
intersect: false,
},
hover: {
mode: 'nearest',
intersect: true
},
maintainAspectRatio: false,
legend: {
display: true,
labels: { fontColor: '#abc' }
},
}
});
</script>
<div class="row">
<div class="col-xl-6">
<div class="card"style="border: 2px solid rgba(255,255,255,0.05);
background: linear-gradient(150deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);color: #ffffff;">
<div class="card-header border-0">
<div class="row align-items-center">
<div class="col">
<h3 class="mb-0">Последние 20 выплат</h3>
</div>
</div>
</div>
<div class="table-responsive">
<!-- Projects table -->
<table class="table align-items-center table-flush">
<thead class="thead-light" style="color: #ffffff;">
<tr>
<th scope="col">Пользователь</th>
<th scope="col">Выплата</th>
<th scope="col" class="text-right">Дата операции</th>
</tr>
</thead>
<tbody>
<?php
$payout = $db->query('SELECT * FROM db_payout WHERE status = 3 ORDER BY id DESC LIMIT 20')->fetchAll();
foreach ($payout as $pay) {
?>
<tr style="color: #ffffff;">
<th scope="row"><i class="fa fa-user"></i> <?=$pay['login']; ?></th>
<td><i class="fas fa-arrow-down text-warning mr-2"></i> <?= sprintf("%.2f",$pay['sum']); ?> <span style=" font-size:9px" class="notranslate"> RUB</span></td>
<td class="text-right"><?=date("d/m/Y в H:i",$pay['add']); ?> <i class="far fa-clock"></i> </td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-xl-6">
<div class="card"style="border: 2px solid rgba(255,255,255,0.05);
background: linear-gradient(150deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);color: #ffffff;">
<div class="card-header border-0">
<div class="row align-items-center">
<div class="col">
<h3 class="mb-0">Последние 20 пополнений</h3>
</div>
</div>
</div>
<div class="table-responsive">
<!-- Projects table -->
<table class="table align-items-center table-flush">
<thead class="thead-light"style="color: #ffffff;">
<tr>
<th scope="col">Логин</th>
<th scope="col">Пополнение</th>
<th scope="col" class="text-right">Дата операции</th>
</tr>
</thead>
<tbody>
<?php
$inserts = $db->query('SELECT * FROM db_insert WHERE status = 1 ORDER BY id DESC LIMIT 20')->fetchAll();
foreach ($inserts as $ins) {
?>
<tr style="color: #ffffff;">
<th scope="row"><i class="fa fa-user"></i> <?=$ins['login']; ?></th>
<td><i class="fas fa-arrow-up text-success mr-2"></i> <?= sprintf("%.2f",$ins['sum']); ?> <span style=" font-size:9px" class="notranslate"> RUB</span></td>
<td class="text-right"><?=date("d/m/Y в H:i",$ins['add']); ?> <i class="far fa-clock"></i> </td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>