110 lines
6.4 KiB
PHP
110 lines
6.4 KiB
PHP
<x-app-layout :active="'wells.index'" title="SoftSPM 2 - Studnie">
|
|
<div class="space-y-stack-gap">
|
|
|
|
{{-- Komunikat sukcesu --}}
|
|
@if (session('status'))
|
|
<div class="status-chip-ok px-3 py-2 rounded-lg font-body-sm text-body-sm">
|
|
{{ session('status') }}
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Nagłówek --}}
|
|
<div class="flex items-end justify-between">
|
|
<div>
|
|
<h1 class="font-headline-lg text-headline-lg text-on-surface">Studnie</h1>
|
|
<p class="font-body-sm text-body-sm text-on-surface-variant mt-1">
|
|
Oddział: <span class="font-data-label">{{ $department ?? '-' }}</span>
|
|
· Wyników: <span class="font-data-label">{{ $wells->total() }}</span>
|
|
</p>
|
|
</div>
|
|
<a href="{{ route('wells.create') }}"
|
|
class="bg-primary text-on-primary px-5 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">
|
|
Dodaj studnię
|
|
</a>
|
|
</div>
|
|
|
|
{{-- Wyszukiwarka (GET - filtry komponują się z paginacją) --}}
|
|
<form method="GET" action="{{ route('wells.index') }}"
|
|
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
|
|
<div class="flex flex-wrap items-end gap-4">
|
|
<div class="space-y-1">
|
|
<label for="q" class="font-data-label text-data-label text-on-surface-variant uppercase tracking-wider">Studnia</label>
|
|
<input id="q" name="q" type="text" value="{{ $search }}"
|
|
placeholder="nazwa studni"
|
|
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded focus:ring-1 focus:ring-primary focus:border-primary font-data-label text-on-surface">
|
|
</div>
|
|
<div class="space-y-1">
|
|
<label for="status" class="font-data-label text-data-label text-on-surface-variant uppercase tracking-wider">Status</label>
|
|
<select id="status" name="status"
|
|
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded focus:ring-1 focus:ring-primary focus:border-primary font-data-label text-on-surface">
|
|
@foreach ($statusOptions as $id => $label)
|
|
<option value="{{ $id }}" {{ (int) $status === (int) $id ? 'selected' : '' }}>{{ $label }}</option>
|
|
@endforeach
|
|
<option value="{{ $statusAll }}" {{ (int) $status === $statusAll ? 'selected' : '' }}>Wszystkie</option>
|
|
</select>
|
|
</div>
|
|
<button type="submit"
|
|
class="bg-secondary text-on-secondary px-5 py-2.5 rounded-full font-title-sm text-title-sm hover:opacity-90 transition-all active:scale-95">
|
|
Szukaj
|
|
</button>
|
|
</div>
|
|
</form>
|
|
|
|
{{-- Tabela --}}
|
|
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card overflow-hidden">
|
|
<table class="w-full text-left">
|
|
<thead class="bg-secondary/10 border-b border-outline-variant/40">
|
|
<tr class="font-data-label text-data-label text-on-surface-variant uppercase tracking-wider">
|
|
<th class="px-4 py-3 w-12">Lp.</th>
|
|
<x-sortable-th column="name">Nazwa</x-sortable-th>
|
|
<x-sortable-th column="bariera">Bariera</x-sortable-th>
|
|
<x-sortable-th column="pump">Pompa</x-sortable-th>
|
|
<x-sortable-th column="pump_no">Nr pompy</x-sortable-th>
|
|
<x-sortable-th column="engine">Silnik</x-sortable-th>
|
|
<x-sortable-th column="engine_no">Nr silnika</x-sortable-th>
|
|
<x-sortable-th column="type">Typ</x-sortable-th>
|
|
<th class="px-4 py-3 text-center">Stan</th>
|
|
<th class="px-4 py-3 text-right">Akcje</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-outline-variant/30 font-body-md text-body-md">
|
|
@forelse ($wells as $well)
|
|
<tr class="hover:bg-surface-container transition-colors">
|
|
<td class="px-4 py-3 font-data-label text-on-surface-variant">{{ $wells->firstItem() + $loop->index }}.</td>
|
|
<td class="px-4 py-3 font-semibold text-on-surface">{{ $well->well_name }}</td>
|
|
<td class="px-4 py-3">{{ $well->bariera }}</td>
|
|
<td class="px-4 py-3">{{ $well->pump_name }}</td>
|
|
<td class="px-4 py-3 font-data-label">{{ $well->pump_no }}</td>
|
|
<td class="px-4 py-3">{{ $well->engine_name }}</td>
|
|
<td class="px-4 py-3 font-data-label">{{ $well->engine_no }}</td>
|
|
<td class="px-4 py-3">{{ $well->sys_type }}</td>
|
|
<td class="px-4 py-3 text-center">
|
|
@if ($well->onoff === 'ON')
|
|
<span class="status-chip status-chip-ok">ON</span>
|
|
@else
|
|
<span class="status-chip bg-surface-container-high text-on-surface-variant">OFF</span>
|
|
@endif
|
|
</td>
|
|
<td class="px-4 py-3 text-right">
|
|
<a href="{{ route('wells.edit', $well->drs_id) }}"
|
|
class="font-body-sm text-body-sm text-secondary hover:underline">Edytuj</a>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="10" class="px-4 py-8 text-center font-body-md text-body-md text-on-surface-variant">
|
|
Brak studni dla wybranych kryteriów.
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
{{-- Paginacja --}}
|
|
<div>
|
|
{{ $wells->links() }}
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|