@extends('layout.app') @section('title', 'Edit Lifespan Entry') @push('header_script') @endpush @section('content')
Back to List
{!! Form::open([ 'route' => ['vms.lifespan.update', $lifespan->id], 'method' => 'PUT', 'class' => 'needs-validation', 'autocomplete' => 'off', 'id' => 'lifespanForm', ]) !!}
{{-- ── SECTION 1: Vehicle & Component ──────────────────── --}}
Vehicle & Component Details
{!! Form::select('vehicle_id', ['' => '-- Select Vehicle --'] + $vehicles, old('vehicle_id', $lifespan->vehicle_id), [ 'class' => 'form-control select2 ' . ($errors->has('vehicle_id') ? 'is-invalid' : ''), 'id' => 'vehicle_id', 'required' => true, ]) !!}
{{ $errors->first('vehicle_id') }}
{!! Form::select('product_id', ['' => '-- Select Product --'] + $products, old('product_id', $lifespan->product_id), [ 'class' => 'form-control select2 ' . ($errors->has('product_id') ? 'is-invalid' : ''), 'id' => 'product_id', 'required' => true, ]) !!}
{{ $errors->first('product_id') }}
{!! Form::select('brand_id', ['' => '-- Select Brand --'] + $brands, old('brand_id', $lifespan->brand_id), [ 'class' => 'form-control select2 ' . ($errors->has('brand_id') ? 'is-invalid' : ''), 'id' => 'brand_id', ]) !!}
{{ $errors->first('brand_id') }}
{{-- ── SECTION 2: Dates & KM ───── --}}
Fitting & Removal Details
{{ $errors->first('fitted_date') }}
{{ $errors->first('fitted_km') }}
{{ $errors->first('removed_date') }}
{{ $errors->first('removed_km') }}
{!! Form::select('reason', [ '' => '-- Select Reason --', 'fully_used' => 'Fully Used', 'driver_irresponsibility' => "Driver's Irresponsibility / Careless", 'maintenance_problem' => 'Maintenance Problem', 'manufacturing_defect' => 'Manufacturing Defect', 'rotation' => 'Rotation / Position Change', 'still_using' => 'Still Using', ], old('reason', $lifespan->reason), [ 'class' => 'form-control select2', 'id' => 'reason', ]) !!}
{!! Form::select('status', [ 'active' => 'Active (Still Fitted)', 'removed' => 'Removed', ], old('status', $lifespan->status), [ 'class' => 'form-control select2', 'id' => 'status', 'required' => true, ]) !!}
is_reusable) ? 'checked' : '' }}>
{{-- ── SECTION 3: Lifespan Summary ─────────────────────── --}}
Lifespan Summary
{{ $lifespan->lifespan_days ? $lifespan->lifespan_days . ' days' : '—' }}
Days on Vehicle
{{ $lifespan->lifespan_km ? number_format($lifespan->lifespan_km) . ' km' : '—' }}
KM Covered

Auto-calculated when both dates and KM are entered.

{{-- end row --}}
Cancel
{!! Form::close() !!}
@endsection @push('footer_script') @endpush