Initial import
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
|
||||
<link rel="stylesheet" href="/_public/assets/css/collection-objects-greed.css">
|
||||
<?php
|
||||
|
||||
use app\models\parsed\FavoriteModel;
|
||||
use app\models\register\Collections;
|
||||
use app\models\RegisterObjects;
|
||||
use app\models\Ts;
|
||||
use app\models\UserFavorites;
|
||||
use app\services\Auth;
|
||||
|
||||
$user = Auth::getUser();
|
||||
|
||||
Ts::set([47, 104, 170]);
|
||||
|
||||
if ($user):
|
||||
|
||||
$fav = UserFavorites::find()->where(['user_id' => $user->id])->all();
|
||||
$buffer = [];
|
||||
foreach ($fav as $f) {
|
||||
$buffer[$f->table][] = $f->fid;
|
||||
}
|
||||
$favoriteModels = [];
|
||||
foreach ($buffer as $b => $ids) {
|
||||
switch ($b) {
|
||||
case 'collections':
|
||||
foreach (Collections::find()->where(['IN', 'id', $ids])->all() as $m) {
|
||||
$fm = new FavoriteModel();
|
||||
$fm->img = $m->getImg();
|
||||
$fm->url = $m->getUrl();
|
||||
$fm->name = $m->title();
|
||||
$favoriteModels[104][] = $fm;
|
||||
}
|
||||
break;
|
||||
case 'register_objects':
|
||||
foreach (RegisterObjects::find()->where(['IN', 'id', $ids])->andWhere(['lib_type' => 1])->all() as $m) {
|
||||
$fm = new FavoriteModel();
|
||||
$fm->img = $m->getImg();
|
||||
$fm->url = $m->getUrl();
|
||||
$fm->name = $m->getTitle();
|
||||
$favoriteModels[47][] = $fm;
|
||||
}
|
||||
foreach (RegisterObjects::find()->where(['IN', 'id', $ids])->andWhere(['lib_type' => 2])->all() as $m) {
|
||||
$fm = new FavoriteModel();
|
||||
$fm->img = $m->getImg();
|
||||
$fm->url = $m->getLibraryUrl();
|
||||
$fm->name = $m->getTitle();
|
||||
$favoriteModels[170][] = $fm;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php foreach ($favoriteModels as $type => $group): ?>
|
||||
<div class="top25">
|
||||
<div class="group-title"><?= Ts::get($type) ?></div>
|
||||
<div class="collection-greed top10">
|
||||
<div class="content-out gallery">
|
||||
<?php foreach ($group as $f): ?>
|
||||
<div class="gallery__item">
|
||||
<a href="<?= $f->url ?>">
|
||||
<img class="gallery__img" src="<?= $f->img ?>">
|
||||
<div class="gallery__item_title"><?= explode('.', $f->name)[0] ?>.</div>
|
||||
</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* @var array $orders
|
||||
* @var array $message
|
||||
* @var string $lg
|
||||
*/
|
||||
\app\models\Ts::set([251])
|
||||
?>
|
||||
<div class="order-items order-bookings">
|
||||
<?php foreach ($orders['bookings'] as $order_id => $bookings):
|
||||
|
||||
?>
|
||||
<div class="order-item flex">
|
||||
<?php
|
||||
/** @var \app\models\OrderBooking $b */
|
||||
foreach ($bookings as $b):
|
||||
$order = $b->order;
|
||||
$bookHeader = '';
|
||||
$title = \app\models\Ts::get(251);
|
||||
|
||||
if($b->event) {
|
||||
$title = $b->event->title(Yii::$app->language);
|
||||
$bookHeader = '<div class="order-sub-item-title">'. $message['ticket_for'][$lg] . ': "'.$title.'"</div>';
|
||||
} else {
|
||||
$bookHeader = '<div class="order-sub-item-title" style="color: darkred">'.$title.'</div>';
|
||||
}
|
||||
?>
|
||||
<div class="order-sub-item">
|
||||
<?= $bookHeader ?>
|
||||
<div class="type"><b
|
||||
style="color: grey"><?= $message['ticket_type'][$lg] ?></b>: <?= $b->{'name_' . $lg} ?>
|
||||
- <?= $b->single_price ?> лв.
|
||||
</div>
|
||||
<div class="type"><b
|
||||
style="color: grey"><?= $message['ticket_count'][$lg] ?></b>: <?= $b->tickets_count ?>
|
||||
</div>
|
||||
<div class=""><b
|
||||
style="color: grey"><?= $message['event_date'][$lg] ?></b>: <?= $b->formatedHtmlDate() ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ticket" style="min-width: 300px">
|
||||
<div class="status <?= $order->payment && $order->payment->status == 'PAID' ? 'paid' : '' ?>"><?= $order->statusStr() ?></div>
|
||||
<?php if ($order->payment && $order->payment->status == 'PAID'): ?>
|
||||
<div onclick="openTicketDetails(this)" data-ticket="<?= $b->id ?>"
|
||||
class="item-button <?= $order->payment->status !== 'PAID' ? 'disabled' : '' ?>"><?= $message['ticket'][$lg] ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* @var array $orders
|
||||
* @var array $message
|
||||
* @var string $lg
|
||||
*/
|
||||
|
||||
use app\models\RegisterObjectFiles;
|
||||
use app\services\JWT;
|
||||
|
||||
?>
|
||||
<style>
|
||||
.download-link {
|
||||
border: 1px solid #999999;
|
||||
width: 47%;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.download-link:hover {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
.download-link .download-link-content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
.download-link-content .loader {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 15px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: none;
|
||||
}
|
||||
.download-link-content .loader.loader-active {
|
||||
display: block !important;
|
||||
}
|
||||
@media (max-width: 991px) {
|
||||
.download-link {
|
||||
width: calc(100% - 20px) !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 500px) {
|
||||
.download-link .download-link-content .img {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.lds-ring {
|
||||
position: relative;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
display: none;
|
||||
}
|
||||
.lds-ring div {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin: 5px;
|
||||
border: 5px solid #999999;
|
||||
border-radius: 50%;
|
||||
animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
||||
border-color: #999999 transparent transparent transparent;
|
||||
}
|
||||
.lds-ring div:nth-child(1) {
|
||||
animation-delay: -0.45s;
|
||||
}
|
||||
.lds-ring div:nth-child(2) {
|
||||
animation-delay: -0.3s;
|
||||
}
|
||||
.lds-ring div:nth-child(3) {
|
||||
animation-delay: -0.15s;
|
||||
}
|
||||
@keyframes lds-ring {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
.selected-collection {
|
||||
background: var(--color-main-brigth-ultra-3) !important;
|
||||
}
|
||||
</style>
|
||||
<div class="order-items order-collections active">
|
||||
<?php foreach ($orders['collections'] as $order_id => $collections): ?>
|
||||
<div class="order-item">
|
||||
<?php
|
||||
/** @var $collection \app\models\OrderProduct */
|
||||
foreach ($collections as $collection):
|
||||
$order = $collection->order;
|
||||
$collectionModel = $collection->model_class;
|
||||
|
||||
/** @var $collectionTo \app\models\register\Collections */
|
||||
$collectionTo = $collectionModel::findOne($collection->model_id);
|
||||
|
||||
$start = null;
|
||||
$last_time = null;
|
||||
|
||||
if ($order->payment->status == 'PAID') {
|
||||
$pay_on = $order->payment->response_time;
|
||||
}
|
||||
?>
|
||||
<div class="order-sub-item" id="collection-<?= $collectionTo->id ?>">
|
||||
<div class="order-sub-item-title"><?= $collection->{'name_' . $lg} ?></div>
|
||||
<div class="status <?= $order->payment && $order->payment->status == 'PAID' ? 'paid' : '' ?>"><?= $order->statusStr() ?></div>
|
||||
<?php if ($order->payment->status == 'PAID'): ?>
|
||||
<div class="order-sub-item-title"><?= date('d.m.Y', strtotime($collection->order->payment->response_time))?></div>
|
||||
<div class="flex flex-wrap">
|
||||
<?php foreach ($collectionTo->collectionsObjects as $collectionsObject):
|
||||
$object_id = $collectionsObject->object->id;
|
||||
$collection_id = $collectionTo->id;
|
||||
$token_id = JWT::encode(['object_id' => $object_id, 'collection_id' => $collection_id], JWT::SECRET_KEY)
|
||||
?>
|
||||
<?php if (sizeof($collectionsObject->object->getRegisterObjectImages()) > 0):
|
||||
/** @var $file RegisterObjectFiles */
|
||||
$file = $collectionsObject->object->getRegisterObjectImages()[0];
|
||||
$first_img = $file->getResizedImg()
|
||||
?>
|
||||
<div onclick="downloadThis(this)" class="download-link"
|
||||
data-href="/<?= $lg ?>/user/collection-zip/?id=<?= $token_id ?>">
|
||||
<div class="download-link-content">
|
||||
<div class="img" style="width: 60px; height: 60px; border-radius: 100%; background-size: cover; background-position: center; background: url('<?= $first_img ?>') no-repeat"></div>
|
||||
<i class="la la-download" style="margin: 23px 10px 0 10px; font-size: 20px"></i>
|
||||
<div style="margin-top: 15px"><?= $collectionsObject->object->getTitle() ?>
|
||||
<div><?= ($lg == 'en' ? 'Images: ' : 'Изображениея: ') . sizeof($collectionsObject->object->getRegisterObjectImages()) ?></div>
|
||||
</div>
|
||||
<div class="lds-ring loader"><div></div><div></div><div></div><div></div></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,71 @@
|
||||
<style>
|
||||
.publication {
|
||||
width: calc(50% - 10px);
|
||||
background: #FFFFFF;
|
||||
padding: 20px;
|
||||
margin: 5px;
|
||||
}
|
||||
.publication .order-sub-item-title {
|
||||
padding-left: 10px;
|
||||
}
|
||||
.read-button {
|
||||
background: var(--color-main-dark);
|
||||
color: #FFFFFF;
|
||||
font-size: 20px;
|
||||
border: 0;
|
||||
padding: 10px 20px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
.order-item-publication {
|
||||
background: transparent !important;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
/**
|
||||
* @var array $orders
|
||||
*/
|
||||
|
||||
use app\services\JWT;
|
||||
|
||||
$lg = Yii::$app->language;
|
||||
?>
|
||||
<div class="order-items order-publications">
|
||||
<?php foreach ($orders['publications'] as $order_id => $publications): ?>
|
||||
<div class="order-item order-item-publication flex flex-wrap">
|
||||
|
||||
<?php
|
||||
/** @var \app\models\OrderProduct $publication */
|
||||
foreach ($publications as $publication):
|
||||
/** @var \app\models\Order $order */
|
||||
$order = $publication->order;
|
||||
$publicationModel = $publication->model_class;
|
||||
/** @var $publicationTo \app\models\RegisterObjects */
|
||||
$publicationTo = $publicationModel::findOne($publication->model_id);
|
||||
if ($order->payment->status == 'PAID')
|
||||
$pay_on = $order->payment->response_time;
|
||||
?>
|
||||
|
||||
<div class="order-sub-item publication" id="publication-<?= $publicationTo->id ?>">
|
||||
<div class="flex">
|
||||
<img src="<?= $publicationTo->getMainImgFile() ?>" style="width: 200px">
|
||||
<div class="order-sub-item-title">
|
||||
<?= $publication->{'name_' . $lg} ?>
|
||||
<div class="top15">
|
||||
<button onclick="openPublication(this)" data-publication="/file-system/file-preview-delivery/<?= JWT::encode(['id' => $publicationTo->pdf->id], JWT::SECRET_KEY) ?>/"
|
||||
class="read-button"><?= $lg == 'en' ? 'Read' : 'Прочети' ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="status <?= $order->payment && $order->payment->status == 'PAID' ? 'paid' : '' ?>"><?= $order->statusStr() ?></div>
|
||||
<?php if ($order->payment->status == 'PAID'): ?>
|
||||
<div class="order-sub-item-title"><?= date('d.m.Y', strtotime($order->payment->response_time)) ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* @var array $orders
|
||||
* @var array $message
|
||||
* @var string $lg
|
||||
*/
|
||||
?>
|
||||
<div class="order-items order-subscriptions">
|
||||
<?php foreach ($orders['subscriptions'] as $order_id => $subscriptions): ?>
|
||||
<div class="order-item">
|
||||
<?php
|
||||
/** @var $subscription \app\models\OrderProduct */
|
||||
foreach ($subscriptions
|
||||
|
||||
as $subscription):
|
||||
|
||||
$order = $subscription->order;
|
||||
$subscriptionModel = $subscription->model_class;
|
||||
|
||||
/** @var \app\models\Subscriptions $subscriptionTo */
|
||||
$subscriptionTo = $subscriptionModel::findOne($subscription->model_id);
|
||||
|
||||
$start = null;
|
||||
$last_time = null;
|
||||
|
||||
if ($order->payment->status == 'PAID') {
|
||||
$start = $order->payment->response_time;
|
||||
$last_time = strtotime("$start +$subscriptionTo->months months");
|
||||
}
|
||||
?>
|
||||
<div class="order-sub-item">
|
||||
<div class="order-sub-item-title"><?= $subscription->{'name_' . $lg} ?></div>
|
||||
<?php if ($start && $last_time): ?>
|
||||
<?php if ($last_time > time()): ?>
|
||||
<div class="status status-active"><?= $message['active'][$lg] ?></div>
|
||||
<?php else: ?>
|
||||
<div class="status status-inactive"><?= $message['inactive'][$lg] ?></div>
|
||||
<?php endif ?>
|
||||
<div class="status <?= $order->payment && $order->payment->status == 'PAID' ? 'paid' : '' ?>"><?= $order->statusStr() ?></div>
|
||||
<div class="type">
|
||||
<b><?= $message['from_date'][$lg] ?></b>: <?= date('d.m.Y', strtotime($start)) ?></div>
|
||||
<?php if ($last_time > time()): ?>
|
||||
<b><?= $message['to_date'][$lg] ?></b>: <?= date('d.m.Y', $last_time) ?>
|
||||
<?php else: ?>
|
||||
<b><?= $message['to_dated'][$lg] ?></b>: <?= date('d.m.Y', $last_time) ?>
|
||||
<?php endif ?>
|
||||
<?php else: ?>
|
||||
<div class="status <?= $order->payment && $order->payment->status == 'PAID' ? 'paid' : '' ?>"><?= $order->statusStr() ?></div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
use app\models\Ts;
|
||||
use app\models\UserExplorerObjects;
|
||||
use app\services\Auth;
|
||||
use app\models\Subscriptions;
|
||||
use app\services\Cart;
|
||||
|
||||
$user = Auth::getUser();
|
||||
$lang = Yii::$app->language;
|
||||
|
||||
$userExplorerObjects = UserExplorerObjects::find()->where(['user_id' => $user->id]);
|
||||
$count = $userExplorerObjects->count();
|
||||
|
||||
$userExplorerObjects = $userExplorerObjects->orderBy(['date_visit' => SORT_DESC])->all();
|
||||
|
||||
$data = [];
|
||||
$totalPoints = 0;
|
||||
function countMessage($count)
|
||||
{
|
||||
$en = $count == 1 ? 'visited place' : 'visited places';
|
||||
$bg = $count == 1 ? 'посетен обект' : 'посетени обекта';
|
||||
return ['en' => $en, 'bg' => $bg];
|
||||
|
||||
}
|
||||
|
||||
foreach ($userExplorerObjects as $ueo) {
|
||||
if ($ueo->explorerObject && $ueo->explorerObject->tourObject) {
|
||||
$tourObject = $ueo->explorerObject->tourObject;
|
||||
$totalPoints += $ueo->explorerObject->points;
|
||||
$data[] = (object)['name' => $lang == 'en' ? $tourObject->name_en : $tourObject->name,
|
||||
'points' => $ueo->explorerObject->points,
|
||||
'img' => $ueo->explorerObject->getSrcOfSingleImage('explorer_object_image', '1:1'),
|
||||
'date' => $ueo->date_visit ? date('d.m.Y', strtotime($ueo->date_visit)) : ''
|
||||
];
|
||||
}
|
||||
}
|
||||
$count = sizeof($data)
|
||||
?>
|
||||
|
||||
<div class="title"><?= $count . ' ' . countMessage($count)[$lang] ?> | <?= $lang == 'en' ? 'total points' : 'общ бр. точки' ?>: <?= $totalPoints ?></div>
|
||||
<div class="list-rows top10">
|
||||
<?php foreach ($data as $v): ?>
|
||||
<div class="list-row">
|
||||
<img src="<?= $v->img ?>">
|
||||
<div class="list-row-info padding10">
|
||||
<div class="padding5"><?= $v->name ?></div>
|
||||
<div class="padding5"><b><?= $lang == 'en' ? 'points' : 'точки' ?>: </b><span
|
||||
class="points"><?= $v->points ?></span></div>
|
||||
<div class="padding5"><?= $v->date ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
use app\models\Subscriptions;
|
||||
|
||||
$user = \app\services\Auth::getUser();
|
||||
$lg = Yii::$app->language;
|
||||
$message = [
|
||||
'ticket_for' => [
|
||||
'bg' => 'Билет за',
|
||||
'en' => 'Ticket for',
|
||||
],
|
||||
'bookings' => [
|
||||
'bg' => 'Резервации',
|
||||
'en' => 'Bookings'
|
||||
],
|
||||
'subscriptions' => [
|
||||
'bg' => 'Абонаменти',
|
||||
'en' => 'Subscriptions'
|
||||
],
|
||||
'collections' => [
|
||||
'bg' => 'Колекции',
|
||||
'en' => 'Subscriptions'
|
||||
],
|
||||
'publications' => [
|
||||
'bg' => 'Публикации',
|
||||
'en' => 'Publications'
|
||||
],
|
||||
'ticket_type' => [
|
||||
'bg' => 'вид билет',
|
||||
'en' => 'ticket type',
|
||||
],
|
||||
'event_date' => [
|
||||
'bg' => 'дата на събитието',
|
||||
'en' => 'event date',
|
||||
],
|
||||
'ticket' => [
|
||||
'bg' => 'билет',
|
||||
'en' => 'ticket'
|
||||
],
|
||||
'ticket_count' => [
|
||||
'bg' => 'Брой билети',
|
||||
'en' => 'Tickets count'
|
||||
],
|
||||
'from_date' => [
|
||||
'bg' => 'От дата',
|
||||
'en' => 'From date',
|
||||
],
|
||||
'to_date' => [
|
||||
'bg' => 'Изтича на',
|
||||
'en' => 'Expire on',
|
||||
],
|
||||
'to_dated' => [
|
||||
'bg' => 'Изтекъл на',
|
||||
'en' => 'Expired on',
|
||||
],
|
||||
'active' => [
|
||||
'bg' => 'Активен',
|
||||
'en' => 'Active'
|
||||
],
|
||||
'inactive' => [
|
||||
'bg' => 'Не активен',
|
||||
'en' => 'Expired'
|
||||
],
|
||||
'status' => [
|
||||
'en' => 'Status',
|
||||
'bg' => 'Статус'
|
||||
]
|
||||
];
|
||||
|
||||
$orders = $user->groupOrderItems();
|
||||
?>
|
||||
|
||||
|
||||
<style>
|
||||
.status {
|
||||
color: darkorange;
|
||||
font-size: 18px !important;
|
||||
}
|
||||
|
||||
.paid {
|
||||
color: darkmagenta;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.order-item {
|
||||
width: calc(100% - 20px);
|
||||
margin-bottom: 5px;
|
||||
background: #FFFFFF;
|
||||
padding: 10px;
|
||||
font-size: 14px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.order-sub-item {
|
||||
margin-bottom: 7px;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
.order-sub-item:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.order-sub-item-title {
|
||||
color: var(--color-main-super-dark);
|
||||
font-size: 18px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.inner-tab {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
.inner-tab-title {
|
||||
width: calc(100% - 10px);
|
||||
padding: 5px;
|
||||
color: var(--color-main-super-dark);
|
||||
background: #FFFFFF;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.ticket {
|
||||
width: 100px;
|
||||
margin-left: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.ticket .item-button {
|
||||
margin-top: 10px;
|
||||
display: block;
|
||||
color: var(--color-main-super-dark);
|
||||
background: #FFFFFF;
|
||||
width: 50px;
|
||||
text-align: center;
|
||||
padding: 5px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid var(--color-main-super-dark);
|
||||
transition: all 0.3s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ticket .item-button:hover {
|
||||
background: var(--color-main-super-dark);
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.slide-tab {
|
||||
margin: 0 20px;
|
||||
padding: 10px 20px;
|
||||
transform: translateY(5px);
|
||||
border-radius: 10px 10px 0 0;
|
||||
}
|
||||
|
||||
.slide-tab.active {
|
||||
color: var(--color-main-super-dark);
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
.slide-tab:not(.slide-tab.active) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.order-items {
|
||||
padding: 10px 20px;
|
||||
display: none;
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
.order-items.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.status {
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.status-active {
|
||||
color: #188ebe
|
||||
}
|
||||
|
||||
.status-inactive {
|
||||
color: darkred
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="inner-tab ">
|
||||
<div class="inner-tab-title flex">
|
||||
<div onclick="changeInnerTab(this)" class="slide-tab tab-collections active"><?= $message['collections'][$lg] ?></div>
|
||||
<div onclick="changeInnerTab(this)" class="slide-tab tab-publications"><?= $message['publications'][$lg] ?></div>
|
||||
<div onclick="changeInnerTab(this)"
|
||||
class="slide-tab tab-subscriptions"><?= $message['subscriptions'][$lg] ?></div>
|
||||
<div onclick="changeInnerTab(this)" class="slide-tab tab-bookings"><?= $message['bookings'][$lg] ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->render('/user/profile-tabs/partials/order-collections', ['lg' => $lg, 'message' => $message, 'orders' => $orders]) ?>
|
||||
<?= $this->render('/user/profile-tabs/partials/order-publications', ['lg' => $lg, 'message' => $message, 'orders' => $orders]) ?>
|
||||
<?= $this->render('/user/profile-tabs/partials/order-subscriptions', ['lg' => $lg, 'message' => $message, 'orders' => $orders]) ?>
|
||||
<?= $this->render('/user/profile-tabs/partials/order-bookings', ['lg' => $lg, 'message' => $message, 'orders' => $orders]) ?>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
use app\models\OrderProduct;
|
||||
use app\models\Ts;
|
||||
use app\services\Auth;
|
||||
use app\models\Subscriptions;
|
||||
|
||||
$user = Auth::getUser();
|
||||
$subscriptions = Subscriptions::find()->all();
|
||||
|
||||
$product = OrderProduct::find()->joinWith('order')->where(['model_class' => Subscriptions::class])->orderBy(['order_date' => SORT_DESC])->one();
|
||||
|
||||
$active_subscription_id = null;
|
||||
$last_time = null;
|
||||
if ($product) {
|
||||
if ($product->order) {
|
||||
$order = $product->order;
|
||||
/** @var Subscriptions $subscriptionModel */
|
||||
$subscriptionModel = $product->model_class;
|
||||
$subscription = $subscriptionModel::findOne($product->model_id);
|
||||
if ($subscription) {
|
||||
if ($order->payment->status == 'PAID') {
|
||||
$start = $order->payment->response_time;
|
||||
$period = $subscription->months;
|
||||
$last_time = strtotime("$start +$period months");
|
||||
if (time() < $last_time) {
|
||||
$active_subscription_id = $product->model_id;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Ts::set([84, 85, 86, 92, 93, 94, 95, 248]);
|
||||
?>
|
||||
<div class="subscriptions">
|
||||
<?php foreach ($subscriptions as $subscription): ?>
|
||||
<div class="subscription cw3">
|
||||
<div class="ct header-subs"><?= $subscription->getTitle() ?></div>
|
||||
<div class="body-subs <?= $subscription->isInCart() || $active_subscription_id == $subscription->id ? 'selected' : '' ?>">
|
||||
<div class="price"><?= $subscription->getFormatedPrice() ?></div>
|
||||
<div class="months top20"><?= $subscription->months . ' ' . $subscription->getMonthLabel() ?></div>
|
||||
<div class="text top20"><?= $subscription->getDescription() ?></div>
|
||||
<div class="option">
|
||||
<?php if (!$active_subscription_id): ?>
|
||||
<div class="subscription-button <?= $subscription->isInCart() ? '' : 'visible-option ' . $subscription->isBtnDisabled() ?> profile-submit ct gradient"
|
||||
onclick="cart.add(this, e => {cart.updateSubscriptions(e, 'add')}, 'subscription')"
|
||||
data-cart="<?= $subscription->cartKey ?>">
|
||||
<?= Ts::get(84) ?>
|
||||
</div>
|
||||
<div class="subscribe-selected <?= $subscription->isInCart() ? 'visible-option' : '' ?>">
|
||||
<div class="title"><?= Ts::get(92) ?></div>
|
||||
<a class="subscribe-selected-option" href="<?= Yii::$app->goToAction('user/cart') ?>"><i
|
||||
class="la la-shopping-cart"></i> <?= Ts::get(93) ?></a>
|
||||
<div class="subscribe-selected-option" data-cart="<?= $subscription->cartKey ?>"
|
||||
onclick="cart.remove(this, e => {cart.updateSubscriptions(e, 'remove')})"><i
|
||||
class="la la-times-circle"></i> <?= Ts::get(94) ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($active_subscription_id == $subscription->id): ?>
|
||||
<?php if ($last_time): ?>
|
||||
<div class="ct">
|
||||
<?= Ts::get(248) ?>: <?= date('d.m.Y', $last_time) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="subscribe-active visible-option"><?= Ts::get(95) ?></div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user