<?php if(!defined('FastCore')){exit('Opss!');}
# Заголовок
$opt['title'] = 'Профиль';
# Пользователь вышел
if ($pg->segment[1] === 'logout') {
session_destroy(); header('Location: /'); return;
}
# Реф-ссылка
$url = ('https://'.$_SERVER['HTTP_HOST'].'/i/'.$uid);
# Кошельки
$ps = $db->query('SELECT * FROM db_purse WHERE id = ?',$uid)->fetchArray();
$refs = $user['refs'];
?>
<div class="row">
<div class="col-xl-3 col-sm-6 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-9">
<div class="d-flex align-items-center align-self-start">
<h4 class="mb-0"><span style=" font-size:9px" class="notranslate"> RUB</span> <?=sprintf("%.4f",$user['money_p']); ?></h4>
</div>
</div>
<div class="col-3">
<div class="icon icon-box-success ">
<span class="mdi mdi-arrow-bottom-left icon-item"></span>
</div>
</div>
</div>
<h6 class="text-muted font-weight-normal">Доступный баланс</h6>
</div>
</div>
</div>
<div class="col-xl-3 col-sm-6 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-9">
<div class="d-flex align-items-center align-self-start">
<h4 class="mb-0"><span style=" font-size:9px" class="notranslate"> RUB</span> <?=sprintf("%.4f",$user['money_b']); ?></h4>
</div>
</div>
<div class="col-3">
<div class="icon icon-box-success">
<span class="mdi mdi-arrow-bottom-left icon-item"></span>
</div>
</div>
</div>
<h6 class="text-muted font-weight-normal">Рекламный баланс</h6>
</div>
</div>
</div>
<div class="col-xl-3 col-sm-6 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-9">
<div class="d-flex align-items-center align-self-start">
<h4 class="mb-0"><span style=" font-size:9px" class="notranslate"> RUB</span> <?=sprintf("%.4f",$user['sum_in']); ?></h4>
</div>
</div>
<div class="col-3">
<div class="icon icon-box-success">
<span class="mdi mdi-arrow-bottom-left icon-item"></span>
</div>
</div>
</div>
<h6 class="text-muted font-weight-normal">Пополнения</h6>
</div>
</div>
</div>
<div class="col-xl-3 col-sm-6 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-9">
<div class="d-flex align-items-center align-self-start">
<h4 class="mb-0"><span style=" font-size:9px" class="notranslate"> RUB</span> <?=sprintf("%.4f",$user['sum_out']); ?></h4>
</div>
</div>
<div class="col-3">
<div class="icon icon-box-danger ">
<span class="mdi mdi-arrow-top-right icon-item"></span>
</div>
</div>
</div>
<h6 class="text-muted font-weight-normal">Выплаты</h6>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">Финансовая статистика</h4>
<canvas id="transaction-history" class="transaction-chart"></canvas>
<div class="bg-gray-dark d-flex d-md-block d-xl-flex flex-row py-3 px-4 px-md-3 px-xl-4 rounded mt-3">
<div class="text-md-center text-xl-left">
<h6 class="mb-1">Пополнения</h6>
<?PHP
$ins = $db->query("SELECT * FROM db_insert WHERE uid = '$uid' ORDER BY id DESC LIMIT 1")->fetchAll();
foreach($ins as $insert){
?>
<p class="text-muted mb-0"><?=date("d.m.Y в H:i",$insert['add']); ?></p>
<?PHP
}
?>
</div>
<div class="align-self-center flex-grow text-right text-md-center text-xl-right py-md-2 py-xl-0">
<?PHP
$ins = $db->query("SELECT * FROM db_insert WHERE uid = '$uid' ORDER BY id DESC LIMIT 1")->fetchAll();
foreach($ins as $insert){
?>
<h6 class="font-weight-bold mb-0"><?=sprintf("%.4f",$insert['sum']); ?><span style=" font-size:9px" class="notranslate">RUB</span></h6>
<?PHP
}
?>
</div>
</div>
<div class="bg-gray-dark d-flex d-md-block d-xl-flex flex-row py-3 px-4 px-md-3 px-xl-4 rounded mt-3">
<div class="text-md-center text-xl-left">
<h6 class="mb-1">Выплата</h6>
<?PHP
$pays = $db->query("SELECT * FROM db_payout WHERE uid = '$uid' ORDER BY id DESC LIMIT 1")->fetchAll();
foreach($pays as $pay){
?>
<p class="text-muted mb-0"><?=date("d.m.Y в H:i",$pay['add']); ?></p>
<?PHP
}
?>
</div>
<div class="align-self-center flex-grow text-right text-md-center text-xl-right py-md-2 py-xl-0">
<?PHP
$pays = $db->query("SELECT * FROM db_payout WHERE uid = '$uid' ORDER BY id DESC LIMIT 1")->fetchAll();
foreach($pays as $pay){
?>
<h6 class="font-weight-bold mb-0"><?=sprintf("%.4f",$pay['sum']); ?><span style=" font-size:9px" class="notranslate"> RUB</span></h6>
<?PHP
}
?>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-8 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<div class="d-flex flex-row justify-content-between">
<h4 class="card-title mb-1">Мой профиль</h4>
</div>
<div class="row">
<div class="col-12">
<div class="preview-list">
<div class="preview-item border-bottom">
<div class="preview-thumbnail">
<div class="preview-icon bg-primary">
<i class="mdi mdi-file-document"></i>
</div>
</div>
<div class="preview-item-content d-sm-flex flex-grow">
<div class="flex-grow">
<h6 class="preview-subject">Ваш логин:</h6>
<p class="text-muted mb-0">Ваш ID:</p>
</div>
<div class="mr-auto text-sm-right pt-2 pt-sm-0">
<p class="text-muted"><?=$user['login'];?></p>
<p class="text-muted mb-0"><?=$user['id'];?> </p>
</div>
</div>
</div>
<div class="preview-item border-bottom">
<div class="preview-thumbnail">
<div class="preview-icon bg-success">
<i class="mdi mdi-cloud-download"></i>
</div>
</div>
<div class="preview-item-content d-sm-flex flex-grow">
<div class="flex-grow">
<h6 class="preview-subject">Пригласил: </h6>
<p class="text-muted mb-0">Дата регистрации:</p>
</div>
<div class="mr-auto text-sm-right pt-2 pt-sm-0">
<p class="text-muted"><?=$user['referer'];?></p>
<p class="text-muted mb-0"><?=date("d.m.Y в H:i",$user['reg']);?></p>
</div>
</div>
</div>
<div class="preview-item border-bottom">
<div class="preview-thumbnail">
<div class="preview-icon bg-danger">
<i class="mdi mdi-email-open"></i>
</div>
</div>
<div class="preview-item-content d-sm-flex flex-grow">
<div class="flex-grow">
<h6 class="preview-subject">Ваша почта:</h6>
<p class="text-muted mb-0">Время:</p>
</div>
<div class="mr-auto text-sm-right pt-2 pt-sm-0">
<p class="text-muted"><?=($user['activation'] == 0) ? '<small class="text-danger">(Не подтвержден)</small>' : '';?> <?=$user['email'];?></p>
<p class="text-muted mb-0"><div id="servertime" class="text-left" style="display: inline;"><?=date ("H:i:s");?><script>setInterval(function() {var time = document.getElementById('servertime').innerHTML;time = time.split(':');var hour = parseInt(time[0]);var minute = parseInt(time[1]);var second = parseInt(time[2]);++second;if(second >= 60) {second = 0;++minute;if(minute >= 60) {minute = 0;++hour;if(hour >= 24) {hour = 0;}}}document.getElementById('servertime').innerHTML = (hour < 10 ? "0" + hour : hour) + ":" + (minute < 10 ? "0" + minute : minute) + ":" + (second < 10 ? "0" + second : second);}, 1000);</script> </div></p>
</div>
</div>
</div>
<div class="preview-item border-bottom">
<div class="preview-thumbnail">
<div class="preview-icon bg-info">
<i class="mdi mdi-clock"></i>
</div>
</div>
<div class="preview-item-content d-sm-flex flex-grow">
<div class="flex-grow">
<h6 class="preview-subject">Ваш ПРОФИТ:</h6>
<p class="text-muted mb-0">Реф-доход:</p>
</div>
<div class="mr-auto text-sm-right pt-2 pt-sm-0">
<p class="text-muted"><span style=" font-size:9px" class="notranslate"> RUB</span> <?=bcdiv($user['speed'],1,2); ?></p>
<p class="text-muted mb-0"><span style=" font-size:9px" class="notranslate"> RUB</span> <?=sprintf("%.4f",$user['income']); ?></p>
</div>
</div>
</div>
<div class="preview-item">
<div class="preview-thumbnail">
<div class="preview-icon bg-warning">
<i class="mdi mdi-chart-pie"></i>
</div>
</div>
<div class="preview-item-content d-sm-flex flex-grow">
<div class="flex-grow">
<h6 class="preview-subject">Ваши партнеры:</h6>
<p class="text-muted font-weight-normal">Реферальная ссылка:</p>
</div>
<div class="mr-auto text-sm-right pt-2 pt-sm-0">
<p class="text-muted"><?=$refs; ?></p>
<p class="text-muted font-weight-normal"><?=$url; ?></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div>
<div class="row">
<div class="col-sm-4 grid-margin">
<div class="card">
<div class="card-body">
<h5>Серфинг доход</h5>
<div class="row">
<div class="col-8 col-sm-12 col-xl-8 my-auto">
<div class="d-flex d-sm-block d-md-flex align-items-center">
<h3 class="mb-0"><span style=" font-size:9px" class="notranslate"> RUB</span> <?=sprintf("%.4f",$user['surf_earn']); ?></h3>
</div>
</div>
<div class="col-4 col-sm-12 col-xl-4 text-center text-xl-right">
<i class="icon-lg mdi mdi-codepen text-primary ml-auto"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-4 grid-margin">
<div class="card">
<div class="card-body">
<h5>Реф-доход</h5>
<div class="row">
<div class="col-8 col-sm-12 col-xl-8 my-auto">
<div class="d-flex d-sm-block d-md-flex align-items-center">
<h3 class="mb-0"><span style=" font-size:9px" class="notranslate"> RUB</span> <?=sprintf("%.4f",$user['income']); ?></h3>
</div>
</div>
<div class="col-4 col-sm-12 col-xl-4 text-center text-xl-right">
<i class="icon-lg mdi mdi-wallet-travel text-danger ml-auto"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-4 grid-margin">
<div class="card">
<div class="card-body">
<h5>Серфинг просмотры</h5>
<div class="row">
<div class="col-8 col-sm-12 col-xl-8 my-auto">
<div class="d-flex d-sm-block d-md-flex align-items-center">
<h3 class="mb-0"><?=$user['surf_view']; ?></h3>
</div>
</div>
<div class="col-4 col-sm-12 col-xl-4 text-center text-xl-right">
<i class="icon-lg mdi mdi-monitor text-success ml-auto"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="card full-height">
<div class="card-body"style="box-shadow: 0px 22px 20px 0px rgb(41 26 85 / 27%);">
<h4 class="card-title mb-4">Последние 5 пополнений</h4>
<div class="table-responsive">
<table class="table table-sm table-striped text-center">
<thead>
<th>Оплачено</th>
<th>Зачисление</th>
<th>Дата</th>
<th>Статус</th>
</thead>
<?PHP
$status_array = array( 0 => "<span class='badge badge-danger'>Отменена</span>", 1 => "<span class='badge badge-success'>Успешно</span>");
$img_array = array('payeer' => 'py', 'freekassa' => 'fk', 'perfect' => 'pm', 'yoomoney' => 'io', 'qiwi' => 'qw', 'bitcoin' => 'bt'); // платежки
$ins = $db->query("SELECT * FROM db_insert WHERE uid = '$uid' ORDER BY id DESC LIMIT 5")->fetchAll();
foreach($ins as $insert){
?>
<tr>
<td><?=sprintf("%.2f",$insert['sum']); ?></td>
<td><?=sprintf("%.2f",$insert['sum_x']); ?></td>
<td><?=date("d.m.Y в H:i",$insert['add']); ?></td>
<td><?=$status_array[$insert['status']]; ?></td>
</tr>
<?PHP
}
?>
</table>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-body"style="box-shadow: 0px 22px 20px 0px rgb(41 26 85 / 27%);">
<h4 class="card-title mb-4">Последние 5 выплат</h4>
<div class="table-responsive">
<table class="table table-sm table-striped text-center">
<thead>
<th>Сумма</th>
<th>Кошелек</th>
<th>Дата</th>
<th>Статус</th>
</thead>
<?PHP
$status_array = array( 0 => "<span class='badge badge-info'>Проверяется</span>", 1 => "<span class='badge badge-warning'>Выплачивается</span>", 2 => "<span class='badge badge-danger'>Отменена</span>", 3 => "<span class='badge badge-success'>Выплачено</span>");
$pays = $db->query("SELECT * FROM db_payout WHERE uid = '$uid' ORDER BY id DESC LIMIT 5")->fetchAll();
foreach($pays as $pay){
?>
<tr>
<td><?=sprintf("%.2f",$pay['sum']); ?></td>
<td><?=$pay['purse']; ?></td>
<td><?=date("d.m.Y в H:i",$pay['add']); ?></td>
<td><?=$status_array[$pay['status']]; ?></td>
</tr>
<?PHP
}
?>
</table>
</div>
</div>
</div>
</div>
</div>
</div>