@php
    $tblStats = '<table class="table table-bordered"><tr class="bg-info text-black"><td class="font-weight-bold">فاصلہ<br>(کلومیٹر)</td>
    <td class="font-weight-bold">کل ڈیزل<br>(لیٹر)</td><td class="font-weight-bold">کل آئل<br>(لیٹر)</td></tr>';
    $tblStats .= '<tr class="text-black">';
    $avg = 0;
    $kilometers = $trips->end_reading - $trips->start_reading;
    $diesel = ($trips->diesel()==0 || $trips->diesel()=='')? 1: $trips->diesel();
    $oil = $trips->oil();
    $tblStats .= '<td>' . number_format($kilometers, 0) . '</td>';
    $tblStats .= '<td>' . number_format($diesel, 0) . '</td>';
    $tblStats .= '<td>' . number_format($oil, 0) . '</td>';
    $avg = $kilometers / $diesel;

    $tblStats .= '</tr><tr><td colspan="3"></td></tr>';
    $tblStats .= '<tr class="text-black">';
    $tblStats .= '<td class="font-weight-bold">اوسط</td>';
    $tblStats .= '<td colspan="2">' . number_format($avg, 2) . ' لیٹر فی کلومیٹر</td>';
    $tblStats .= '</tr><tr><td colspan="3"></td></tr>';
    $tblStats .= '</table>';
@endphp
<span class="tooltip1 pull-right text-danger">
    <i class="fa fa-info-circle"></i>
    آئل اوسط
    <span class="tooltiptext" style="margin-left: -130px;">{!! $tblStats !!}</span>
</span>
