288 lines
11 KiB
PHP
288 lines
11 KiB
PHP
<div class="legacy-stats-wrapper">
|
|
{{-- Font Awesome ikonok a legacy sidebar menühöz (modern Vite build, nem a teljes legacy app.css) --}}
|
|
@vite('resources/modern/css/app.css')
|
|
|
|
<style>
|
|
/* Elrejtjük a Filament standard elemeit ezen az oldalon */
|
|
.fi-sidebar { display: none !important; }
|
|
.fi-main { padding-left: 0 !important; }
|
|
.fi-topbar { z-index: 10 !important; }
|
|
|
|
/* A Filament wrapper elemeinek nullázása a pontos illeszkedés érdekében */
|
|
.fi-page, .fi-page-header-main-ctn, .fi-page-main, .fi-page-content, .fi-page-header, .fi-header {
|
|
padding: 0 !important;
|
|
margin: 0 !important;
|
|
gap: 0 !important;
|
|
}
|
|
|
|
.fi-page-header, .fi-header {
|
|
display: none !important;
|
|
}
|
|
|
|
/* A legacy sidebar stílusaihoz szükséges alapok */
|
|
.page-wrapper.chiller-theme .page-content {
|
|
padding-left: 260px;
|
|
}
|
|
@media screen and (max-width: 768px) {
|
|
.page-wrapper.chiller-theme .page-content {
|
|
padding-left: 0;
|
|
}
|
|
}
|
|
|
|
/* Biztosítjük a szürke hátteret és eltüntetjük a felső üres részt */
|
|
.fi-main-ctn {
|
|
background-color: #eceadf !important;
|
|
min-height: 100vh;
|
|
}
|
|
.fi-main {
|
|
padding-top: 0 !important;
|
|
margin-top: 0 !important;
|
|
}
|
|
|
|
.statistic-card {
|
|
background: white;
|
|
border-radius: 4px;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
margin-bottom: 20px;
|
|
border: 1px solid #dee2e6;
|
|
}
|
|
.statistic-card-header {
|
|
padding: 10px 15px;
|
|
border-bottom: 1px solid #eee;
|
|
font-weight: 600;
|
|
color: #333;
|
|
background-color: #f8f9fa;
|
|
}
|
|
.statistic-card-body {
|
|
padding: 15px;
|
|
}
|
|
|
|
/* Navigációs gombok stílusa (a modern nézetből átemelve, de a legacy-hoz igazítva) */
|
|
.legacy-nav-item {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 1rem;
|
|
background-color: #f8f9fa;
|
|
border: 1px solid #dee2e6;
|
|
border-radius: 0.25rem;
|
|
color: #212529;
|
|
transition: background-color 0.2s;
|
|
}
|
|
.legacy-nav-item:hover {
|
|
background-color: #e9ecef;
|
|
text-decoration: none;
|
|
}
|
|
.legacy-nav-item i {
|
|
font-size: 1.25rem;
|
|
margin-right: 0.75rem;
|
|
color: #453821;
|
|
}
|
|
|
|
/* Aktuális ár találati táblázat */
|
|
.result-table-wrapper {
|
|
overflow-x: auto;
|
|
}
|
|
.result-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
.result-table th,
|
|
.result-table td {
|
|
padding: 8px 12px;
|
|
border: 1px solid #dee2e6;
|
|
text-align: left;
|
|
}
|
|
.result-table thead th {
|
|
background-color: #f8f9fa;
|
|
font-weight: 600;
|
|
color: #333;
|
|
}
|
|
.result-table tbody tr:nth-child(even) {
|
|
background-color: #f8f9fa;
|
|
}
|
|
.result-table td.price-cell {
|
|
text-align: right;
|
|
white-space: nowrap;
|
|
}
|
|
.result-table-toolbar {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
margin-bottom: 10px;
|
|
color: #333;
|
|
}
|
|
.per-page-select {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
.per-page-select select {
|
|
padding: 4px 8px;
|
|
border: 1px solid #dee2e6;
|
|
border-radius: 4px;
|
|
background-color: #fff;
|
|
}
|
|
.result-pager {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 8px;
|
|
margin-top: 15px;
|
|
}
|
|
.result-pager button {
|
|
padding: 6px 12px;
|
|
border: 1px solid #dee2e6;
|
|
border-radius: 4px;
|
|
background-color: #fff;
|
|
color: #333;
|
|
cursor: pointer;
|
|
}
|
|
.result-pager button:hover:not(:disabled) {
|
|
background-color: #f8f9fa;
|
|
}
|
|
.result-pager button:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
.result-pager-info {
|
|
font-weight: 600;
|
|
color: #333;
|
|
}
|
|
.excel-export-button {
|
|
padding: 6px 14px;
|
|
border: 1px solid #1e7e34;
|
|
border-radius: 4px;
|
|
background-color: #28a745;
|
|
color: #fff;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
}
|
|
.excel-export-button:hover {
|
|
background-color: #218838;
|
|
}
|
|
|
|
/* Aktív menüpont stílusa a sidebar-ban */
|
|
.sidebar-menu ul li.active > a {
|
|
color: #b8bfce;
|
|
background: #3a3f48;
|
|
}
|
|
.sidebar-menu ul li.active > a i {
|
|
color: #16c7ff;
|
|
text-shadow: 0px 0px 10px rgba(22, 199, 255, 0.5);
|
|
}
|
|
</style>
|
|
|
|
<div class="page-wrapper chiller-theme toggled">
|
|
@php
|
|
// Aktívvá tesszük a CurrentPrice linket a sidebarban, ha az a href megegyezik
|
|
// De mivel a navSidebar.blade.php-t include-oljuk, a legegyszerűbb ha a CSS-sel oldjuk meg
|
|
// vagy itt helyben injectálunk egy kis JS-t.
|
|
@endphp
|
|
@include('admin.statistics.navSidebar')
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const currentUrl = window.location.href;
|
|
document.querySelectorAll('.sidebar-wrapper a').forEach(link => {
|
|
if (link.href === currentUrl) {
|
|
link.parentElement.classList.add('active');
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<main class="page-content" style="padding-top: 0;">
|
|
<div style="max-width: 100%; padding-left: 15px; padding-right: 15px;">
|
|
<div class="statistic-card">
|
|
<div class="statistic-card-header">
|
|
Szűrés
|
|
</div>
|
|
<div class="statistic-card-body">
|
|
<form wire:submit.prevent="submit">
|
|
{{ $this->form }}
|
|
|
|
<div class="mt-4 flex justify-end">
|
|
<button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded transition">
|
|
Szűrés alkalmazása
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="statistic-card">
|
|
<div class="statistic-card-header" style="display: flex; align-items: center; justify-content: space-between;">
|
|
<span>Aktuális ár statisztika</span>
|
|
@if ($hasSearched && ! empty($results))
|
|
<button type="button" wire:click="exportExcel" class="excel-export-button">
|
|
Excel export
|
|
</button>
|
|
@endif
|
|
</div>
|
|
<div class="statistic-card-body">
|
|
@if (! $hasSearched)
|
|
<p>Válassza ki a szűrési feltételeket, majd nyomja meg a "Szűrés alkalmazása" gombot.</p>
|
|
@elseif (empty($results))
|
|
<p>Nincs a szűrésnek megfelelő találat.</p>
|
|
@else
|
|
<div class="result-table-toolbar">
|
|
<div>
|
|
Összesen <strong>{{ $totalResults }}</strong> találat
|
|
</div>
|
|
<div class="per-page-select">
|
|
<label for="perPage">Sorok oldalanként:</label>
|
|
<select id="perPage" wire:model.live="perPage">
|
|
@foreach ($this::PER_PAGE_OPTIONS as $option)
|
|
<option value="{{ $option }}">{{ $option }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="result-table-wrapper">
|
|
<table class="result-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Beszállító</th>
|
|
<th>Gyártó</th>
|
|
<th>Termék Főcsoport</th>
|
|
<th>Termék alcsoport 1</th>
|
|
<th>Termék alcsoport 2</th>
|
|
<th>Termék megnevezése</th>
|
|
<th>Aktuális ár</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($results as $row)
|
|
<tr>
|
|
<td>{{ $row['supplier'] ?? '-' }}</td>
|
|
<td>{{ $row['producer'] ?? '-' }}</td>
|
|
<td>{{ $row['mainGroup'] ?: '-' }}</td>
|
|
<td>{{ $row['subGroup1'] ?: '-' }}</td>
|
|
<td>{{ $row['subGroup2'] ?: '-' }}</td>
|
|
<td>{{ $row['name'] }}</td>
|
|
<td class="price-cell">{{ $row['price'] !== null ? number_format($row['price'], 0, ',', ' ') . ' Ft' : '-' }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
@php $lastPage = $this->lastPage(); @endphp
|
|
@if ($lastPage > 1)
|
|
<div class="result-pager">
|
|
<button type="button" wire:click="goToPage(1)" @disabled($page <= 1)>«</button>
|
|
<button type="button" wire:click="goToPage({{ $page - 1 }})" @disabled($page <= 1)>‹ Előző</button>
|
|
<span class="result-pager-info">{{ $page }}. / {{ $lastPage }} oldal</span>
|
|
<button type="button" wire:click="goToPage({{ $page + 1 }})" @disabled($page >= $lastPage)>Következő ›</button>
|
|
<button type="button" wire:click="goToPage({{ $lastPage }})" @disabled($page >= $lastPage)>»</button>
|
|
</div>
|
|
@endif
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
</div>
|