@extends('layout.app') @section('title', 'Add Lifespan Entry') @push('header_script') @endpush @section('content')
Back to List
{!! Form::open([ 'route' => 'vms.lifespan.store', 'method' => 'POST', 'class' => 'needs-validation', 'autocomplete' => 'off', 'id' => 'lifespanForm', ]) !!}
{{-- ── SECTION 1: Vehicle & Component ─────────────────── --}}
Vehicle & Component Details
{!! Form::select('vehicle_id', ['' => '-- Select Vehicle --'] + $vehicles, old('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'), [ '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'), [ 'class' => 'form-control select2 ' . ($errors->has('brand_id') ? 'is-invalid' : ''), 'id' => 'brand_id', ]) !!}
{{ $errors->first('brand_id') }}
{{ $errors->first('position') }}
{{ $errors->first('new_unique_no') }}
{{ $errors->first('old_unique_no') }}
{{-- ── SECTION 2: Dates & KM ───── --}}
Fitting & Removal Details
{{-- Fitted Date --}}
{{ $errors->first('fitted_date') }}
{{-- Fitted KM --}}
{{ $errors->first('fitted_km') }}
{{-- Removed Date --}}
{{ $errors->first('removed_date') }}
{{-- Removed KM --}}
{{ $errors->first('removed_km') }}
{{-- Reason --}}
{!! 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'), [ 'class' => 'form-control select2', 'id' => 'reason', ], ) !!}
{{ $errors->first('reason') }}
{{-- Status --}}
{!! Form::select( 'status', [ 'active' => 'Active (Still Fitted)', 'removed' => 'Removed', ], old('status', 'active'), [ 'class' => 'form-control select2', 'id' => 'status', 'required' => true, ], ) !!}
{{ $errors->first('status') }}
{{-- Reusable --}}
{{-- Remark --}}
{{-- ── SECTION 3: Auto Calculated Lifespan ────────────── --}}
Lifespan Summary
{{-- Days --}}
Days on Vehicle
{{-- KM --}}
KM Covered

Auto-calculated when both dates and KM are entered.

{{-- ── Submit Buttons -------- --}}
Cancel
{!! Form::close() !!}
@endsection @push('footer_script') @endpush