Initial commit

This commit is contained in:
2026-09-03 12:21:17 +02:00
commit 6d40da0410
155 changed files with 21554 additions and 0 deletions
@@ -0,0 +1,90 @@
<x-app-layout :active="'aggregate-selection.index'" title="SoftSPM 2 - Wybór agregatu pompowego">
@php $fmt = fn ($v, $d = 2) => $v === null || $v === '' ? '-' : number_format(round((float) $v, $d), $d, ',', ' '); @endphp
<div class="space-y-stack-gap">
<div>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Wybór agregatu pompowego</h1>
<p class="font-body-sm text-body-sm text-on-surface-variant mt-1">Wysokość podnoszenia dla posiadanych typów pomp</p>
</div>
{{-- Parametry doboru --}}
<form method="GET" action="{{ route('aggregate-selection.index') }}"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<p class="font-data-label text-data-label text-on-surface-variant tracking-wide mb-3">Wprowadź parametry poszukiwanej pompy</p>
<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">Zadana wydajność Q<sub>sz</sub> [m³/h]</label>
<input id="q" name="q" type="text" inputmode="decimal" required value="{{ $q }}" placeholder="np. 120"
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface focus:ring-1 focus:ring-primary focus:border-primary">
</div>
<div class="space-y-1">
<label for="h" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Zadana wysokość podnoszenia H [m] <span class="normal-case text-on-surface-variant/60">(opcjonalnie)</span></label>
<input id="h" name="h" type="text" inputmode="decimal" value="{{ $h }}" placeholder="np. 80"
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface focus:ring-1 focus:ring-primary focus:border-primary">
</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>
@if ($searched)
{{-- Wykres nałożonych krzywych H --}}
@if ($chart)
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-2">Wysokość podnoszenia dla posiadanych typów pomp</h2>
<x-selection-chart :chart="$chart" :q="$qVal" />
</div>
@endif
{{-- Lista pomp dla zadanego Q (ranking po sprawności) --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card overflow-hidden">
<div class="px-card-inner-padding pt-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary">
Lista pomp dla zadanego Q
<span class="font-body-sm text-body-sm text-on-surface-variant">(malejąco wg sprawności)</span>
</h2>
</div>
<table class="w-full text-left mt-2">
<thead class="bg-secondary/10 border-y 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>
<th class="px-4 py-3">Typ pompy</th>
<th class="px-4 py-3">Typ silnika</th>
<th class="px-4 py-3 text-right">Q<sub>n</sub> [m³/h]</th>
<th class="px-4 py-3 text-right">Q<sub>sz</sub> [m³/h]</th>
<th class="px-4 py-3 text-right">H(Q<sub>sz</sub>) [m]</th>
<th class="px-4 py-3 text-right">&eta;(Q<sub>sz</sub>) [-]</th>
<th class="px-4 py-3 text-right">P<sub>s</sub> [kW]</th>
<th class="px-4 py-3 text-right">Napięcie [V]</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30 font-body-md text-body-md">
@forelse ($rows as $row)
<tr class="hover:bg-surface-container transition-colors cursor-pointer"
onclick="location.href='{{ route('aggregates.show', ['pump' => $row->pump_id] + ($row->engine_id ? ['engine' => $row->engine_id] : [])) }}'">
<td class="px-4 py-3 font-data-label text-on-surface-variant">{{ $row->lp }}.</td>
<td class="px-4 py-3 font-semibold text-on-surface">{{ $row->pump_name }}</td>
<td class="px-4 py-3">{{ $row->engine_name ?? '-' }}</td>
<td class="px-4 py-3 text-right font-data-label">{{ $fmt($row->q_n, 3) }}</td>
<td class="px-4 py-3 text-right font-data-label">{{ $fmt($qVal, 3) }}</td>
<td class="px-4 py-3 text-right font-data-label">{{ $fmt($row->h_val, 2) }}</td>
<td class="px-4 py-3 text-right font-data-label">{{ $fmt($row->eta_val, 2) }}</td>
<td class="px-4 py-3 text-right font-data-label">{{ $fmt($row->power, 2) }}</td>
<td class="px-4 py-3 text-right font-data-label">{{ $row->voltage ?? '-' }}</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 pomp spełniających wprowadzone parametry.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@endif
</div>
</x-app-layout>
@@ -0,0 +1,46 @@
<x-app-layout :active="'aggregates.index'" title="SoftSPM 2 - Przypisanie silników">
<div class="max-w-3xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('aggregates.show', $pump) }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Silniki dla pompy: {{ $pump->PUP_NAME }}</h1>
</div>
<form method="POST" action="{{ route('aggregates.update', $pump) }}"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card overflow-hidden">
@csrf
@method('PUT')
<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-2 w-12"></th>
<th class="px-4 py-2">Typ silnika</th>
<th class="px-4 py-2 text-right">Napięcie [V]</th>
<th class="px-4 py-2 text-right">Moc [kW]</th>
<th class="px-4 py-2">Producent</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30 font-body-md text-body-md">
@foreach ($allEngines as $e)
<tr class="hover:bg-surface-container transition-colors">
<td class="px-4 py-2">
<input type="checkbox" name="engines[]" value="{{ $e->ENG_ID }}"
{{ in_array((int) $e->ENG_ID, $assigned, true) ? 'checked' : '' }}
class="w-4 h-4 accent-secondary">
</td>
<td class="px-4 py-2 font-semibold text-on-surface">{{ $e->ENG_NAME }}</td>
<td class="px-4 py-2 text-right font-data-label">{{ $e->ENG_VOLTAGE }}</td>
<td class="px-4 py-2 text-right font-data-label">{{ $e->ENG_POWER }}</td>
<td class="px-4 py-2">{{ $e->manufacturer?->MCF_NAME }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="flex items-center gap-2 p-card-inner-padding border-t border-outline-variant/40">
<button type="submit" class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">Zapisz</button>
<a href="{{ route('aggregates.show', $pump) }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
</x-app-layout>
@@ -0,0 +1,79 @@
<x-app-layout :active="'aggregates.index'" title="SoftSPM 2 - Katalog agregatow">
@php $fmt = fn ($v, $d = 3) => $v === null ? '-' : number_format(round((float) $v, $d), $d, ',', ' '); @endphp
<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">Katalog agregatow</h1>
<p class="font-body-sm text-body-sm text-on-surface-variant mt-1">Wynikow: <span class="font-data-label">{{ $aggregates->total() }}</span></p>
</div>
{{-- Wyszukiwarka pomp --}}
<form method="GET" action="{{ route('aggregates.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="by" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Kryterium</label>
<select id="by" name="by" class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
<option value="name" {{ $by === 'name' ? 'selected' : '' }}>Typ pompy</option>
<option value="flow" {{ $by === 'flow' ? 'selected' : '' }}>Wydajnosc Q</option>
</select>
</div>
<div class="space-y-1">
<label for="q" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Szukaj</label>
<input id="q" name="q" type="text" value="{{ $q }}" placeholder="typ lub Q"
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
</div>
<div class="space-y-1">
<label for="mcf" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Producent</label>
<select id="mcf" name="mcf" class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
<option value="{{ $mcfAll }}" {{ (int) $mcf === $mcfAll ? 'selected' : '' }}>Wszyscy</option>
@foreach ($manufacturers as $id => $name)
<option value="{{ $id }}" {{ (int) $mcf === (int) $id ? 'selected' : '' }}>{{ $name }}</option>
@endforeach
</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 active:scale-95 transition-all">Szukaj</button>
</div>
</form>
<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">Typ pompy</x-sortable-th>
<x-sortable-th column="flow" align="right">Q<sub>n</sub> [m³/h]</x-sortable-th>
<x-sortable-th column="mcf">Producent</x-sortable-th>
<x-sortable-th column="engines" align="right">Silniki</x-sortable-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 ($aggregates as $a)
<tr class="hover:bg-surface-container transition-colors">
<td class="px-4 py-3 font-data-label text-on-surface-variant">{{ $aggregates->firstItem() + $loop->index }}.</td>
<td class="px-4 py-3 font-semibold text-on-surface">
<a href="{{ route('aggregates.show', $a) }}" class="hover:text-primary">{{ $a->PUP_NAME }}</a>
</td>
<td class="px-4 py-3 text-right font-data-label">{{ $fmt($a->PUP_Q_N) }}</td>
<td class="px-4 py-3">{{ $a->manufacturer?->MCF_NAME }}</td>
<td class="px-4 py-3 text-right font-data-label">{{ $a->engines_count }}</td>
<td class="px-4 py-3 text-right">
<a href="{{ route('aggregates.show', $a) }}" class="font-body-sm text-body-sm text-secondary hover:underline">Szczegoly</a>
</td>
</tr>
@empty
<tr><td colspan="6" class="px-4 py-8 text-center font-body-md text-body-md text-on-surface-variant">Brak pomp dla wybranych kryteriow.</td></tr>
@endforelse
</tbody>
</table>
</div>
<div>{{ $aggregates->links() }}</div>
</div>
</x-app-layout>
@@ -0,0 +1,96 @@
<x-app-layout :active="'aggregates.index'" title="SoftSPM 2 - Agregat {{ $pump->PUP_NAME }}">
@php $fmt = fn ($v, $d = 2) => $v === null ? '-' : number_format(round((float) $v, $d), $d, ',', ' '); @endphp
<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 class="flex flex-wrap items-center justify-between gap-3">
<div class="flex items-center gap-2">
<a href="{{ route('aggregates.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Katalog agregatow</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">{{ $pump->PUP_NAME }}</h1>
</div>
<a href="{{ route('aggregates.edit', $pump) }}"
class="bg-secondary text-on-secondary px-4 py-2 rounded-full font-title-sm text-title-sm hover:opacity-90 active:scale-95 transition-all">Przypisz silniki</a>
</div>
{{-- Wykresy --}}
<div class="grid grid-cols-1 md:grid-cols-2 gap-stack-gap">
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-2">Wysokosc podnoszenia</h2>
@if ($hDrawable)
<x-pump-curve :plot="$hPlot" x-label="Q [m³/h]" y-label="H [m]" />
@else
<p class="font-body-sm text-body-sm text-on-surface-variant py-6 text-center">Brak parametrow energetycznych dla pompy.</p>
@endif
</div>
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-2">Sprawnosc</h2>
@if ($etaDrawable)
<x-pump-curve :plot="$etaPlot" x-label="Q [m³/h]" y-label="η [-]" />
@else
<p class="font-body-sm text-body-sm text-on-surface-variant py-6 text-center">Brak parametrow energetycznych dla pompy.</p>
@endif
</div>
</div>
{{-- Silniki dla pompy (kolumny wg oryginalu: Typ silnika / Napiecie / Producent) --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card overflow-hidden">
<div class="px-card-inner-padding pt-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary">Lista silnikow dla pompy: {{ $pump->PUP_NAME }}</h2>
</div>
<table class="w-full text-left mt-2">
<thead class="bg-secondary/10 border-y border-outline-variant/40">
<tr class="font-data-label text-data-label text-on-surface-variant tracking-wide">
<th class="px-4 py-2">Typ silnika</th>
<th class="px-4 py-2 text-right">Napiecie [V]</th>
<th class="px-4 py-2">Producent</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30 font-body-md text-body-md">
@forelse ($engines as $e)
<tr class="cursor-pointer transition-colors {{ $engine && $engine->ENG_ID === $e->ENG_ID ? 'bg-secondary-container/60' : 'hover:bg-surface-container' }}"
onclick="location.href='{{ route('aggregates.show', ['pump' => $pump->PUP_ID, 'engine' => $e->ENG_ID]) }}'">
<td class="px-4 py-2 font-semibold text-on-surface">{{ $e->ENG_NAME }}</td>
<td class="px-4 py-2 text-right font-data-label">{{ $e->ENG_VOLTAGE }}</td>
<td class="px-4 py-2">{{ $e->MCF_NAME }}</td>
</tr>
@empty
<tr><td colspan="3" class="px-4 py-4 text-center font-body-sm text-on-surface-variant">Brak przypisanych silnikow - kliknij "Przypisz silniki".</td></tr>
@endforelse
</tbody>
</table>
</div>
{{-- Karta zestawu pompa + silnik --}}
@if ($engine)
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-primary mb-3">{{ $pump->PUP_NAME }} + {{ $engine->ENG_NAME }}</h2>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-6">
<a href="{{ route('pumps.show', $pump) }}" class="block group">
<p class="font-data-label text-data-label text-on-surface-variant tracking-wide mb-2 group-hover:text-primary">Pompa →</p>
<dl class="grid grid-cols-2 gap-y-1 font-body-md text-body-md">
<dt class="text-on-surface-variant">Typ pompy</dt><dd class="font-semibold">{{ $pump->PUP_NAME }}</dd>
<dt class="text-on-surface-variant">Producent</dt><dd>{{ $pump->manufacturer?->MCF_NAME ?? '-' }}</dd>
<dt class="text-on-surface-variant">Q<sub>n</sub> [m³/h]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_Q_N, 3) }}</dd>
<dt class="text-on-surface-variant">H<sub>p</sub> [m]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_H_P) }}</dd>
<dt class="text-on-surface-variant">η<sub>max</sub> [-]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_ETA_MAX) }}</dd>
</dl>
</a>
<a href="{{ route('engines.show', $engine) }}" class="block group">
<p class="font-data-label text-data-label text-on-surface-variant tracking-wide mb-2 group-hover:text-primary">Silnik →</p>
<dl class="grid grid-cols-2 gap-y-1 font-body-md text-body-md">
<dt class="text-on-surface-variant">Typ silnika</dt><dd class="font-semibold">{{ $engine->ENG_NAME }}</dd>
<dt class="text-on-surface-variant">Producent</dt><dd>{{ $engine->manufacturer?->MCF_NAME ?? '-' }}</dd>
<dt class="text-on-surface-variant">Napiecie [V]</dt><dd class="font-data-label">{{ $engine->ENG_VOLTAGE ?? '-' }}</dd>
<dt class="text-on-surface-variant">Moc [kW]</dt><dd class="font-data-label">{{ $fmt($engine->ENG_POWER) }}</dd>
<dt class="text-on-surface-variant">Sprawnosc η [-]</dt><dd class="font-data-label">{{ $fmt($engine->ENG_ETA) }}</dd>
</dl>
</a>
</div>
</div>
@endif
</div>
</x-app-layout>
@@ -0,0 +1,47 @@
<x-app-layout :active="'cables.index'" title="SoftSPM 2 - Nowy typ kabla">
<div class="max-w-2xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('cables.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Nowy typ kabla</h1>
</div>
@if ($errors->any())
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ $errors->first() }}</div>
@endif
<form method="POST" action="{{ route('cables.store') }}" enctype="multipart/form-data"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding space-y-4">
@csrf
<x-well-field name="name" label="Typ kabla" :value="old('name')" required />
<x-well-select name="manufacturer_id" label="Producent" :options="$manufacturers" :selected="old('manufacturer_id')" required placeholder="- wybierz -" />
<div class="space-y-1">
<label for="description" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Opis</label>
<textarea id="description" name="description" rows="3"
class="w-full bg-surface-container-low border border-outline-variant px-3 py-2 rounded focus:ring-1 focus:ring-primary focus:border-primary font-body-md text-on-surface">{{ old('description') }}</textarea>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="space-y-1">
<label for="catalogue_file" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Dokumentacja katalogowa</label>
<input id="catalogue_file" name="catalogue_file" type="file" accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx"
class="w-full font-body-sm text-body-sm text-on-surface file:mr-3 file:px-4 file:py-2 file:rounded-full file:border-0 file:bg-secondary file:text-on-secondary file:font-title-sm file:cursor-pointer hover:file:opacity-90">
<p class="font-body-sm text-body-sm text-on-surface-variant/70">PDF lub Office, do 8 MB.</p>
</div>
<div class="space-y-1">
<label for="image_file" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Zdjęcie</label>
<input id="image_file" name="image_file" type="file" accept="image/*"
class="w-full font-body-sm text-body-sm text-on-surface file:mr-3 file:px-4 file:py-2 file:rounded-full file:border-0 file:bg-secondary file:text-on-secondary file:font-title-sm file:cursor-pointer hover:file:opacity-90">
<p class="font-body-sm text-body-sm text-on-surface-variant/70">JPG/PNG, do 8 MB.</p>
</div>
</div>
<div class="flex items-center gap-2 pt-2">
<button type="submit" class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">Zapisz</button>
<a href="{{ route('cables.index') }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
</x-app-layout>
@@ -0,0 +1,56 @@
<x-app-layout :active="'cables.index'" title="SoftSPM 2 - Edycja: {{ $cable->EQU_NAME }}">
<div class="max-w-2xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('cables.show', $cable) }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Edycja typu kabla</h1>
</div>
@if ($errors->any())
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ $errors->first() }}</div>
@endif
<form method="POST" action="{{ route('cables.update', $cable) }}" enctype="multipart/form-data"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding space-y-4">
@csrf
@method('PUT')
<x-well-field name="name" label="Typ kabla" :value="old('name', $cable->EQU_NAME)" required />
<x-well-select name="manufacturer_id" label="Producent" :options="$manufacturers" :selected="old('manufacturer_id', $cable->EQU_MCF_ID)" required placeholder="- wybierz -" />
<div class="space-y-1">
<label for="description" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Opis</label>
<textarea id="description" name="description" rows="3"
class="w-full bg-surface-container-low border border-outline-variant px-3 py-2 rounded focus:ring-1 focus:ring-primary focus:border-primary font-body-md text-on-surface">{{ old('description', $cable->EQU_DESCRIPTION) }}</textarea>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="space-y-1">
<label for="catalogue_file" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Dokumentacja katalogowa</label>
<input id="catalogue_file" name="catalogue_file" type="file" accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx"
class="w-full font-body-sm text-body-sm text-on-surface file:mr-3 file:px-4 file:py-2 file:rounded-full file:border-0 file:bg-secondary file:text-on-secondary file:font-title-sm file:cursor-pointer hover:file:opacity-90">
@if ($document)
<p class="font-body-sm text-body-sm text-on-surface-variant/70">Obecny: <a href="{{ route('equipment.file', $document->EQF_ID) }}" target="_blank" class="text-secondary hover:underline">{{ $document->EQF_FILE_NAME }}</a>. Wgranie nowego zastąpi.</p>
@else
<p class="font-body-sm text-body-sm text-on-surface-variant/70">Brak. PDF lub Office, do 8 MB.</p>
@endif
</div>
<div class="space-y-1">
<label for="image_file" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Zdjęcie</label>
<input id="image_file" name="image_file" type="file" accept="image/*"
class="w-full font-body-sm text-body-sm text-on-surface file:mr-3 file:px-4 file:py-2 file:rounded-full file:border-0 file:bg-secondary file:text-on-secondary file:font-title-sm file:cursor-pointer hover:file:opacity-90">
@if ($image)
<p class="font-body-sm text-body-sm text-on-surface-variant/70">Obecne: <a href="{{ route('equipment.file', $image->EQF_ID) }}" target="_blank" class="text-secondary hover:underline">{{ $image->EQF_FILE_NAME }}</a>. Wgranie nowego zastąpi.</p>
@else
<p class="font-body-sm text-body-sm text-on-surface-variant/70">Brak. JPG/PNG, do 8 MB.</p>
@endif
</div>
</div>
<div class="flex items-center gap-2 pt-2">
<button type="submit" class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">Zapisz zmiany</button>
<a href="{{ route('cables.show', $cable) }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
</x-app-layout>
@@ -0,0 +1,75 @@
<x-app-layout :active="'cables.index'" title="SoftSPM 2 - Katalog kabli">
<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 class="flex items-end justify-between">
<div>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Katalog kabli</h1>
<p class="font-body-sm text-body-sm text-on-surface-variant mt-1">Wyników: <span class="font-data-label">{{ $cables->total() }}</span></p>
</div>
<a href="{{ route('cables.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 typ kabla
</a>
</div>
{{-- Wyszukiwarka --}}
<form method="GET" action="{{ route('cables.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">Typ kabla</label>
<input id="q" name="q" type="text" value="{{ $q }}" placeholder="nazwa / typ"
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
</div>
<div class="space-y-1">
<label for="mcf" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Producent</label>
<select id="mcf" name="mcf" class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
<option value="{{ $mcfAll }}" {{ (int) $mcf === $mcfAll ? 'selected' : '' }}>Wszyscy</option>
@foreach ($manufacturers as $id => $name)
<option value="{{ $id }}" {{ (int) $mcf === (int) $id ? 'selected' : '' }}>{{ $name }}</option>
@endforeach
</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 tracking-wide">
<th class="px-4 py-3 w-12">Lp.</th>
<x-sortable-th column="name">Typ kabla</x-sortable-th>
<x-sortable-th column="mcf">Producent</x-sortable-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 ($cables as $cable)
<tr class="hover:bg-surface-container transition-colors">
<td class="px-4 py-3 font-data-label text-on-surface-variant">{{ $cables->firstItem() + $loop->index }}.</td>
<td class="px-4 py-3 font-semibold text-on-surface">
<a href="{{ route('cables.show', $cable) }}" class="hover:text-primary">{{ $cable->EQU_NAME }}</a>
</td>
<td class="px-4 py-3">{{ $cable->manufacturer?->MCF_NAME }}</td>
<td class="px-4 py-3 text-right whitespace-nowrap">
<a href="{{ route('cables.show', $cable) }}" class="font-body-sm text-body-sm text-secondary hover:underline">Szczegóły</a>
<span class="text-outline-variant mx-1">·</span>
<a href="{{ route('cables.edit', $cable) }}" class="font-body-sm text-body-sm text-secondary hover:underline">Edytuj</a>
</td>
</tr>
@empty
<tr><td colspan="4" class="px-4 py-8 text-center font-body-md text-body-md text-on-surface-variant">Brak kabli dla wybranych kryteriów.</td></tr>
@endforelse
</tbody>
</table>
</div>
<div>{{ $cables->links() }}</div>
</div>
</x-app-layout>
@@ -0,0 +1,61 @@
<x-app-layout :active="'cables.index'" title="SoftSPM 2 - {{ $cable->EQU_NAME }}">
<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
@if (session('error'))
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ session('error') }}</div>
@endif
<div class="flex flex-wrap items-center justify-between gap-3">
<div class="flex items-center gap-2">
<a href="{{ route('cables.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Katalog kabli</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">{{ $cable->EQU_NAME }}</h1>
</div>
<div class="flex items-center gap-2">
<a href="{{ route('cables.edit', $cable) }}"
class="bg-secondary text-on-secondary px-4 py-2 rounded-full font-title-sm text-title-sm hover:opacity-90 transition-all active:scale-95">Edytuj</a>
@unless ($inStock)
<x-confirm-delete :action="route('cables.destroy', $cable)"
message="Czy na pewno usunąć typ kabla „{{ $cable->EQU_NAME }}”?" />
@endunless
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-stack-gap">
{{-- Dane --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-3">Dane</h2>
<dl class="grid grid-cols-3 gap-x-4 gap-y-2 font-body-md text-body-md">
<dt class="text-on-surface-variant">Typ kabla</dt><dd class="col-span-2 font-semibold">{{ $cable->EQU_NAME }}</dd>
<dt class="text-on-surface-variant">Producent</dt><dd class="col-span-2">{{ $cable->manufacturer?->MCF_NAME ?? '-' }}</dd>
<dt class="text-on-surface-variant">Opis</dt><dd class="col-span-2">{!! $cable->EQU_DESCRIPTION ? nl2br(e($cable->EQU_DESCRIPTION)) : '-' !!}</dd>
@if ($document)
<dt class="text-on-surface-variant">Dokumentacja katalogowa</dt>
<dd class="col-span-2">
<a href="{{ route('equipment.file', $document->EQF_ID) }}" target="_blank"
class="text-secondary hover:underline break-all">{{ $document->EQF_FILE_NAME }}</a>
</dd>
@endif
</dl>
@if ($inStock)
<p class="mt-4 font-body-sm text-body-sm text-on-surface-variant/80">Kabel jest na stanie magazynowym - usunięcie zablokowane.</p>
@endif
</div>
{{-- Zdjęcie --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-3">Zdjęcie</h2>
@if ($image)
<img src="{{ route('equipment.file', $image->EQF_ID) }}" alt="{{ $cable->EQU_NAME }}"
class="max-w-full h-auto rounded border border-outline-variant/40">
@else
<p class="font-body-sm text-body-sm text-on-surface-variant py-6 text-center">Brak zdjęcia.</p>
@endif
</div>
</div>
</div>
</x-app-layout>
@@ -0,0 +1,38 @@
<x-app-layout :active="'engines.index'" title="SoftSPM 2 - Nowy silnik">
<div class="max-w-2xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('engines.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Nowy silnik</h1>
</div>
@if ($errors->any())
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ $errors->first() }}</div>
@endif
<form method="POST" action="{{ route('engines.store') }}"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding space-y-4">
@csrf
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<x-well-field name="name" label="Typ silnika" :value="old('name')" required class="sm:col-span-2" />
<x-well-select name="manufacturer_id" label="Producent" :options="$manufacturers" :selected="old('manufacturer_id')" required placeholder="- wybierz -" class="sm:col-span-2" />
<x-well-field name="power" label="Moc [kW]" :value="old('power')" required />
<x-well-field name="voltage" label="Napięcie [V]" :value="old('voltage')" required />
<x-well-field name="current" label="Prąd [A]" :value="old('current')" />
<x-well-field name="eta" label="Sprawność η [-]" :value="old('eta')" />
<x-well-field name="cos_fi" label="Wsp. mocy cos(φ) [-]" :value="old('cos_fi')" />
<x-well-field name="rpm" label="Obroty [1/min]" :value="old('rpm')" />
<x-well-field name="length" label="Długość [mm]" :value="old('length')" />
<x-well-field name="weight" label="Masa [kg]" :value="old('weight')" />
<x-well-field name="diameter" label="Średnica [mm]" :value="old('diameter')" />
<x-well-field name="wires" label="Wprowadzenie przewodów" :value="old('wires')" />
</div>
<div class="flex items-center gap-2 pt-2">
<button type="submit" class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">Zapisz</button>
<a href="{{ route('engines.index') }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
</x-app-layout>
@@ -0,0 +1,39 @@
<x-app-layout :active="'engines.index'" title="SoftSPM 2 - Edycja silnika">
<div class="max-w-2xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('engines.show', $engine) }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Edycja silnika: {{ $engine->ENG_NAME }}</h1>
</div>
@if ($errors->any())
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ $errors->first() }}</div>
@endif
<form method="POST" action="{{ route('engines.update', $engine) }}"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding space-y-4">
@csrf
@method('PUT')
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<x-well-field name="name" label="Typ silnika" :value="$engine->ENG_NAME" required class="sm:col-span-2" />
<x-well-select name="manufacturer_id" label="Producent" :options="$manufacturers" :selected="$engine->ENG_MCF_ID" required class="sm:col-span-2" />
<x-well-field name="power" label="Moc [kW]" :value="$engine->ENG_POWER" required />
<x-well-field name="voltage" label="Napięcie [V]" :value="$engine->ENG_VOLTAGE" required />
<x-well-field name="current" label="Prąd [A]" :value="$engine->ENG_ELECTRICITY" />
<x-well-field name="eta" label="Sprawność η [-]" :value="$engine->ENG_ETA" />
<x-well-field name="cos_fi" label="Wsp. mocy cos(φ) [-]" :value="$engine->ENG_COS_FI" />
<x-well-field name="rpm" label="Obroty [1/min]" :value="$engine->ENG_RPM" />
<x-well-field name="length" label="Długość [mm]" :value="$engine->ENG_LENGTH" />
<x-well-field name="weight" label="Masa [kg]" :value="$engine->ENG_WEIGHT" />
<x-well-field name="diameter" label="Średnica [mm]" :value="$engine->ENG_DIAMETER" />
<x-well-field name="wires" label="Wprowadzenie przewodów" :value="$engine->ENG_WIRES" />
</div>
<div class="flex items-center gap-2 pt-2">
<button type="submit" class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">Zapisz zmiany</button>
<a href="{{ route('engines.show', $engine) }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
</x-app-layout>
@@ -0,0 +1,84 @@
<x-app-layout :active="'engines.index'" title="SoftSPM 2 - Katalog silników">
<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 class="flex items-end justify-between">
<div>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Katalog silników</h1>
<p class="font-body-sm text-body-sm text-on-surface-variant mt-1">Wyników: <span class="font-data-label">{{ $engines->total() }}</span></p>
</div>
<a href="{{ route('engines.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 silnik
</a>
</div>
<form method="GET" action="{{ route('engines.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="by" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Kryterium</label>
<select id="by" name="by" class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
<option value="name" {{ $by === 'name' ? 'selected' : '' }}>Typ silnika</option>
<option value="power" {{ $by === 'power' ? 'selected' : '' }}>Moc</option>
</select>
</div>
<div class="space-y-1">
<label for="q" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Szukaj</label>
<input id="q" name="q" type="text" value="{{ $q }}" placeholder="typ lub wartość Moc"
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
</div>
<div class="space-y-1">
<label for="mcf" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Producent</label>
<select id="mcf" name="mcf" class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
<option value="{{ $mcfAll }}" {{ (int) $mcf === $mcfAll ? 'selected' : '' }}>Wszyscy</option>
@foreach ($manufacturers as $id => $name)
<option value="{{ $id }}" {{ (int) $mcf === (int) $id ? 'selected' : '' }}>{{ $name }}</option>
@endforeach
</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>
<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">Typ silnika</x-sortable-th>
<x-sortable-th column="voltage" align="right">Napięcie [V]</x-sortable-th>
<x-sortable-th column="power" align="right">Moc [kW]</x-sortable-th>
<x-sortable-th column="mcf">Producent</x-sortable-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 ($engines as $engine)
<tr class="hover:bg-surface-container transition-colors">
<td class="px-4 py-3 font-data-label text-on-surface-variant">{{ $engines->firstItem() + $loop->index }}.</td>
<td class="px-4 py-3 font-semibold text-on-surface">
<a href="{{ route('engines.show', $engine) }}" class="hover:text-primary">{{ $engine->ENG_NAME }}</a>
</td>
<td class="px-4 py-3 text-right font-data-label">{{ $engine->ENG_VOLTAGE }}</td>
<td class="px-4 py-3 text-right font-data-label">{{ $engine->ENG_POWER }}</td>
<td class="px-4 py-3">{{ $engine->manufacturer?->MCF_NAME }}</td>
<td class="px-4 py-3 text-right whitespace-nowrap">
<a href="{{ route('engines.show', $engine) }}" class="font-body-sm text-body-sm text-secondary hover:underline">Szczegóły</a>
<span class="text-outline-variant mx-1">·</span>
<a href="{{ route('engines.edit', $engine) }}" class="font-body-sm text-body-sm text-secondary hover:underline">Edytuj</a>
</td>
</tr>
@empty
<tr><td colspan="6" class="px-4 py-8 text-center font-body-md text-body-md text-on-surface-variant">Brak silników dla wybranych kryteriów.</td></tr>
@endforelse
</tbody>
</table>
</div>
<div>{{ $engines->links() }}</div>
</div>
</x-app-layout>
@@ -0,0 +1,75 @@
<x-app-layout :active="'engines.index'" title="SoftSPM 2 - {{ $engine->ENG_NAME }}">
@php $fmt = fn ($v, $d = 2) => $v === null ? '-' : number_format(round((float) $v, $d), $d, ',', ' '); @endphp
<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 class="flex flex-wrap items-center justify-between gap-3">
<div class="flex items-center gap-2">
<a href="{{ route('engines.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Katalog silników</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">{{ $engine->ENG_NAME }}</h1>
</div>
<div class="flex items-center gap-2">
<a href="{{ route('engines.edit', $engine) }}"
class="bg-secondary text-on-secondary px-4 py-2 rounded-full font-title-sm text-title-sm hover:opacity-90 transition-all active:scale-95">Edytuj</a>
<x-confirm-delete :action="route('engines.destroy', $engine)"
message="Czy na pewno usunąć silnik „{{ $engine->ENG_NAME }}”? Tej operacji nie można cofnąć." />
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-stack-gap">
{{-- Dane techniczne --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-3">Dane techniczne silnika</h2>
<dl class="grid grid-cols-2 gap-x-4 gap-y-2 font-body-md text-body-md">
<dt class="text-on-surface-variant">Typ silnika</dt><dd class="font-semibold">{{ $engine->ENG_NAME }}</dd>
<dt class="text-on-surface-variant">Producent</dt><dd>{{ $engine->manufacturer?->MCF_NAME ?? '-' }}</dd>
<dt class="col-span-2 border-t border-outline-variant/30 mt-1 pt-1"></dt>
<dt class="text-on-surface-variant">Napięcie [V]</dt><dd class="font-data-label">{{ $engine->ENG_VOLTAGE ?? '-' }}</dd>
<dt class="text-on-surface-variant">Moc [kW]</dt><dd class="font-data-label">{{ $fmt($engine->ENG_POWER) }}</dd>
<dt class="text-on-surface-variant">Prąd [A]</dt><dd class="font-data-label">{{ $fmt($engine->ENG_ELECTRICITY) }}</dd>
<dt class="text-on-surface-variant">Sprawność η [-]</dt><dd class="font-data-label">{{ $fmt($engine->ENG_ETA) }}</dd>
<dt class="text-on-surface-variant">Wsp. mocy cos(φ) [-]</dt><dd class="font-data-label">{{ $fmt($engine->ENG_COS_FI) }}</dd>
<dt class="text-on-surface-variant">Obroty [1/min]</dt><dd class="font-data-label">{{ $fmt($engine->ENG_RPM) }}</dd>
<dt class="col-span-2 border-t border-outline-variant/30 mt-1 pt-1"></dt>
<dt class="text-on-surface-variant">Długość [mm]</dt><dd class="font-data-label">{{ $fmt($engine->ENG_LENGTH) }}</dd>
<dt class="text-on-surface-variant">Średnica [mm]</dt><dd class="font-data-label">{{ $fmt($engine->ENG_DIAMETER) }}</dd>
<dt class="text-on-surface-variant">Masa [kg]</dt><dd class="font-data-label">{{ $fmt($engine->ENG_WEIGHT) }}</dd>
<dt class="text-on-surface-variant">Wprow. przewodów</dt><dd>{{ $engine->ENG_WIRES ?? '-' }}</dd>
</dl>
</div>
{{-- Lista pomp dla silnika --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card overflow-hidden">
<div class="px-card-inner-padding pt-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-2">Lista pomp dla silnika</h2>
</div>
<table class="w-full text-left">
<thead class="bg-secondary/10 border-y border-outline-variant/40">
<tr class="font-data-label text-data-label text-on-surface-variant tracking-wide">
<th class="px-4 py-2">Typ pompy</th>
<th class="px-4 py-2 text-right">Q<sub>n</sub> [m³/h]</th>
<th class="px-4 py-2 text-right">H<sub>p</sub> [m]</th>
<th class="px-4 py-2">Producent</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30 font-body-md text-body-md">
@forelse ($relatedPumps as $p)
<tr>
<td class="px-4 py-1.5">{{ $p->PUP_NAME }}</td>
<td class="px-4 py-1.5 text-right font-data-label">{{ number_format(round((float) $p->q_n, 3), 3, ',', ' ') }}</td>
<td class="px-4 py-1.5 text-right font-data-label">{{ $p->PUP_H_P }}</td>
<td class="px-4 py-1.5">{{ $p->MCF_NAME }}</td>
</tr>
@empty
<tr><td colspan="4" class="px-4 py-4 text-center font-body-sm text-on-surface-variant">Brak powiązanych pomp.</td></tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</x-app-layout>
@@ -0,0 +1,47 @@
<x-app-layout :active="'metering.index'" title="SoftSPM 2 - Nowe urządzenie opomiarowania">
<div class="max-w-2xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('metering.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Nowe urządzenie opomiarowania</h1>
</div>
@if ($errors->any())
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ $errors->first() }}</div>
@endif
<form method="POST" action="{{ route('metering.store') }}" enctype="multipart/form-data"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding space-y-4">
@csrf
<x-well-field name="name" label="Nazwa" :value="old('name')" required />
<x-well-select name="manufacturer_id" label="Producent" :options="$manufacturers" :selected="old('manufacturer_id')" required placeholder="- wybierz -" />
<div class="space-y-1">
<label for="description" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Opis</label>
<textarea id="description" name="description" rows="3"
class="w-full bg-surface-container-low border border-outline-variant px-3 py-2 rounded focus:ring-1 focus:ring-primary focus:border-primary font-body-md text-on-surface">{{ old('description') }}</textarea>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="space-y-1">
<label for="catalogue_file" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Dokumentacja katalogowa</label>
<input id="catalogue_file" name="catalogue_file" type="file" accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx"
class="w-full font-body-sm text-body-sm text-on-surface file:mr-3 file:px-4 file:py-2 file:rounded-full file:border-0 file:bg-secondary file:text-on-secondary file:font-title-sm file:cursor-pointer hover:file:opacity-90">
<p class="font-body-sm text-body-sm text-on-surface-variant/70">PDF lub Office, do 8 MB.</p>
</div>
<div class="space-y-1">
<label for="image_file" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Zdjęcie</label>
<input id="image_file" name="image_file" type="file" accept="image/*"
class="w-full font-body-sm text-body-sm text-on-surface file:mr-3 file:px-4 file:py-2 file:rounded-full file:border-0 file:bg-secondary file:text-on-secondary file:font-title-sm file:cursor-pointer hover:file:opacity-90">
<p class="font-body-sm text-body-sm text-on-surface-variant/70">JPG/PNG, do 8 MB.</p>
</div>
</div>
<div class="flex items-center gap-2 pt-2">
<button type="submit" class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">Zapisz</button>
<a href="{{ route('metering.index') }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
</x-app-layout>
@@ -0,0 +1,56 @@
<x-app-layout :active="'metering.index'" title="SoftSPM 2 - Edycja: {{ $item->EQU_NAME }}">
<div class="max-w-2xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('metering.show', $item) }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Edycja urządzenia opomiarowania</h1>
</div>
@if ($errors->any())
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ $errors->first() }}</div>
@endif
<form method="POST" action="{{ route('metering.update', $item) }}" enctype="multipart/form-data"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding space-y-4">
@csrf
@method('PUT')
<x-well-field name="name" label="Nazwa" :value="old('name', $item->EQU_NAME)" required />
<x-well-select name="manufacturer_id" label="Producent" :options="$manufacturers" :selected="old('manufacturer_id', $item->EQU_MCF_ID)" required placeholder="- wybierz -" />
<div class="space-y-1">
<label for="description" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Opis</label>
<textarea id="description" name="description" rows="3"
class="w-full bg-surface-container-low border border-outline-variant px-3 py-2 rounded focus:ring-1 focus:ring-primary focus:border-primary font-body-md text-on-surface">{{ old('description', $item->EQU_DESCRIPTION) }}</textarea>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="space-y-1">
<label for="catalogue_file" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Dokumentacja katalogowa</label>
<input id="catalogue_file" name="catalogue_file" type="file" accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx"
class="w-full font-body-sm text-body-sm text-on-surface file:mr-3 file:px-4 file:py-2 file:rounded-full file:border-0 file:bg-secondary file:text-on-secondary file:font-title-sm file:cursor-pointer hover:file:opacity-90">
@if ($document)
<p class="font-body-sm text-body-sm text-on-surface-variant/70">Obecny: <a href="{{ route('equipment.file', $document->EQF_ID) }}" target="_blank" class="text-secondary hover:underline">{{ $document->EQF_FILE_NAME }}</a>. Wgranie nowego zastąpi.</p>
@else
<p class="font-body-sm text-body-sm text-on-surface-variant/70">Brak. PDF lub Office, do 8 MB.</p>
@endif
</div>
<div class="space-y-1">
<label for="image_file" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Zdjęcie</label>
<input id="image_file" name="image_file" type="file" accept="image/*"
class="w-full font-body-sm text-body-sm text-on-surface file:mr-3 file:px-4 file:py-2 file:rounded-full file:border-0 file:bg-secondary file:text-on-secondary file:font-title-sm file:cursor-pointer hover:file:opacity-90">
@if ($image)
<p class="font-body-sm text-body-sm text-on-surface-variant/70">Obecne: <a href="{{ route('equipment.file', $image->EQF_ID) }}" target="_blank" class="text-secondary hover:underline">{{ $image->EQF_FILE_NAME }}</a>. Wgranie nowego zastąpi.</p>
@else
<p class="font-body-sm text-body-sm text-on-surface-variant/70">Brak. JPG/PNG, do 8 MB.</p>
@endif
</div>
</div>
<div class="flex items-center gap-2 pt-2">
<button type="submit" class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">Zapisz zmiany</button>
<a href="{{ route('metering.show', $item) }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
</x-app-layout>
@@ -0,0 +1,75 @@
<x-app-layout :active="'metering.index'" title="SoftSPM 2 - Katalog opomiarowania">
<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 class="flex items-end justify-between">
<div>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Katalog opomiarowania</h1>
<p class="font-body-sm text-body-sm text-on-surface-variant mt-1">Wyników: <span class="font-data-label">{{ $items->total() }}</span></p>
</div>
<a href="{{ route('metering.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 urządzenie
</a>
</div>
{{-- Wyszukiwarka --}}
<form method="GET" action="{{ route('metering.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">Nazwa</label>
<input id="q" name="q" type="text" value="{{ $q }}" placeholder="nazwa urządzenia"
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
</div>
<div class="space-y-1">
<label for="mcf" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Producent</label>
<select id="mcf" name="mcf" class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
<option value="{{ $mcfAll }}" {{ (int) $mcf === $mcfAll ? 'selected' : '' }}>Wszyscy</option>
@foreach ($manufacturers as $id => $name)
<option value="{{ $id }}" {{ (int) $mcf === (int) $id ? 'selected' : '' }}>{{ $name }}</option>
@endforeach
</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 tracking-wide">
<th class="px-4 py-3 w-12">Lp.</th>
<x-sortable-th column="name">Nazwa</x-sortable-th>
<x-sortable-th column="mcf">Producent</x-sortable-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 ($items as $item)
<tr class="hover:bg-surface-container transition-colors">
<td class="px-4 py-3 font-data-label text-on-surface-variant">{{ $items->firstItem() + $loop->index }}.</td>
<td class="px-4 py-3 font-semibold text-on-surface">
<a href="{{ route('metering.show', $item) }}" class="hover:text-primary">{{ $item->EQU_NAME }}</a>
</td>
<td class="px-4 py-3">{{ $item->manufacturer?->MCF_NAME }}</td>
<td class="px-4 py-3 text-right whitespace-nowrap">
<a href="{{ route('metering.show', $item) }}" class="font-body-sm text-body-sm text-secondary hover:underline">Szczegóły</a>
<span class="text-outline-variant mx-1">·</span>
<a href="{{ route('metering.edit', $item) }}" class="font-body-sm text-body-sm text-secondary hover:underline">Edytuj</a>
</td>
</tr>
@empty
<tr><td colspan="4" class="px-4 py-8 text-center font-body-md text-body-md text-on-surface-variant">Brak urządzeń dla wybranych kryteriów.</td></tr>
@endforelse
</tbody>
</table>
</div>
<div>{{ $items->links() }}</div>
</div>
</x-app-layout>
@@ -0,0 +1,61 @@
<x-app-layout :active="'metering.index'" title="SoftSPM 2 - {{ $item->EQU_NAME }}">
<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
@if (session('error'))
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ session('error') }}</div>
@endif
<div class="flex flex-wrap items-center justify-between gap-3">
<div class="flex items-center gap-2">
<a href="{{ route('metering.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Katalog opomiarowania</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">{{ $item->EQU_NAME }}</h1>
</div>
<div class="flex items-center gap-2">
<a href="{{ route('metering.edit', $item) }}"
class="bg-secondary text-on-secondary px-4 py-2 rounded-full font-title-sm text-title-sm hover:opacity-90 transition-all active:scale-95">Edytuj</a>
@unless ($inUse)
<x-confirm-delete :action="route('metering.destroy', $item)"
message="Czy na pewno usunąć urządzenie „{{ $item->EQU_NAME }}”?" />
@endunless
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-stack-gap">
{{-- Dane --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-3">Dane</h2>
<dl class="grid grid-cols-3 gap-x-4 gap-y-2 font-body-md text-body-md">
<dt class="text-on-surface-variant">Nazwa</dt><dd class="col-span-2 font-semibold">{{ $item->EQU_NAME }}</dd>
<dt class="text-on-surface-variant">Producent</dt><dd class="col-span-2">{{ $item->manufacturer?->MCF_NAME ?? '-' }}</dd>
<dt class="text-on-surface-variant">Opis</dt><dd class="col-span-2">{!! $item->EQU_DESCRIPTION ? nl2br(e($item->EQU_DESCRIPTION)) : '-' !!}</dd>
@if ($document)
<dt class="text-on-surface-variant">Dokumentacja katalogowa</dt>
<dd class="col-span-2">
<a href="{{ route('equipment.file', $document->EQF_ID) }}" target="_blank"
class="text-secondary hover:underline break-all">{{ $document->EQF_FILE_NAME }}</a>
</dd>
@endif
</dl>
@if ($inUse)
<p class="mt-4 font-body-sm text-body-sm text-on-surface-variant/80">Urządzenie jest użyte w stanie opomiarowania - usunięcie zablokowane.</p>
@endif
</div>
{{-- Zdjęcie --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-3">Zdjęcie</h2>
@if ($image)
<img src="{{ route('equipment.file', $image->EQF_ID) }}" alt="{{ $item->EQU_NAME }}"
class="max-w-full h-auto rounded border border-outline-variant/40">
@else
<p class="font-body-sm text-body-sm text-on-surface-variant py-6 text-center">Brak zdjęcia.</p>
@endif
</div>
</div>
</div>
</x-app-layout>
@@ -0,0 +1,52 @@
<x-app-layout :active="'piping.index'" title="SoftSPM 2 - Nowa pozycja orurowania">
<div class="max-w-2xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('piping.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Nowa pozycja - orurowanie / armatura</h1>
</div>
@if ($errors->any())
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ $errors->first() }}</div>
@endif
<form method="POST" action="{{ route('piping.store') }}" enctype="multipart/form-data"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding space-y-4">
@csrf
<x-well-field name="name" label="Nazwa" :value="old('name')" required />
<x-well-select name="manufacturer_id" label="Producent" :options="$manufacturers" :selected="old('manufacturer_id')" required placeholder="- wybierz -" />
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<x-well-field name="diameter" label="Średnica [mm]" :value="old('diameter')" required />
<x-well-field name="length" label="Długość [m] / Ciśnienie [bar]" :value="old('length')" />
</div>
<div class="space-y-1">
<label for="description" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Opis</label>
<textarea id="description" name="description" rows="3"
class="w-full bg-surface-container-low border border-outline-variant px-3 py-2 rounded focus:ring-1 focus:ring-primary focus:border-primary font-body-md text-on-surface">{{ old('description') }}</textarea>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="space-y-1">
<label for="catalogue_file" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Dokumentacja katalogowa</label>
<input id="catalogue_file" name="catalogue_file" type="file" accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx"
class="w-full font-body-sm text-body-sm text-on-surface file:mr-3 file:px-4 file:py-2 file:rounded-full file:border-0 file:bg-secondary file:text-on-secondary file:font-title-sm file:cursor-pointer hover:file:opacity-90">
<p class="font-body-sm text-body-sm text-on-surface-variant/70">PDF lub Office, do 8 MB.</p>
</div>
<div class="space-y-1">
<label for="image_file" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Zdjęcie</label>
<input id="image_file" name="image_file" type="file" accept="image/*"
class="w-full font-body-sm text-body-sm text-on-surface file:mr-3 file:px-4 file:py-2 file:rounded-full file:border-0 file:bg-secondary file:text-on-secondary file:font-title-sm file:cursor-pointer hover:file:opacity-90">
<p class="font-body-sm text-body-sm text-on-surface-variant/70">JPG/PNG, do 8 MB.</p>
</div>
</div>
<div class="flex items-center gap-2 pt-2">
<button type="submit" class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">Zapisz</button>
<a href="{{ route('piping.index') }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
</x-app-layout>
@@ -0,0 +1,61 @@
<x-app-layout :active="'piping.index'" title="SoftSPM 2 - Edycja: {{ $item->EQU_NAME }}">
<div class="max-w-2xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('piping.show', $item) }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Edycja pozycji - orurowanie / armatura</h1>
</div>
@if ($errors->any())
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ $errors->first() }}</div>
@endif
<form method="POST" action="{{ route('piping.update', $item) }}" enctype="multipart/form-data"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding space-y-4">
@csrf
@method('PUT')
<x-well-field name="name" label="Nazwa" :value="old('name', $item->EQU_NAME)" required />
<x-well-select name="manufacturer_id" label="Producent" :options="$manufacturers" :selected="old('manufacturer_id', $item->EQU_MCF_ID)" required placeholder="- wybierz -" />
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<x-well-field name="diameter" label="Średnica [mm]" :value="old('diameter', $item->EQU_PARAM_01)" required />
<x-well-field name="length" label="Długość [m] / Ciśnienie [bar]" :value="old('length', $item->EQU_PARAM_02)" />
</div>
<div class="space-y-1">
<label for="description" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Opis</label>
<textarea id="description" name="description" rows="3"
class="w-full bg-surface-container-low border border-outline-variant px-3 py-2 rounded focus:ring-1 focus:ring-primary focus:border-primary font-body-md text-on-surface">{{ old('description', $item->EQU_DESCRIPTION) }}</textarea>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="space-y-1">
<label for="catalogue_file" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Dokumentacja katalogowa</label>
<input id="catalogue_file" name="catalogue_file" type="file" accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx"
class="w-full font-body-sm text-body-sm text-on-surface file:mr-3 file:px-4 file:py-2 file:rounded-full file:border-0 file:bg-secondary file:text-on-secondary file:font-title-sm file:cursor-pointer hover:file:opacity-90">
@if ($document)
<p class="font-body-sm text-body-sm text-on-surface-variant/70">Obecny: <a href="{{ route('equipment.file', $document->EQF_ID) }}" target="_blank" class="text-secondary hover:underline">{{ $document->EQF_FILE_NAME }}</a>. Wgranie nowego zastąpi.</p>
@else
<p class="font-body-sm text-body-sm text-on-surface-variant/70">Brak. PDF lub Office, do 8 MB.</p>
@endif
</div>
<div class="space-y-1">
<label for="image_file" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Zdjęcie</label>
<input id="image_file" name="image_file" type="file" accept="image/*"
class="w-full font-body-sm text-body-sm text-on-surface file:mr-3 file:px-4 file:py-2 file:rounded-full file:border-0 file:bg-secondary file:text-on-secondary file:font-title-sm file:cursor-pointer hover:file:opacity-90">
@if ($image)
<p class="font-body-sm text-body-sm text-on-surface-variant/70">Obecne: <a href="{{ route('equipment.file', $image->EQF_ID) }}" target="_blank" class="text-secondary hover:underline">{{ $image->EQF_FILE_NAME }}</a>. Wgranie nowego zastąpi.</p>
@else
<p class="font-body-sm text-body-sm text-on-surface-variant/70">Brak. JPG/PNG, do 8 MB.</p>
@endif
</div>
</div>
<div class="flex items-center gap-2 pt-2">
<button type="submit" class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">Zapisz zmiany</button>
<a href="{{ route('piping.show', $item) }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
</x-app-layout>
@@ -0,0 +1,79 @@
<x-app-layout :active="'piping.index'" title="SoftSPM 2 - Katalog orurowania i armatury">
<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 class="flex items-end justify-between">
<div>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Katalog orurowania i armatury</h1>
<p class="font-body-sm text-body-sm text-on-surface-variant mt-1">Wyników: <span class="font-data-label">{{ $items->total() }}</span></p>
</div>
<a href="{{ route('piping.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 pozycję
</a>
</div>
{{-- Wyszukiwarka --}}
<form method="GET" action="{{ route('piping.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">Typ orurowania - armatury</label>
<input id="q" name="q" type="text" value="{{ $q }}" placeholder="nazwa"
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
</div>
<div class="space-y-1">
<label for="mcf" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Producent</label>
<select id="mcf" name="mcf" class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
<option value="{{ $mcfAll }}" {{ (int) $mcf === $mcfAll ? 'selected' : '' }}>Wszyscy</option>
@foreach ($manufacturers as $id => $name)
<option value="{{ $id }}" {{ (int) $mcf === (int) $id ? 'selected' : '' }}>{{ $name }}</option>
@endforeach
</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 tracking-wide">
<th class="px-4 py-3 w-12">Lp.</th>
<x-sortable-th column="name">Nazwa</x-sortable-th>
<x-sortable-th column="diameter" align="right">Średnica [mm]</x-sortable-th>
<x-sortable-th column="length">Długość [m] / Ciśnienie [bar]</x-sortable-th>
<x-sortable-th column="mcf">Producent</x-sortable-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 ($items as $item)
<tr class="hover:bg-surface-container transition-colors">
<td class="px-4 py-3 font-data-label text-on-surface-variant">{{ $items->firstItem() + $loop->index }}.</td>
<td class="px-4 py-3 font-semibold text-on-surface">
<a href="{{ route('piping.show', $item) }}" class="hover:text-primary">{{ $item->EQU_NAME }}</a>
</td>
<td class="px-4 py-3 text-right font-data-label">{{ $item->EQU_PARAM_01 }}</td>
<td class="px-4 py-3 font-data-label">{{ $item->EQU_PARAM_02 }}</td>
<td class="px-4 py-3">{{ $item->manufacturer?->MCF_NAME }}</td>
<td class="px-4 py-3 text-right whitespace-nowrap">
<a href="{{ route('piping.show', $item) }}" class="font-body-sm text-body-sm text-secondary hover:underline">Szczegóły</a>
<span class="text-outline-variant mx-1">·</span>
<a href="{{ route('piping.edit', $item) }}" class="font-body-sm text-body-sm text-secondary hover:underline">Edytuj</a>
</td>
</tr>
@empty
<tr><td colspan="6" class="px-4 py-8 text-center font-body-md text-body-md text-on-surface-variant">Brak pozycji dla wybranych kryteriów.</td></tr>
@endforelse
</tbody>
</table>
</div>
<div>{{ $items->links() }}</div>
</div>
</x-app-layout>
@@ -0,0 +1,63 @@
<x-app-layout :active="'piping.index'" title="SoftSPM 2 - {{ $item->EQU_NAME }}">
<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
@if (session('error'))
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ session('error') }}</div>
@endif
<div class="flex flex-wrap items-center justify-between gap-3">
<div class="flex items-center gap-2">
<a href="{{ route('piping.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Katalog orurowania i armatury</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">{{ $item->EQU_NAME }}</h1>
</div>
<div class="flex items-center gap-2">
<a href="{{ route('piping.edit', $item) }}"
class="bg-secondary text-on-secondary px-4 py-2 rounded-full font-title-sm text-title-sm hover:opacity-90 transition-all active:scale-95">Edytuj</a>
@unless ($inStock)
<x-confirm-delete :action="route('piping.destroy', $item)"
message="Czy na pewno usunąć pozycję „{{ $item->EQU_NAME }}”?" />
@endunless
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-stack-gap">
{{-- Dane --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-3">Dane</h2>
<dl class="grid grid-cols-3 gap-x-4 gap-y-2 font-body-md text-body-md">
<dt class="text-on-surface-variant">Nazwa</dt><dd class="col-span-2 font-semibold">{{ $item->EQU_NAME }}</dd>
<dt class="text-on-surface-variant">Producent</dt><dd class="col-span-2">{{ $item->manufacturer?->MCF_NAME ?? '-' }}</dd>
<dt class="text-on-surface-variant">Średnica [mm]</dt><dd class="col-span-2 font-data-label">{{ $item->EQU_PARAM_01 ?: '-' }}</dd>
<dt class="text-on-surface-variant">Długość [m] / Ciśnienie [bar]</dt><dd class="col-span-2 font-data-label">{{ $item->EQU_PARAM_02 ?: '-' }}</dd>
<dt class="text-on-surface-variant">Opis</dt><dd class="col-span-2">{!! $item->EQU_DESCRIPTION ? nl2br(e($item->EQU_DESCRIPTION)) : '-' !!}</dd>
@if ($document)
<dt class="text-on-surface-variant">Dokumentacja katalogowa</dt>
<dd class="col-span-2">
<a href="{{ route('equipment.file', $document->EQF_ID) }}" target="_blank"
class="text-secondary hover:underline break-all">{{ $document->EQF_FILE_NAME }}</a>
</dd>
@endif
</dl>
@if ($inStock)
<p class="mt-4 font-body-sm text-body-sm text-on-surface-variant/80">Pozycja jest na stanie magazynowym - usunięcie zablokowane.</p>
@endif
</div>
{{-- Zdjęcie --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-3">Zdjęcie</h2>
@if ($image)
<img src="{{ route('equipment.file', $image->EQF_ID) }}" alt="{{ $item->EQU_NAME }}"
class="max-w-full h-auto rounded border border-outline-variant/40">
@else
<p class="font-body-sm text-body-sm text-on-surface-variant py-6 text-center">Brak zdjęcia.</p>
@endif
</div>
</div>
</div>
</x-app-layout>
@@ -0,0 +1,83 @@
<x-app-layout :active="'pumps.index'" title="SoftSPM 2 - Nowa pompa">
@php $factors = [0, 0.25, 0.55, 0.7, 1.0, 1.22, 1.35, 1.42]; @endphp
<div class="max-w-3xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('pumps.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Nowa pompa</h1>
</div>
@if ($errors->any())
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ $errors->first() }}</div>
@endif
<form method="POST" action="{{ route('pumps.store') }}"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding space-y-6">
@csrf
{{-- Dane podstawowe --}}
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<x-well-field name="name" label="Typ pompy" :value="old('name')" required class="sm:col-span-2" />
<x-well-select name="manufacturer_id" label="Producent" :options="$manufacturers" :selected="old('manufacturer_id')" required placeholder="- wybierz -" class="sm:col-span-2" />
<x-well-field name="q_n" label="Qₙ [m³/h]" :value="old('q_n')" required />
<x-well-field name="length" label="Długość [mm]" :value="old('length')" />
<x-well-field name="diameter" label="Średnica [mm]" :value="old('diameter')" />
<x-well-field name="weight" label="Masa [kg]" :value="old('weight')" />
</div>
{{-- 8 punktów krzywych - Q liczone z Qₙ, użytkownik podaje H i η --}}
<div>
<h2 class="font-title-sm text-title-sm text-tertiary mb-1">Parametry energetyczne (8 punktów)</h2>
<p class="font-body-sm text-body-sm text-on-surface-variant mb-2">
Wartości Q wyliczane automatycznie z Qₙ. Podaj H i η dla każdego punktu.
</p>
<table class="w-full text-left border border-outline-variant/40 rounded-lg overflow-hidden">
<thead class="bg-secondary/10">
<tr class="font-data-label text-data-label text-on-surface-variant tracking-wide">
<th class="px-3 py-2 w-10">Lp.</th>
<th class="px-3 py-2 text-right">Q [m³/h]</th>
<th class="px-3 py-2">H [m]</th>
<th class="px-3 py-2">η [-]</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30">
@foreach ($factors as $i => $f)
<tr>
<td class="px-3 py-1.5 font-data-label text-on-surface-variant">{{ $i + 1 }}.</td>
<td class="px-3 py-1.5 text-right font-data-label" data-qcell>0,000</td>
<td class="px-3 py-1.5">
<input type="text" name="h[{{ $i }}]" value="{{ old('h.'.$i) }}" required
class="w-28 bg-surface-container-low border border-outline-variant px-2 py-1 rounded font-data-label text-on-surface">
</td>
<td class="px-3 py-1.5">
<input type="text" name="eta[{{ $i }}]" value="{{ old('eta.'.$i) }}" required
class="w-28 bg-surface-container-low border border-outline-variant px-2 py-1 rounded font-data-label text-on-surface">
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="flex items-center gap-2">
<button type="submit" class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">Zapisz</button>
<a href="{{ route('pumps.index') }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
<script>
(function () {
const factors = @json($factors);
const qn = document.getElementById('q_n');
const cells = document.querySelectorAll('[data-qcell]');
function recalc() {
const v = parseFloat((qn.value || '').replace(',', '.')) || 0;
cells.forEach((el, i) => { el.textContent = (factors[i] * v).toFixed(3).replace('.', ','); });
}
qn.addEventListener('input', recalc);
recalc();
})();
</script>
</x-app-layout>
@@ -0,0 +1,88 @@
<x-app-layout :active="'pumps.index'" title="SoftSPM 2 - Edycja pompy">
<div class="max-w-4xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('pumps.show', $pump) }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Edycja pompy: {{ $pump->PUP_NAME }}</h1>
</div>
@if ($errors->any())
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ $errors->first() }}</div>
@endif
<form method="POST" action="{{ route('pumps.update', $pump) }}"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding space-y-6">
@csrf
@method('PUT')
{{-- Dane podstawowe --}}
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<x-well-field name="name" label="Typ pompy" :value="$pump->PUP_NAME" required class="sm:col-span-2" />
<x-well-select name="manufacturer_id" label="Producent" :options="$manufacturers" :selected="$pump->PUP_MCF_ID" required class="sm:col-span-2" />
<x-well-field name="_qn" label="Qₙ [m³/h]" :value="$qn" readonly />
<x-well-field name="length" label="Długość [mm]" :value="$pump->PUP_PUMP_LENGTH" />
<x-well-field name="diameter" label="Średnica [mm]" :value="$pump->PUP_DIAMETER" />
<x-well-field name="weight" label="Masa [kg]" :value="$pump->PUP_WEIGHT" />
</div>
{{-- Krzywe --}}
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
{{-- Q-H --}}
<div>
<h2 class="font-title-sm text-title-sm text-tertiary mb-2">Wysokość podnoszenia</h2>
<table class="w-full text-left border border-outline-variant/40 rounded-lg overflow-hidden">
<thead class="bg-secondary/10">
<tr class="font-data-label text-data-label text-on-surface-variant tracking-wide">
<th class="px-3 py-2 text-right">Q [m³/h]</th>
<th class="px-3 py-2">H [m]</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30">
@foreach ($h as $pt)
<tr>
<td class="px-3 py-1.5 text-right font-data-label text-on-surface-variant">{{ $pt->x }}</td>
<td class="px-3 py-1.5">
<input type="text" name="h[{{ $pt->id }}]" value="{{ $pt->y }}"
class="w-28 bg-surface-container-low border border-outline-variant px-2 py-1 rounded font-data-label text-on-surface">
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{-- Q-ETA --}}
<div>
<h2 class="font-title-sm text-title-sm text-tertiary mb-2">Sprawność</h2>
<table class="w-full text-left border border-outline-variant/40 rounded-lg overflow-hidden">
<thead class="bg-secondary/10">
<tr class="font-data-label text-data-label text-on-surface-variant tracking-wide">
<th class="px-3 py-2 text-right">Q [m³/h]</th>
<th class="px-3 py-2">η [-]</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30">
@foreach ($eta as $pt)
<tr>
<td class="px-3 py-1.5 text-right font-data-label text-on-surface-variant">{{ $pt->x }}</td>
<td class="px-3 py-1.5">
<input type="text" name="eta[{{ $pt->id }}]" value="{{ $pt->y }}"
class="w-28 bg-surface-container-low border border-outline-variant px-2 py-1 rounded font-data-label text-on-surface">
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div class="flex items-center gap-2">
<button type="submit"
class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">
Zapisz zmiany
</button>
<a href="{{ route('pumps.show', $pump) }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
</x-app-layout>
@@ -0,0 +1,95 @@
<x-app-layout :active="'pumps.index'" title="SoftSPM 2 - Katalog pomp">
<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 class="flex items-end justify-between">
<div>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Katalog pomp</h1>
<p class="font-body-sm text-body-sm text-on-surface-variant mt-1">
Wyników: <span class="font-data-label">{{ $pumps->total() }}</span>
</p>
</div>
<a href="{{ route('pumps.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 pompę
</a>
</div>
{{-- Wyszukiwarka --}}
<form method="GET" action="{{ route('pumps.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="by" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Kryterium</label>
<select id="by" name="by" class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
<option value="name" {{ $by === 'name' ? 'selected' : '' }}>Typ pompy</option>
<option value="flow" {{ $by === 'flow' ? 'selected' : '' }}>Wydajność Q</option>
</select>
</div>
<div class="space-y-1">
<label for="q" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Szukaj</label>
<input id="q" name="q" type="text" value="{{ $q }}" placeholder="typ lub wartość Q"
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
</div>
<div class="space-y-1">
<label for="mcf" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Producent</label>
<select id="mcf" name="mcf" class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
<option value="{{ $mcfAll }}" {{ (int) $mcf === $mcfAll ? 'selected' : '' }}>Wszyscy</option>
@foreach ($manufacturers as $id => $name)
<option value="{{ $id }}" {{ (int) $mcf === (int) $id ? 'selected' : '' }}>{{ $name }}</option>
@endforeach
</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 tracking-wide">
<th class="px-4 py-3 w-12">Lp.</th>
<x-sortable-th column="name">Typ pompy</x-sortable-th>
<x-sortable-th column="flow" align="right">Q<sub>n</sub> [m³/h]</x-sortable-th>
<x-sortable-th column="hp" align="right">H<sub>p</sub> [m]</x-sortable-th>
<x-sortable-th column="mcf">Producent</x-sortable-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 ($pumps as $pump)
<tr class="hover:bg-surface-container transition-colors">
<td class="px-4 py-3 font-data-label text-on-surface-variant">{{ $pumps->firstItem() + $loop->index }}.</td>
<td class="px-4 py-3 font-semibold text-on-surface">
<a href="{{ route('pumps.show', $pump) }}" class="hover:text-primary">{{ $pump->PUP_NAME }}</a>
</td>
<td class="px-4 py-3 text-right font-data-label">{{ number_format(round((float) $pump->PUP_Q_N, 3), 3, ',', ' ') }}</td>
<td class="px-4 py-3 text-right font-data-label">{{ $pump->PUP_H_P }}</td>
<td class="px-4 py-3">{{ $pump->manufacturer?->MCF_NAME }}</td>
<td class="px-4 py-3 text-right whitespace-nowrap">
<a href="{{ route('pumps.show', $pump) }}" class="font-body-sm text-body-sm text-secondary hover:underline">Szczegóły</a>
<span class="text-outline-variant mx-1">·</span>
<a href="{{ route('pumps.edit', $pump) }}" class="font-body-sm text-body-sm text-secondary hover:underline">Edytuj</a>
</td>
</tr>
@empty
<tr>
<td colspan="6" class="px-4 py-8 text-center font-body-md text-body-md text-on-surface-variant">
Brak pomp dla wybranych kryteriów.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<div>{{ $pumps->links() }}</div>
</div>
</x-app-layout>
@@ -0,0 +1,152 @@
<x-app-layout :active="'pumps.index'" title="SoftSPM 2 - {{ $pump->PUP_NAME }}">
@php
$fmt = fn ($v, $d = 3) => $v === null ? '-' : number_format(round((float) $v, $d), $d, ',', ' ');
@endphp
<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
{{-- Nagłówek + akcje --}}
<div class="flex flex-wrap items-center justify-between gap-3">
<div class="flex items-center gap-2">
<a href="{{ route('pumps.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Katalog pomp</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">{{ $pump->PUP_NAME }}</h1>
</div>
<div class="flex items-center gap-2">
<a href="{{ route('pumps.edit', $pump) }}"
class="bg-secondary text-on-secondary px-4 py-2 rounded-full font-title-sm text-title-sm hover:opacity-90 transition-all active:scale-95">Edytuj</a>
<x-confirm-delete :action="route('pumps.destroy', $pump)"
message="Czy na pewno usunąć pompę „{{ $pump->PUP_NAME }}”? Tej operacji nie można cofnąć." />
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-stack-gap">
{{-- LEWA: dane techniczne --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-3">Dane techniczne pompy</h2>
<dl class="grid grid-cols-2 gap-x-4 gap-y-2 font-body-md text-body-md">
<dt class="text-on-surface-variant">Typ pompy</dt><dd class="font-semibold">{{ $pump->PUP_NAME }}</dd>
<dt class="text-on-surface-variant">Producent</dt><dd>{{ $pump->manufacturer?->MCF_NAME ?? '-' }}</dd>
<dt class="col-span-2 border-t border-outline-variant/30 mt-1 pt-1"></dt>
<dt class="text-on-surface-variant">Q<sub>n</sub> [m³/h]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_Q_N) }}</dd>
<dt class="text-on-surface-variant">Q<sub>min</sub> [m³/h]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_Q_MIN) }}</dd>
<dt class="text-on-surface-variant">Q<sub>max</sub> [m³/h]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_Q_MAX) }}</dd>
<dt class="text-on-surface-variant">H<sub>p</sub> [m]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_H_P, 2) }}</dd>
<dt class="text-on-surface-variant">H<sub>min</sub> [m]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_H_MIN, 2) }}</dd>
<dt class="text-on-surface-variant">H<sub>max</sub> [m]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_H_MAX, 2) }}</dd>
<dt class="text-on-surface-variant">η<sub>max</sub> [-]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_ETA_MAX, 2) }}</dd>
<dt class="col-span-2 border-t border-outline-variant/30 mt-1 pt-1"></dt>
<dt class="text-on-surface-variant">Długość [mm]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_PUMP_LENGTH, 2) }}</dd>
<dt class="text-on-surface-variant">Średnica [mm]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_DIAMETER, 2) }}</dd>
<dt class="text-on-surface-variant">Masa [kg]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_WEIGHT, 2) }}</dd>
</dl>
</div>
{{-- PRAWA: wykresy --}}
<div class="space-y-stack-gap">
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-2">Wysokość podnoszenia &nbsp;<span class="font-body-sm text-on-surface-variant">H = f(Q)</span></h2>
@if ($hDrawable)
<x-pump-curve :plot="$hPlot" id="hchart" :interactive="true" :initial-q="$q"
:eta-coeffs="data_get($etaPlot, 'coeffs', [])"
q-input="#q" h-output="#rv-h" eta-output="#rv-eta"
x-label="Q [m³/h]" y-label="H [m]" />
@else
<p class="font-body-sm text-body-sm text-on-surface-variant py-6 text-center">Brak parametrów energetycznych dla pompy.</p>
@endif
</div>
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-2">Sprawność &nbsp;<span class="font-body-sm text-on-surface-variant">η = f(Q)</span></h2>
@if ($etaDrawable)
<x-pump-curve :plot="$etaPlot" x-label="Q [m³/h]" y-label="η [-]" />
@else
<p class="font-body-sm text-body-sm text-on-surface-variant py-6 text-center">Brak parametrów energetycznych dla pompy.</p>
@endif
</div>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-stack-gap">
{{-- Parametry energetyczne (punkty krzywych) --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card overflow-hidden">
<div class="px-card-inner-padding pt-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-2">Parametry energetyczne</h2>
</div>
<table class="w-full text-left">
<thead class="bg-secondary/10 border-y border-outline-variant/40">
<tr class="font-data-label text-data-label text-on-surface-variant tracking-wide">
<th class="px-4 py-2 w-10">Lp.</th>
<th class="px-4 py-2 text-right">Q [m³/h]</th>
<th class="px-4 py-2 text-right">H [m]</th>
<th class="px-4 py-2 text-right">η [-]</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30 font-data-label">
@foreach ($h as $i => $pt)
<tr>
<td class="px-4 py-1.5 text-on-surface-variant">{{ $i + 1 }}.</td>
<td class="px-4 py-1.5 text-right">{{ $pt->x }}</td>
<td class="px-4 py-1.5 text-right">{{ $pt->y }}</td>
<td class="px-4 py-1.5 text-right">{{ $eta[$i]->y ?? '-' }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{-- Przelicz dla zadanego Q + lista silników --}}
<div class="space-y-stack-gap">
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-3">Parametry energetyczne na zadane Q</h2>
<form method="GET" action="{{ route('pumps.show', $pump) }}" 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">Dla Q [m³/h]</label>
<input id="q" name="q" type="text" value="{{ number_format($q, 3, ',', '') }}"
class="w-32 bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
</div>
<button type="submit" class="bg-secondary text-on-secondary px-4 py-2 rounded-full font-title-sm text-title-sm hover:opacity-90 active:scale-95">Przelicz</button>
@if ($outOfRange)
<span class="font-body-sm text-body-sm text-error">poza zakresem</span>
@endif
</form>
<dl class="grid grid-cols-2 gap-2 mt-3 font-body-md text-body-md">
<dt class="text-on-surface-variant">Wartość H [m]</dt><dd id="rv-h" class="font-data-label font-semibold">{{ $hAtQ === null ? '-' : number_format(round($hAtQ, 2), 2, ',', ' ') }}</dd>
<dt class="text-on-surface-variant">Wartość η [-]</dt><dd id="rv-eta" class="font-data-label font-semibold">{{ $etaAtQ === null ? '-' : number_format(round($etaAtQ, 2), 2, ',', ' ') }}</dd>
</dl>
</div>
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card overflow-hidden">
<div class="px-card-inner-padding pt-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-2">Lista silników dla pompy</h2>
</div>
<table class="w-full text-left">
<thead class="bg-secondary/10 border-y border-outline-variant/40">
<tr class="font-data-label text-data-label text-on-surface-variant tracking-wide">
<th class="px-4 py-2">Typ silnika</th>
<th class="px-4 py-2 text-right">Napięcie [V]</th>
<th class="px-4 py-2 text-right">Moc [kW]</th>
<th class="px-4 py-2">Producent</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30 font-body-md text-body-md">
@forelse ($relatedEngines as $e)
<tr>
<td class="px-4 py-1.5">{{ $e->ENG_NAME }}</td>
<td class="px-4 py-1.5 text-right font-data-label">{{ $e->ENG_VOLTAGE }}</td>
<td class="px-4 py-1.5 text-right font-data-label">{{ $e->ENG_POWER }}</td>
<td class="px-4 py-1.5">{{ $e->MCF_NAME }}</td>
</tr>
@empty
<tr><td colspan="4" class="px-4 py-4 text-center font-body-sm text-on-surface-variant">Brak powiązanych silników.</td></tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</x-app-layout>