99 lines
4.1 KiB
PHP
99 lines
4.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/** @var string $dbStatus */
|
|
/** @var array<int, array<string, mixed>> $categories */
|
|
/** @var array<int, array<string, mixed>> $catalogProducts */
|
|
/** @var array<int, array<string, mixed>> $popularProducts */
|
|
/** @var array<string, mixed> $settings */
|
|
/** @var string|null $notice */
|
|
/** @var string $buildVersion */
|
|
?>
|
|
<section class="start-screen wide">
|
|
<p class="eyebrow">Шаг 3</p>
|
|
<h1>Рыбсток</h1>
|
|
<p>Каталог открывается уже на главной странице, чтобы покупатель сразу видел ассортимент и не делал лишних переходов.</p>
|
|
<p class="muted">Версия сборки: <?= e($buildVersion) ?></p>
|
|
|
|
<div class="status-box">
|
|
<span>MariaDB:</span>
|
|
<strong><?= e($dbStatus) ?></strong>
|
|
</div>
|
|
|
|
<?php if ($notice !== null): ?>
|
|
<div class="status-box danger"><?= e($notice) ?></div>
|
|
<?php endif; ?>
|
|
|
|
<div class="content-grid">
|
|
<section class="panel">
|
|
<h2>Категории</h2>
|
|
<?php if ($categories === []): ?>
|
|
<p class="muted">Категории пока не найдены. Если схема уже применена, проверьте `database/seed.sql`.</p>
|
|
<?php else: ?>
|
|
<?php
|
|
$items = $categories;
|
|
$depth = 0;
|
|
$currentSlug = '';
|
|
require base_path('views/partials/category-tree.php');
|
|
?>
|
|
<?php endif; ?>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<h2>Настройки доставки</h2>
|
|
<dl class="settings-list">
|
|
<div>
|
|
<dt>Внутри МКАД бесплатно от</dt>
|
|
<dd><?= e((string) ($settings['inside_mkad_free_from'] ?? '5000')) ?> руб.</dd>
|
|
</div>
|
|
<div>
|
|
<dt>Внутри МКАД платно</dt>
|
|
<dd><?= e((string) ($settings['inside_mkad_paid_price'] ?? '599')) ?> руб.</dd>
|
|
</div>
|
|
<div>
|
|
<dt>За МКАД расчет</dt>
|
|
<dd><?= e((string) ($settings['outside_mkad_base_price'] ?? '199')) ?> руб. + <?= e((string) ($settings['outside_mkad_km_price'] ?? '60')) ?> руб./км</dd>
|
|
</div>
|
|
<div>
|
|
<dt>Подъем</dt>
|
|
<dd><?= e((string) ($settings['lift_price'] ?? '390')) ?> руб.</dd>
|
|
</div>
|
|
</dl>
|
|
</section>
|
|
</div>
|
|
|
|
<section class="panel products-panel">
|
|
<div class="section-heading">
|
|
<div>
|
|
<p class="eyebrow">Каталог продукции</p>
|
|
<h2>Товары на главной</h2>
|
|
</div>
|
|
<a class="subtle-link" href="/catalog">Весь каталог</a>
|
|
</div>
|
|
|
|
<?php if ($catalogProducts === []): ?>
|
|
<p class="muted">После наполнения базы товары будут отображаться здесь сразу на главной странице.</p>
|
|
<?php else: ?>
|
|
<div class="product-grid">
|
|
<?php foreach ($catalogProducts as $product): ?>
|
|
<?php require base_path('views/partials/product-card.php'); ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</section>
|
|
|
|
<section class="panel products-panel">
|
|
<h2>Популярные товары</h2>
|
|
<?php if ($popularProducts === []): ?>
|
|
<p class="muted">Товары появятся здесь после наполнения каталога и публикации фасовок.</p>
|
|
<?php else: ?>
|
|
<div class="product-grid">
|
|
<?php foreach ($popularProducts as $product): ?>
|
|
<?php require base_path('views/partials/product-card.php'); ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</section>
|
|
</section>
|