@extends('layouts.admin')

@section('content')

<h2>
    History Maintenance - {{ $vehicle->vehicle_name }}
</h2>

<p>
    Total Harga Maintenance:
    <strong>
        Rp {{ number_format($totalCost, 0) }}
    </strong>
</p>

<br>

<table>
    <tr>
        <th>Service</th>
        <th>Tanggal</th>
        <th>Harga</th>
        <th>Vendor</th>
        <th>Note</th>
    </tr>

    @foreach($records as $record)
    <tr>
        <td>{{ $record->service_type }}</td>
        <td>{{ $record->service_date }}</td>
        <td>Rp {{ number_format($record->cost, 0) }}</td>
        <td>{{ $record->vendor }}</td>
        <td>{{ $record->notes }}</td>
    </tr>
    @endforeach

</table>

@endsection