<?php if(!defined('FastCore')){ exit('Oops!');}
$opt['title'] = 'Мои видео';
?>
<!-- Page content -->
<div class="container-fluid">
<div class="card">
<div class="card-header text-uppercase p-3">
<div class="row align-items-center">
<div class="col">
<h3 class="mb-0">Мои видео материалы</h3>
</div>
<div class="col text-right">
<a href="/user/vsurf/add" class="btn btn-primary">Добавить видео</a>
</div>
</div>
</div></div>
<div class="card-body p-3">
<?
$numb = $db->query("SELECT * FROM `db_surfv` WHERE uid = '$uid'")->numRows();
if($numb < 1) {
echo '<div class="alert alert-danger text-center text-uppercase"><b>У вас нету ссылок! Вы можете "<a class="text-white" href="/user/vsurf/add">Разместить ссылку здесь</a>".</b></div>';
}
?>
<div class="row">
<?
$list = $db->query("SELECT * FROM `db_surfv` WHERE uid = '$uid' ORDER BY id DESC")->fetchAll();
foreach ($list as $surf) {
$eye = round($surf['balance']/$surf['price_click'],0);
?>
<div class="col-xl-4 col-md-6">
<div class="card" id="surf_<?=$surf['id'];?>">
<div><img class="card-img" src="https://i.ytimg.com/vi/<?=$surf['url2'];?>/mqdefault.jpg" alt="i"> </div>
<h3 class="card-title mb-1 text-center"><a href="<?=$surf['url'];?>" target="_blank"><b><?=$surf['title'];?></b></a></h3>
<div class="card-footer p-0">
<div class="p-1">Просмотры: <span class="float-right"><b title="Осталось просмотров"><?=$eye;?> <i class="fas fa-eye mr-1" aria-hidden="true"></i></b> <b title="Всего просмотрено" class="text-muted"><?=$surf['views'];?> <i class="fas fa-eye-slash" aria-hidden="true"></i></b></span></div>
<div class="p-1">Цена просмотра: <span class="float-right"> <b>₽ <?=$surf['price_click'];?></b></span></div>
<div class="p-1">Баланс: <b>₽ <?=$surf['balance'];?></b> <small class="text-danger" data-toggle="collapse" data-target="#advsum<?=$surf['id'];?>" style="cursor: pointer;"><b>[ПОПОЛНИТЬ]</b></small></div>
</div>
<div id="advsum<?=$surf['id'];?>" class="collapse">
<form class="balance_add m-3 mb-0" method="POST">Введите сумму пополнения:
<div class="input-group input-group-sm">
<div class="input-group-prepend"><span class="input-group-text">₽</span></div>
<input type="hidden" name="surf_id" value="<?=$surf['id']; ?>">
<input type="text" id="money" name="money" class="form-control col-2" placeholder="Минимум: 1.00" value="1.00">
<input type="hidden" id="type" name="type" value="add_balance">
<div class="input-group-append"><button class="btn btn-primary"><b>ОК</b></button></div>
</div>
</form>
</div>
<hr class="my-1">
<div class="row align-items-center">
<div class="col text-center">
<form action="" method="POST" class="m-1">
<?
if($surf['status'] == '1'){
echo '<button class="btn icon icon-shape icon-shape-warning rounded-circle status_surf" href="#" action="2" title="Остановить" surf_id="'.$surf['id'].'"><i class="fa fa-pause"></i></button>';
}else{
echo '<button class="btn icon icon-shape icon-shape-success rounded-circle status_surf" href="#" action="1" title="Запустить" surf_id="'.$surf['id'].'"><i class="fa fa-play"></i></button>';
}
?>
</form> </div>
<div class="col text-center">
<form action="/user/vsurf/edit" method="POST">
<input type="hidden" name="surf_id" value="<?=$surf['id']; ?>">
<button class="btn pl-1 pr-1 text-primary" title="Редактировать площадку #<?=$surf['id']; ?>"><i class="fa fa-edit"></i><br/> Изменить</button>
</form>
</div>
<div class="col text-center">
<form action="" method="POST">
<button surf_id="<?=$surf['id'];?>" href="#" class="btn pl-1 pr-1 text-danger delete" title="Удалить площадку #<?=$surf['id']; ?>"><i class="fa fa-times"></i><br/> Удалить </button>
</form>
</div>
</div>
</div>
</div>
<?
}
?>
</div>
</div>
</div></div>