Initial import

This commit is contained in:
Admin Nasledstvo
2026-05-01 20:52:04 +03:00
commit ac168868ee
10028 changed files with 2337954 additions and 0 deletions
@@ -0,0 +1,35 @@
<?php
use app\models\Ts;
/**
* @var \app\models\Pages $page
*/
$perPage = 27;
$pageNumber = $_GET['page'] ?? 1;
$data = \app\models\register\Collections::find()
->where(['published' => 1, 'deleted' => 0, 'is_payable' => 1])
->andWhere(['>', 'price', 0])
->orderBy(['modified_on' => SORT_DESC]);
$count = $data->count();
$pagesCount = ceil($count / $perPage);
$collections = $data->limit($perPage)
->offset($pageNumber * $perPage - $perPage)
->all();
?>
<div class="section-title top25"><?= Ts::get(104) ?></div>
<div style="width: 100%">
<?= $this->render('_list_collection_sq_partial', ['collections' => $collections, 'page' => $page]); ?>
</div>
<div class="content">
<div id="pagination" class="filter-buttons flex-left top50">
<?= $this->render('_pagination', [
'pagesCount' => $pagesCount,
'pageNumber' => $pageNumber,
'tab' => 'collections'
]) ?>
</div>
</div>
@@ -0,0 +1,151 @@
<link href="/_public/assets/css/collection-objects-greed.css" rel="stylesheet">
<link href="/_public/assets/css/article-module.css" rel="stylesheet">
<style>
.gallery-preview {
position: relative
}
.gallery-preview .gallery-poster {
filter: blur(0) brightness(100%);
transition: all 0.4s;
}
.gallery-preview:hover .gallery-poster {
filter: blur(5px) brightness(50%);
}
.gallery-preview .icon {
position: absolute;
top: 160px;
text-align: center;
width: 100%;
display: none;
color: #FFFFFF;
font-size: 14px;
}
.gallery-preview:hover .icon {
display: block;
}
.gallery-preview .icon .la {
color: #FFFFFF;
font-size: 40px;
display: block;
margin-bottom: 10px;
}
.modal-video.frame {
height: 700px !important;
}
</style>
<?php
/**
* @var \app\models\Pages $page
*/
use app\models\OrderProduct;
use app\models\register\Collections;
use app\models\Ts;
use app\services\Auth;
use app\services\JWT;
$user = Auth::getUser();
$lg = Yii::$app->language;
$collection = \app\models\register\Collections::findOne($_GET['collection']);
?>
<div class="filter-buttons">
<?php if (!empty($_GET['back'])): ?>
<?php if ($_GET['back'] != 'last_added'): ?>
<?php if ($_GET['back'] == 'collections'): ?>
<button data-href="?tab=collections"><i class="la la-undo"></i> <?= Ts::get(42) ?></button>
<?php endif; ?>
<?php else: ?>
<button data-href="<?= $page->getUrl() ?>"><i class="la la-undo"></i> <?= Ts::get(119) ?></button>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if ($collection): ?>
<div class="cw12 flex top25" style="background: #f1f1f1;">
<div class="cw4" style="height: 350px">
<a href="<?= $collection->getUrl() ?>" class="cell">
<div class="list-element-img cell-img"
style="background-image: url('<?= $collection->getImg() ?>')"></div>
</a>
</div>
<div class="cw6">
<div class="cell">
<div class="list-label events"><?= Ts::get('117') ?></div>
<div class="top20 detail-e-magazin-title"
title="<?= $collection->title() ?>"><?= $collection->title() ?></div>
<div class="list-text top20">
<?= $collection->textDescription() ?>
</div>
<div class="e-magazine-price font-bold top20"><?= Ts::get(116) ?>
: <?= number_format($collection->price, 2, '.', ' ') ?> лв.
</div>
</div>
</div>
</div>
<div class="detail-e-magazin-title top25"><?= $collection->objectCountLabel() ?>
/ <?= $collection->imageCountLabel() ?></div>
<div class="collection-greed top25">
<div class="content-out gallery flex-wrap">
<?php foreach ($collection->collectionsObjects as $collectionObject): ?>
<?php if (!empty($collectionObject->object->registerObjectImages[0])): ?>
<?php $file = $collectionObject->object->registerObjectImages[0]; ?>
<div class="gallery__item gallery-preview" onclick="openGalleryPreview(this)"
data-object-id="<?= $collectionObject->object->id ?>" style="cursor: pointer">
<div class="gallery-poster"
style="width: 100%; height: 400px; background: url('<?= $file->getResizedImg(false, true) ?>') no-repeat; background-size: cover;"></div>
<div class="gallery__item_title"><?= $collectionObject->object->getTitle() ?></div>
<div class="icon">
<i class="la la-images"></i>
<?= $lg == 'en' ? 'Preview gallery' : 'Преглед галерия' ?>
</div>
</div>
<?php else: ?>
<div class="gallery__item">
<div
style="width: 100%; height: 400px; background: url('/_public/images/empty.png') no-repeat; background-size: cover;"
></div>
<div class="gallery__item_title"><?= $collectionObject->object->getTitle() ?></div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<?php
$activeDownload = false;
if ($user) {
$hasOrder = OrderProduct::find()->joinWith('order')
->where(['user_id' => $user->id, 'model_class' => Collections::class, 'model_id' => $collection->id])->one();
if ($hasOrder) {
if ($hasOrder->order->payment && $hasOrder->order->payment->status == 'PAID') {
$activeDownload = true;
}
}
}
?>
<?php if ($activeDownload): ?>
<div onclick="window.location.href = '/<?= $lg ?>/user/?cid=<?= JWT::encode(['cid' => $collection->id], JWT::SECRET_KEY) ?>'" class="profile-submit gradient ct top25">
<i class="la la-download"></i> <?= $lg == 'en' ? 'Download' : 'Изтегли' ?>
</div>
<?php else: ?>
<div data-max="1" data-cart="<?= $collection->cartKey ?>"
onclick="cart.add(this, e => {cart.updateSubscriptions(e, 'add')})"
class="profile-submit gradient ct top25"><i
class="la la-shopping-cart"></i> <?= Ts::get(115) ?>
</div>
<?php endif; ?>
<?php endif; ?>
<script>
function openGalleryPreview(e) {
const url = `/<?= Yii::$app->language ?>/remote/object-gallery/?object_id=${e.dataset.objectId}`
modal.modalFrame(url)
}
</script>
@@ -0,0 +1,41 @@
<?php
use app\models\Ts;
use app\models\Pages;
$pageNumber = $_GET['page'] ?? 1;
$perPage = 27;
/**
* @var Pages $page
*/
$data = \app\models\Articles::find()
->joinWith('events')
->where(['events.is_active' => 1])
->andWhere(['events.type' => 'booking'])
->orWhere(['events.type' => 'online'])
//->andWhere(['>', 'events.event_last_date', date('Y-m-d')])
->orderBy(['events.event_first_date' => SORT_DESC]);
$count = $data->count();
$pagesCount = ceil($count / $perPage);
$events = $data->limit($perPage)
->offset($pageNumber * $perPage - $perPage)
->all();
?>
<div class="section-title"><?= Ts::get(7) ?></div>
<div style="width: 100%">
<?= $this->render('_list_article_partial', ['articles' => $events, 'page' => $page]); ?>
</div>
<div class="content">
<div id="pagination" class="filter-buttons flex-center top50">
<?= $this->render('_pagination', [
'pagesCount' => $pagesCount,
'pageNumber' => $pageNumber,
'tab' => 'events'
]) ?>
</div>
</div>
@@ -0,0 +1,55 @@
<?php
use app\models\Ts;
use app\models\Pages;
/**
* @var Pages $page
*/
?>
<div class="section-title"><?= Ts::get(7)?></div>
<div style="width: 100%">
<?php
$data = $this->render('_list_article_partial', ['articles' => \app\models\Articles::find()
->joinWith('events')
->where(['events.is_active' => 1])
->andWhere(['events.type' => 'booking'])
->orWhere(['events.type' => 'online'])
->orderBy(['events.event_first_date' => SORT_DESC])
->limit(6)
//->andWhere('')
->all(), 'page' => $page]);
echo $data;
?>
</div>
<div class="section-title top25"><?= Ts::get(104)?></div>
<div style="width: 100%">
<?php
$data = $this->render('_list_collection_partial', ['collections' => \app\models\register\Collections::find()
->where(['published' => 1, 'deleted' => 0, 'is_payable' => 1])
->andWhere(['>', 'price', 0])
->orderBy(['modified_on' => SORT_DESC])
->limit(6)
->all(), 'page' => $page]);
echo $data;
?>
</div>
<div class="section-title top25"><?= Ts::get(112) ?></div>
<div style="width: 100%">
<?php
$data = $this->render('_list_libs_partial', ['libs' => \app\models\RegisterObjects::find()
->where(['is_active' => 1, 'lib_type' => 2, 'is_payable' => 1])
//->andWhere(['>', 'price', 0])
//->orderBy(['modified_on' => SORT_DESC])
->limit(6)
->all(), 'page' => $page]);
echo $data;
?>
</div>
@@ -0,0 +1,25 @@
<?php
/**
* @var \app\models\Articles[] $articles
*/
use app\models\Ts;
use app\services\ViewReg;
?>
<div class="flex-wrap e-magazine-list">
<?php foreach ($articles as $article): ?>
<div class="list-element">
<a href="<?= ViewReg::generateDetailPageUrl($article) ?>">
<div class="img-container"
style="background-image: url('<?= $article->article->image('16:11') ?>');"></div>
</a>
<div class="top20 list-label <?= $article->art_table ?>"><?= $article->label ?></div>
<div class="list-title top20" data-max-str="80" title="<?= $article->article->title()?>"><?= $article->article->title() ?></div>
<p class="list-text font-bold" style="color: var(--color-main-super-dark)"><?= $article->events->getFormattedDates() ?><?= $article->events->daily_open_time ? ' / ' . $article->events->daily_open_time : '' ?></p>
<div class="list-text top20" data-max-str="100"><?= $article->article->textShort() ?></div>
<div data-href="<?= ViewReg::generateDetailPageUrl($article) ?>" class="profile-submit gradient ct"><?= Ts::get(114)?></div>
</div>
<?php endforeach; ?>
</div>
@@ -0,0 +1,55 @@
<?php
/**
* @var \app\models\register\Collections[] $collections
*/
use app\models\Ts;
use app\models\OrderProduct;
use \app\models\register\Collections;
use \app\services\Auth;
$lg = Yii::$app->language;
$user = Auth::getUser();
/**
* @var \app\models\Pages $page
*/
?>
<div class="flex-wrap e-magazine-list">
<?php foreach ($collections as $collection): ?>
<?php
$activeDownload = false;
if($user) {
$hasOrder = OrderProduct::find()->joinWith('order')
->where(['user_id' => $user->id, 'model_class' => Collections::class, 'model_id' => $collection->id])->one();
if($hasOrder) {
if($hasOrder->order->payment && $hasOrder->order->payment->status == 'PAID') {
$activeDownload = true;
}
}
}
?>
<div class="list-element">
<div class="img-container" style="background-image: url('<?= $collection->getImg() ?>')"></div>
<div class="top20 list-label"><?= Ts::get(117) ?></div>
<div class="list-title top20" data-max-str="80"
title="<?= $collection->title() ?>"><?= $collection->title() ?></div>
<div class="list-text font-bold top20"><?= Ts::get(116) ?>
: <?= number_format($collection->price, 2, '.', ' ') ?> лв.
</div>
<div class="list-text top20" data-max-str="100">
<?= $collection->textDescription() ?>
</div>
<div data-href="<?= $page->getUrl() ?>?collection=<?= $collection->id ?>&back=last_added"
class="profile-submit gradient ct">
<?php if($activeDownload): ?>
<i class="la la-download"></i> <?= $lg == 'en' ? 'Download' : 'Изтегли' ?>
<?php else: ?>
<i class="la la-shopping-cart"></i> <?= Ts::get(115) ?>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>
@@ -0,0 +1,40 @@
<?php
/**
* @var \app\models\RegisterObjects[] $libs
*/
use app\models\RegisterObjects;
use app\models\Ts;
$lg = Yii::$app->language;
/**
* @var \app\models\Pages $page
*/
?>
<div class="flex-wrap e-magazine-list">
<?php foreach ($libs as $lib): ?>
<div class="list-element library">
<div class="img-container img-container-lib" style="background-image: url('<?= $lib->getImg() ?>')"></div>
<div class="top20 list-label"><?= Ts::get(179) ?></div>
<div class="list-title top20 pointer" data-max-str="80" data-href="<?= $lib->getLibraryUrl() ?>"
title="<?= $lib->getTitle() ?>"><?= $lib->getTitle() ?></div>
<div class="list-text font-bold top20"><?= Ts::get(116) ?>
: <?= number_format($lib->price, 2, '.', ' ') ?> лв.
</div>
<?php
$user = \app\services\Auth::getUser();
$paid = false;
if ($user) {
$product = \app\models\OrderProduct::find()->joinWith('order')->where(['model_class' => RegisterObjects::class, 'model_id' => $lib->id, 'user_id' => $user->id])->one();
if($product && $product->order->payment && $product->order->payment->status == 'PAID') {
$paid = true;
}
}
?>
<div data-href="<?= $lib->getLibraryUrl() ?>"
class="profile-submit gradient ct"><?= !$paid ? '<i class="la la-shopping-cart"></i> '. Ts::get(115) : ($lg == 'en' ? 'Read' : 'Прочети') ?></div>
</div>
<?php endforeach; ?>
</div>
@@ -0,0 +1,41 @@
<?php
/**
* @var $pagesCount
* @var $pageNumber
* @var $tab
* @var $query
*/
$query = $query ?? '';
if ($pagesCount > 1):
$first = 1;
$last = $pagesCount + 1;
if ($pagesCount < 10): ?>
<?php for ($p = $first; $p < $last; $p++): ?>
<button class="<?= $p == $pageNumber ? 'active' : '' ?>"
onclick="window.location.href = `?tab=<?= $tab . $query ?>&page=<?= $p ?>`"><?= $p ?></button>
<?php endfor; ?>
<?php else:
if ($pageNumber < 9): ?>
<?php for ($p = 1; $p < 10; $p++): ?>
<button class="<?= $p == $pageNumber ? 'active' : '' ?>"
onclick="window.location.href = `?tab=<?= $tab . $query ?>&page=<?= $p ?>`"><?= $p ?></button>
<?php endfor; ?>
<?php else: ?>
<button onclick="window.location.href = `?tab=<?= $tab . $query ?>&page=<?= 1 ?>`">1</button>
<button class="disabled">...</button>
<?php
$last = $pageNumber + 4 > $pagesCount ? $pagesCount + 1 : $pageNumber + 3;
for ($p = $pageNumber - 3; $p < $last; $p++): ?>
<button class="<?= $p == $pageNumber ? 'active' : '' ?>"
onclick="window.location.href = `?tab=<?= $tab . $query ?>&page=<?= $p ?>`"><?= $p ?></button>
<?php endfor; ?>
<?php endif; ?>
<?php if ($pageNumber < $pagesCount - 3): ?>
<button class="disabled">...</button>
<button class="<?= $pageNumber == $pagesCount ? 'active' : '' ?>"
onclick="window.location.href = `?tab=<?= $tab . $query ?>&page=<?= $pagesCount ?>`"><?= $pagesCount ?></button>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
@@ -0,0 +1,37 @@
<?php
/**
* @var \app\models\Pages $page
*/
use app\models\Ts;
$perPage = 27;
$pageNumber = $_GET['page'] ?? 1;
$data = \app\models\RegisterObjects::find()
->where(['lib_type' => 2, 'is_payable' => 1, 'is_active' => 1]);
//->andWhere(['>', 'price', 0])
//->orderBy(['modified_on' => SORT_DESC]);
$count = $data->count();
$pagesCount = ceil($count / $perPage);
$libs = $data->limit($perPage)
->offset($pageNumber * $perPage - $perPage)
->all();
?>
<div class="section-title top25"><?= Ts::get(112) ?></div>
<div style="width: 100%">
<?= $this->render('_list_libs_partial', ['libs' => $libs, 'page' => $page]); ?>
</div>
<div class="content">
<div id="pagination" class="filter-buttons flex-leqft top50">
<?= $this->render('_pagination', [
'pagesCount' => $pagesCount,
'pageNumber' => $pageNumber,
'tab' => 'publications'
]) ?>
</div>
</div>
@@ -0,0 +1,25 @@
<?php
use app\models\Subscriptions;
use app\models\Ts;
?>
<div class="tab-content-panel">
<div class="subscriptions flex">
<?php
foreach (Subscriptions::find()->all() as $subscription): ?>
<div class="subscription cw3">
<div class="ct header-subs"><?= $subscription->getTitle() ?></div>
<div class="body-subs <?= $subscription->isInCart() ? 'selected' : '' ?>">
<div class="price"><?= $subscription->getFormatedPrice() ?></div>
<div class="months top20"><?= $subscription->months . ' ' . $subscription->getMonthLabel() ?></div>
<div class="option">
<div data-href="<?= Yii::$app->goToAction('user') ?>"
class="top25 subscription-button visible-option profile-submit ct gradient">
<?= Ts::get(84) ?>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>