<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title> Trips Report | {{  $business_name->name }}</title>
    <style>
        .table,
        .tcell,
        .thead {
            border: 1px solid black;
        }

        .table {
            width: 100%;
            border-collapse: collapse;
        }

    </style>
</head>

<body>
<div>
    <div style="text-align: center">
        <h1>{{  $business_name->name }} </h1>
        {{-- <h1><img src="{{ public_path('assets/images/Logo_sadiq.png') }}" alt="" width="200"></h1> --}}
    </div>
    <div style="text-align: center;">
        <h4> Trips Reports</h4>
    </div>
    @forelse ($data['ledgers'] as $key =>$trip)

        <table style="width: 100%;border-collapse: collapse; margin-bottom: 10px">
            <tr>
                <td style="width:33.33%; text-align: left">

                </td>
                <td style="width:33.33%; text-align: center">

                </td>
                <td style="width:33.33%; text-align: right">
                    <span style="font-weight: bold">Vehicle No:</span> <span
                        style="text-decoration: underline">{{ $trip->vehicle->vehicle_no}}</span><br>
                    <span style="font-weight: bold">Starting Date:</span> <span
                        style="text-decoration: underline">{{ date('F j, Y', strtotime($trip->starting_date)) }}</span>
                </td>
            </tr>
        </table>

</div>
<br>

<table class="table">
    <thead>
    <tr>
        <th class="thead">Sr. No.</th>
        {{--        <th class="thead">Vehicle Number</th>--}}
        {{--        <th class="thead">Starting Date</th>--}}
        <th class="thead">From</th>
        <th class="thead">To</th>
        <th class="thead">A/C Name</th>
        <th class="thead">Item</th>
        <th class="thead">Weight</th>
        <th class="thead">Bill Freight</th>
        <th class="thead">Actual Freight</th>
        {{-- <th class="thead">Status</th> --}}
    </tr>
    </thead>
    <tbody>@forelse ($trip->trip_details as $key =>$detail)

        <tr style="text-align: center;">
            <td class="thead">{{ $loop->iteration }}</td>
            {{--            <td class="thead">{{ $trip->vehicle->vehicle_no }}</td>--}}
            {{--            <td class="thead"></td>--}}
            <td class="thead">
                {{$detail->from_city->name }}</td>
            <td class="thead">
                {{  $detail->to_city->name  }}
            </td>
            <td class="thead">
                {{  $detail->broker->name  }}
            </td>
            <td class="thead">
                {{  $detail->item_name  }}
            </td>
            <td class="thead">
                {{  $detail->item_weight  }}
                {{  $detail->weight_type  }}
            </td>
            <td class="thead">
                {{  number_format($detail->bill_freight,0)  }}

            </td>
            <td class="thead">
                {{ number_format($detail->actual_freight,0)  }}

            </td>
        </tr>
    @empty
        <tr>
            <td colspan="7">No Data Available</td>
        </tr>
    @endforelse

    </tbody>
</table>

@empty
@endforelse
</body>

</html>
