Add Orders and Order Status repositories with pagination and management features
- 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.
This commit is contained in:
36
resources/views/components/order-status-panel.php
Normal file
36
resources/views/components/order-status-panel.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
$panelItems = is_array($statusPanelList ?? null) ? $statusPanelList : [];
|
||||
$panelTitle = trim((string) ($statusPanelTitle ?? 'Statusy'));
|
||||
?>
|
||||
|
||||
<aside class="card order-statuses-side">
|
||||
<div class="order-statuses-side__title"><?= $e($panelTitle) ?></div>
|
||||
<?php foreach ($panelItems as $group): ?>
|
||||
<?php $groupItems = is_array($group['items'] ?? null) ? $group['items'] : []; ?>
|
||||
<div class="order-status-group">
|
||||
<?php if ((string) ($group['name'] ?? '') !== ''): ?>
|
||||
<div class="order-status-group__name"><?= $e((string) ($group['name'] ?? '')) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php foreach ($groupItems as $item): ?>
|
||||
<?php
|
||||
$tone = (string) ($item['tone'] ?? 'neutral');
|
||||
$color = (string) ($item['color_hex'] ?? '#64748b');
|
||||
$rowClass = 'order-status-row tone-' . $tone . (!empty($item['is_active']) ? ' is-active' : '');
|
||||
$url = trim((string) ($item['url'] ?? ''));
|
||||
?>
|
||||
<?php if ($url !== ''): ?>
|
||||
<a href="<?= $e($url) ?>" class="<?= $e($rowClass) ?>" style="--status-color: <?= $e($color) ?>;">
|
||||
<span class="order-status-row__label"><?= $e((string) ($item['label'] ?? '')) ?></span>
|
||||
<span class="order-status-row__count"><?= $e((string) ((int) ($item['count'] ?? 0))) ?></span>
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<div class="<?= $e($rowClass) ?>" style="--status-color: <?= $e($color) ?>;">
|
||||
<span class="order-status-row__label"><?= $e((string) ($item['label'] ?? '')) ?></span>
|
||||
<span class="order-status-row__count"><?= $e((string) ((int) ($item['count'] ?? 0))) ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</aside>
|
||||
|
||||
Reference in New Issue
Block a user