title = "Dashboard"
url = "/dashboard"
layout = "Dashboard"
is_hidden = 0
[session]
security = "user"
allowedUserGroups[] = "admin"
allowedUserGroups[] = "supplier"
redirect = "dashboard/login"
==
vendor;
$thirtyDaysAgo = now()->subDays(30)->toDateString();
$this['bookings'] = Bookings::orderBy('invoice_date', 'desc')->where('status_payment', 'paid')->where('vendor_id', $user->vendor)->take(10)->get();
$this['countries'] = Bookings::selectRaw('country, SUM(total_price) as revenue')
->where('vendor_id', $user->vendor)
->where('status_payment', 'paid')
->where('invoice_date', '>=', $thirtyDaysAgo)
->groupBy('country')
->orderBy('revenue', 'desc')
->take(5)
->get();
$this['bestselling'] = Bookings::selectRaw('ticket_id, SUM(person) as amount, SUM(total_price) as revenue')
->where('vendor_id', $user->vendor)
->where('status_payment', 'paid')
->groupBy('ticket_id')
->orderBy('revenue', 'desc')
->take(5)
->get();
}
$this['booking'] = Bookings::make();
}
?>
==
{{booking.revenueThirtyDays(vendor)}} IDR
{{booking.revenueToday(vendor)}} IDR
{{booking.saleThirtyDays(vendor)}} Tickets
| No. Invoice |
Booking Date |
Name |
Arrival Date |
Amount |
Status Payment |
|
{% for booking in bookings %}
| {{ booking.no_invoice }} |
{{ booking.invoice_date }} |
{{ booking.firstname }} |
{{ booking.arrival_date }} |
IDR {{ booking.priceFormat(booking.total_price) }} |
{% if booking.status_payment == 'pending' %}
pending
{% elseif booking.status_payment == 'paid' %}
paid
{% elseif booking.status_payment == 'expired' %}
expired
{% endif %}
|
{% if booking.voucher_link != null and booking.status_payment == 'paid' %}
view
{% endif %}
|
{% endfor %}
| Ticket |
Amount |
Total Revenue |
{% for key, ticket in bestselling %}
| {{ ticket.ticketName(ticket.ticket_id) }} |
{{ ticket.amount }} |
IDR {{ ticket.priceFormat(ticket.revenue) }} |
{% endfor %}
{% put scripts %}
{# donut chart #}
{% endput %}