@extends('layouts.app') @section('content')
@if(session('success')) @endif @if(session('error')) @endif @if($errors->any()) @endif {{-- Item Information Card --}}
Item Information
Item Name:
{{ $serial->inventory->name ?? 'N/A' }}
Serial Number:
{{ $serial->serialNo ?? 'N/A' }}
Tag Number:
{{ $serial->tagNumber ?? 'N/A' }}
Location:
{{ $serial->location->name ?? ($serial->inventory->location->name ?? 'N/A') }}
{{-- Replace the holder section in your blade template with this: --}}
@if($serial->idHolder)
Current Holder:
{{ $serial->idHolder->name }}
@endif
Status:
{{ $serial->status }}
@if($serial->inventory->brand)
Brand:
{{ $serial->inventory->brand }}
@endif @if($serial->inventory->category)
Category:
{{ $serial->inventory->category->name }}
@endif
{{-- Add New Maintenance Form --}}
Add New Maintenance Record
@csrf
@error('maintenance_type')
{{ $message }}
@enderror Corrective: Repair after breakdown | Preventive: Scheduled maintenance
@error('maintenance_date')
{{ $message }}
@enderror
@error('description')
{{ $message }}
@enderror
@error('cost')
{{ $message }}
@enderror
@error('performed_by')
{{ $message }}
@enderror
@error('status')
{{ $message }}
@enderror
@error('attachment')
{{ $message }}
@enderror Supported formats: JPG, JPEG, PNG, GIF, PDF. Max size: 10MB {{-- File Preview --}}
{{-- Maintenance History --}}
Maintenance History
@if($maintenances->count() > 0)
@foreach($maintenances as $index => $maintenance) @endforeach
No. Date Type Description Cost (RM) Performed By Status Attachment
{{ $index + 1 }} {{ $maintenance->maintenance_date->format('d/m/Y') }} {{ $maintenance->formatted_type }} {{ $maintenance->description }} @if($maintenance->cost) {{ number_format($maintenance->cost, 2) }} @else - @endif {{ $maintenance->performed_by }} {{ $maintenance->formatted_status }} @if($maintenance->attachment_path)
{{-- Download Button --}} {{-- View Button --}} @php $extension = strtolower(pathinfo($maintenance->attachment_path, PATHINFO_EXTENSION)); @endphp @if(in_array($extension, ['jpg','jpeg','png','gif','bmp','webp'])) @elseif($extension === 'pdf') @endif {{-- Delete Button --}}
{{-- File Info --}}
@if(in_array($extension, ['jpg','jpeg','png','gif','bmp','webp'])) @elseif($extension === 'pdf') @else @endif {{ $maintenance->attachment_name }}
@else - @endif
@else
No maintenance records found

Add the first maintenance record using the form above.

@endif
{{-- Image Modal --}} {{-- PDF Modal --}} @endsection