Files
2026-09-03 12:21:17 +02:00

92 lines
5.6 KiB
PHP

<x-app-layout :active="'well-operation.index'" title="SoftSPM 2 - Eksploatacja studni">
<div class="space-y-stack-gap">
@if (session('status'))
<div class="status-chip-ok px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ session('status') }}</div>
@endif
<div>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Eksploatacja studni</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>
{{-- Wyszukiwarka --}}
<form method="GET" action="{{ route('well-operation.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 tracking-wide">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 tracking-wide">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>
{{-- Lista studni w eksploatacji --}}
<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 tracking-wide">
<th class="px-4 py-3 w-12">Lp.</th>
<x-sortable-th column="name">Studnia</x-sortable-th>
<x-sortable-th column="bariera">Ujęcie / Bariera</x-sortable-th>
<x-sortable-th column="pump">Pompa</x-sortable-th>
<x-sortable-th column="pump_no">Nr fabryczny pompy [S/N]</x-sortable-th>
<x-sortable-th column="engine">Silnik</x-sortable-th>
<x-sortable-th column="engine_no">Nr fabryczny silnika [S/N]</x-sortable-th>
<x-sortable-th column="type">Typ</x-sortable-th>
<th class="px-4 py-3 text-center">Stan</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 cursor-pointer"
onclick="location.href='{{ route('well-operation.show', $well->drs_id) }}'">
<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 status-chip-alert">OFF</span>
@endif
</td>
</tr>
@empty
<tr>
<td colspan="9" 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>
<div>{{ $wells->links() }}</div>
</div>
</x-app-layout>