|
|
@@ -1,7 +1,8 @@
|
|
|
-@model Kitty_Fall.Cms.Models.DailyReportViewModel
|
|
|
+@model Kitty_Fall.Cms.Models.ReportByTimesViewModel
|
|
|
@{
|
|
|
ViewData["Title"] = "Daily Report";
|
|
|
- var dateValue = Model.DateData?.ToString("yyyy-MM-dd");
|
|
|
+ var fromDateValue = Model.FromDate?.ToString("yyyy-MM-dd");
|
|
|
+ var toDateValue = Model.ToDate?.ToString("yyyy-MM-dd");
|
|
|
string FormatNumber(decimal value) => value.ToString("#,##0.##");
|
|
|
}
|
|
|
|
|
|
@@ -9,28 +10,30 @@
|
|
|
<div class="rounded-3xl bg-white shadow-sm ring-1 ring-gray-100">
|
|
|
<div class="border-b border-gray-100 px-5 py-5 sm:px-6">
|
|
|
<div>
|
|
|
- <h1 class="text-2xl font-bold text-gray-900">Daily Report</h1>
|
|
|
- <p class="mt-1 text-sm text-gray-500">Daily subscriber, registration, cancellation, revenue and bonus report.</p>
|
|
|
+ <h1 class="text-xl font-bold text-gray-900">ReportByTimes - Daily</h1>
|
|
|
+ <p class="mt-1 text-sm text-gray-500">Daily subscription, cancellation, revenue and bonus report.</p>
|
|
|
</div>
|
|
|
|
|
|
- <form method="get" action="@Url.Content("~/DailyReport")" class="mt-5 grid gap-3 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]">
|
|
|
+ <form method="get" action="@Url.Content("~/DailyReport")" class="mt-5 grid gap-3 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]">
|
|
|
<label class="block">
|
|
|
<span class="mb-2 block text-sm font-semibold text-gray-700">Service</span>
|
|
|
<select name="serviceFilter" class="w-full rounded-2xl border border-gray-200 px-4 py-3 text-sm text-gray-700 outline-none transition focus:border-admin-active focus:ring-2 focus:ring-purple-100">
|
|
|
- @foreach (var service in Model.ServiceFilters)
|
|
|
+ @foreach (var service in Model.Services)
|
|
|
{
|
|
|
<option value="@service.Value" selected="@(string.Equals(Model.ServiceFilter, service.Value, StringComparison.OrdinalIgnoreCase) ? "selected" : null)">@service.Name</option>
|
|
|
}
|
|
|
</select>
|
|
|
</label>
|
|
|
<label class="block">
|
|
|
- <span class="mb-2 block text-sm font-semibold text-gray-700">Date</span>
|
|
|
- <input type="date" name="dateData" value="@dateValue" class="w-full rounded-2xl border border-gray-200 px-4 py-3 text-sm text-gray-700 outline-none transition focus:border-admin-active focus:ring-2 focus:ring-purple-100" />
|
|
|
+ <span class="mb-2 block text-sm font-semibold text-gray-700">From date</span>
|
|
|
+ <input type="date" name="fromDate" value="@fromDateValue" class="w-full rounded-2xl border border-gray-200 px-4 py-3 text-sm text-gray-700 outline-none transition focus:border-admin-active focus:ring-2 focus:ring-purple-100" />
|
|
|
+ </label>
|
|
|
+ <label class="block">
|
|
|
+ <span class="mb-2 block text-sm font-semibold text-gray-700">To date</span>
|
|
|
+ <input type="date" name="toDate" value="@toDateValue" class="w-full rounded-2xl border border-gray-200 px-4 py-3 text-sm text-gray-700 outline-none transition focus:border-admin-active focus:ring-2 focus:ring-purple-100" />
|
|
|
</label>
|
|
|
<div class="flex items-end">
|
|
|
- <button type="submit" class="inline-flex w-full items-center justify-center rounded-2xl bg-admin-active px-4 py-3 text-sm font-semibold text-white transition hover:bg-purple-700 md:w-auto">
|
|
|
- Apply filter
|
|
|
- </button>
|
|
|
+ <button type="submit" class="inline-flex w-full items-center justify-center rounded-2xl bg-admin-active px-4 py-3 text-sm font-semibold text-white transition hover:bg-purple-700 md:w-auto">Apply filter</button>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
|
@@ -39,53 +42,59 @@
|
|
|
{
|
|
|
<div class="px-5 py-10 text-center sm:px-6">
|
|
|
<div class="text-base font-semibold text-gray-800">No daily report data found.</div>
|
|
|
- <div class="mt-2 text-sm text-gray-500">Adjust the service or date and try again.</div>
|
|
|
+ <div class="mt-2 text-sm text-gray-500">Adjust the date range and try again.</div>
|
|
|
</div>
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- <div class="space-y-3 px-5 py-6 md:hidden">
|
|
|
- @foreach (var item in Model.Items)
|
|
|
- {
|
|
|
- <div class="rounded-2xl border border-gray-100 bg-white p-4 shadow-sm">
|
|
|
- <div class="text-base font-bold text-gray-900">@item.Date.ToString("dd/MM/yyyy")</div>
|
|
|
- <div class="mt-4 grid grid-cols-2 gap-4 text-sm">
|
|
|
- <div><div class="text-xs font-bold uppercase text-gray-400">Total subscribers</div><div class="mt-1 font-semibold text-gray-800">@FormatNumber(item.TotalSubscribers)</div></div>
|
|
|
- <div><div class="text-xs font-bold uppercase text-gray-400">Registered</div><div class="mt-1 font-semibold text-gray-800">@FormatNumber(item.Registered)</div></div>
|
|
|
- <div><div class="text-xs font-bold uppercase text-gray-400">Cancelled</div><div class="mt-1 font-semibold text-gray-800">@FormatNumber(item.Cancelled)</div></div>
|
|
|
- <div><div class="text-xs font-bold uppercase text-gray-400">Revenue</div><div class="mt-1 font-semibold text-gray-800">@FormatNumber(item.Revenue)</div></div>
|
|
|
- <div><div class="text-xs font-bold uppercase text-gray-400">Bonus</div><div class="mt-1 font-semibold text-gray-800">@FormatNumber(item.Bonus)</div></div>
|
|
|
+ <div class="px-5 py-5 sm:hidden">
|
|
|
+ <div class="space-y-4">
|
|
|
+ @foreach (var item in Model.Items)
|
|
|
+ {
|
|
|
+ <div class="rounded-3xl border border-gray-100 bg-gray-50 p-4 shadow-sm">
|
|
|
+ <div class="text-lg font-bold text-gray-900">@item.Ngay.ToString("dd/MM/yyyy")</div>
|
|
|
+ <div class="mt-4 grid grid-cols-2 gap-3 text-sm">
|
|
|
+ <div class="rounded-2xl bg-white px-3 py-2"><div class="text-gray-500">Total subscriptions</div><div class="mt-1 font-semibold text-gray-900">@FormatNumber(item.TongSub)</div></div>
|
|
|
+ <div class="rounded-2xl bg-white px-3 py-2"><div class="text-gray-500">Registrations</div><div class="mt-1 font-semibold text-gray-900">@FormatNumber(item.DangKy)</div></div>
|
|
|
+ <div class="rounded-2xl bg-white px-3 py-2"><div class="text-gray-500">Cancellations</div><div class="mt-1 font-semibold text-gray-900">@FormatNumber(item.Huy)</div></div>
|
|
|
+ <div class="rounded-2xl bg-white px-3 py-2"><div class="text-gray-500">Revenue</div><div class="mt-1 font-semibold text-gray-900">@FormatNumber(item.DoanhThu)</div></div>
|
|
|
+ <div class="col-span-2 rounded-2xl bg-white px-3 py-2"><div class="text-gray-500">Bonus</div><div class="mt-1 font-semibold text-gray-900">@FormatNumber(item.CongTien)</div></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- }
|
|
|
+ }
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="hidden overflow-x-auto md:block">
|
|
|
- <table class="min-w-full divide-y divide-gray-100">
|
|
|
- <thead class="bg-gray-50">
|
|
|
- <tr class="text-left text-xs font-bold uppercase tracking-[0.14em] text-gray-500">
|
|
|
- <th class="px-5 py-4">Date</th>
|
|
|
- <th class="px-5 py-4 text-right">Total subscribers</th>
|
|
|
- <th class="px-5 py-4 text-right">Registered</th>
|
|
|
- <th class="px-5 py-4 text-right">Cancelled</th>
|
|
|
- <th class="px-5 py-4 text-right">Revenue</th>
|
|
|
- <th class="px-5 py-4 text-right">Bonus</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody class="divide-y divide-gray-100 bg-white text-sm text-gray-700">
|
|
|
- @foreach (var item in Model.Items)
|
|
|
- {
|
|
|
- <tr>
|
|
|
- <td class="whitespace-nowrap px-5 py-4 font-semibold text-gray-900">@item.Date.ToString("dd/MM/yyyy")</td>
|
|
|
- <td class="whitespace-nowrap px-5 py-4 text-right">@FormatNumber(item.TotalSubscribers)</td>
|
|
|
- <td class="whitespace-nowrap px-5 py-4 text-right">@FormatNumber(item.Registered)</td>
|
|
|
- <td class="whitespace-nowrap px-5 py-4 text-right">@FormatNumber(item.Cancelled)</td>
|
|
|
- <td class="whitespace-nowrap px-5 py-4 text-right font-semibold text-gray-900">@FormatNumber(item.Revenue)</td>
|
|
|
- <td class="whitespace-nowrap px-5 py-4 text-right">@FormatNumber(item.Bonus)</td>
|
|
|
- </tr>
|
|
|
- }
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
+ <div class="hidden px-5 py-6 sm:block sm:px-6">
|
|
|
+ <div class="overflow-hidden rounded-3xl border border-gray-100">
|
|
|
+ <div class="overflow-x-auto">
|
|
|
+ <table class="min-w-full divide-y divide-gray-100">
|
|
|
+ <thead class="bg-gray-50">
|
|
|
+ <tr class="text-left text-xs font-bold uppercase tracking-[0.14em] text-gray-500">
|
|
|
+ <th class="px-4 py-3">Date</th>
|
|
|
+ <th class="px-4 py-3">Total subscriptions</th>
|
|
|
+ <th class="px-4 py-3">Registrations</th>
|
|
|
+ <th class="px-4 py-3">Cancellations</th>
|
|
|
+ <th class="px-4 py-3">Revenue</th>
|
|
|
+ <th class="px-4 py-3">Bonus</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody class="divide-y divide-gray-100 bg-white text-sm text-gray-700">
|
|
|
+ @foreach (var item in Model.Items)
|
|
|
+ {
|
|
|
+ <tr>
|
|
|
+ <td class="whitespace-nowrap px-4 py-4 font-semibold text-gray-900">@item.Ngay.ToString("dd/MM/yyyy")</td>
|
|
|
+ <td class="whitespace-nowrap px-4 py-4">@FormatNumber(item.TongSub)</td>
|
|
|
+ <td class="whitespace-nowrap px-4 py-4">@FormatNumber(item.DangKy)</td>
|
|
|
+ <td class="whitespace-nowrap px-4 py-4">@FormatNumber(item.Huy)</td>
|
|
|
+ <td class="whitespace-nowrap px-4 py-4 font-semibold text-gray-900">@FormatNumber(item.DoanhThu)</td>
|
|
|
+ <td class="whitespace-nowrap px-4 py-4">@FormatNumber(item.CongTien)</td>
|
|
|
+ </tr>
|
|
|
+ }
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
}
|
|
|
</div>
|