Files
MileageTraker/Web/Views/Log/MonthlyDriverMileage.cshtml
T
2013-02-17 14:30:25 -05:00

109 lines
3.0 KiB
Plaintext

@model MileageTraker.Web.ViewModels.DriverMileageViewModel
@{
ViewBag.Title = "Driver Mileage Report";
}
@{ Html.RenderPartial("BackToLogs"); }
@Html.Partial("_StatusMessage")
<h2>@ViewBag.Title</h2>
<div>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Query.Year)</dt>
<dd>@Html.Encode(Model.Query.Year)</dd>
</dl>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Query.Month)</dt>
<dd>@Html.Encode(Model.Query.Month)</dd>
</dl>
@if (Model.Query.LogType.HasValue)
{
<dl class="inline">
<dt>Type</dt>
<dd>@Html.Encode(Model.Query.LogType)</dd>
</dl>
}
</div>
<table class="table">
<tr>
<th>
Driver
</th>
<th>
Vehicle
</th>
<th>
Trips
</th>
<th>
Total Miles
</th>
<th>
Total Gas Purchased
</th>
</tr>
@foreach (var item in Model.Items)
{
<tr>
<td colspan="5">@Html.DisplayTextFor(i => item.DriverName)</td>
</tr>
foreach (var vehicleItem in item.VehicleMileageItems)
{
<tr>
<td style="border-top: 0"></td>
<td>
@Html.DisplayTextFor(i => vehicleItem.VehicleId)
(@Html.DisplayTextFor(i => vehicleItem.Prog))
</td>
<td>
@Html.DisplayTextFor(i => vehicleItem.TripCount)
</td>
<td @if (vehicleItem.LogPairs.Any(lp => lp.Item1 == null)){
@:class="ui-state-error"
}>
<span class="report-miles">@Html.DisplayTextFor(i => vehicleItem.Miles)</span>
@Html.Partial("LogsSummary", vehicleItem.LogPairs)
</td>
<td>
@Html.DisplayTextFor(i => vehicleItem.GasPurchased)
</td>
</tr>
}
<tr>
<td style="border-top: 0"></td>
<td style="text-align: right">
<strong>
Total:
</strong>
</td>
<td>
<strong>
@Html.DisplayTextFor(i => item.TripCount)
</strong>
</td>
<td>
<strong>
@Html.DisplayTextFor(i => item.Miles)
</strong>
</td>
<td>
<strong>
@Html.DisplayTextFor(i => item.GasPurchased)
</strong>
</td>
</tr>
}
<tfoot>
<tr>
<td colspan="2" style="text-align: right"><strong>Grand Total:</strong></td>
<td><strong>@Html.DisplayTextFor(m => m.TotalTrips)</strong></td>
<td><strong>@Html.DisplayTextFor(m => m.TotalMiles)</strong></td>
<td><strong>@Html.DisplayTextFor(m => m.TotalGasPurchased)</strong></td>
</tr>
</tfoot>
</table>