- Implemented OrdersRepository for handling order data with pagination, filtering, and sorting capabilities. - Added methods for retrieving order status options, quick stats, and detailed order information. - Created OrderStatusRepository for managing order status groups and statuses, including CRUD operations and sorting. - Introduced a bootstrap file for test environment setup and autoloading.
85 lines
3.0 KiB
PHP
85 lines
3.0 KiB
PHP
<?php $statusPanelList = is_array($statusPanel ?? null) ? $statusPanel : []; ?>
|
|
<?php $statusPanelTitle = 'Statusy'; ?>
|
|
|
|
<section class="order-show-layout">
|
|
<?php require __DIR__ . '/../components/order-status-panel.php'; ?>
|
|
|
|
<div class="order-show-main">
|
|
<section class="card orders-list-page">
|
|
<div class="orders-head">
|
|
<div>
|
|
<h2 class="section-title"><?= $e($t('orders.title')) ?></h2>
|
|
<p class="muted mt-12"><?= $e($t('orders.description')) ?></p>
|
|
</div>
|
|
<div class="orders-stats">
|
|
<div class="orders-stat">
|
|
<span class="orders-stat__label"><?= $e($t('orders.stats.all')) ?></span>
|
|
<strong class="orders-stat__value"><?= $e((string) ((int) ($stats['all'] ?? 0))) ?></strong>
|
|
</div>
|
|
<div class="orders-stat">
|
|
<span class="orders-stat__label"><?= $e($t('orders.stats.paid')) ?></span>
|
|
<strong class="orders-stat__value"><?= $e((string) ((int) ($stats['paid'] ?? 0))) ?></strong>
|
|
</div>
|
|
<div class="orders-stat">
|
|
<span class="orders-stat__label"><?= $e($t('orders.stats.shipped')) ?></span>
|
|
<strong class="orders-stat__value"><?= $e((string) ((int) ($stats['shipped'] ?? 0))) ?></strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php if (!empty($errorMessage)): ?>
|
|
<div class="alert alert--warning mt-12" role="alert">
|
|
<?= $e((string) $errorMessage) ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</section>
|
|
|
|
<?php require __DIR__ . '/../components/table-list.php'; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<div class="modal-backdrop" data-orders-image-modal hidden>
|
|
<div class="modal modal--image-preview" role="dialog" aria-modal="true" aria-label="Podglad zdjecia produktu">
|
|
<div class="modal__header">
|
|
<h3>Podglad zdjecia</h3>
|
|
<button type="button" class="btn btn--secondary" data-orders-image-close>Zamknij</button>
|
|
</div>
|
|
<div class="modal__body">
|
|
<img src="" alt="" class="product-image-preview__img" data-orders-image-preview>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
(function () {
|
|
var modal = document.querySelector('[data-orders-image-modal]');
|
|
var preview = document.querySelector('[data-orders-image-preview]');
|
|
if (!modal || !preview) return;
|
|
|
|
function closeModal() {
|
|
modal.setAttribute('hidden', 'hidden');
|
|
preview.setAttribute('src', '');
|
|
}
|
|
|
|
document.addEventListener('click', function (event) {
|
|
var trigger = event.target.closest('.js-order-img-open');
|
|
if (trigger) {
|
|
var imageUrl = trigger.getAttribute('data-image-url') || '';
|
|
if (imageUrl === '') return;
|
|
preview.setAttribute('src', imageUrl);
|
|
modal.removeAttribute('hidden');
|
|
return;
|
|
}
|
|
|
|
if (event.target.matches('[data-orders-image-close]') || event.target === modal) {
|
|
closeModal();
|
|
}
|
|
});
|
|
|
|
document.addEventListener('keydown', function (event) {
|
|
if (event.key === 'Escape' && !modal.hasAttribute('hidden')) {
|
|
closeModal();
|
|
}
|
|
});
|
|
})();
|
|
</script>
|