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(); } ?> ==
Last 30 Days Revenue

{{booking.revenueThirtyDays(vendor)}} IDR

Today's Revenue

{{booking.revenueToday(vendor)}} IDR

Last 30 Days Tickets Sold

{{booking.saleThirtyDays(vendor)}} Tickets

Recent Bookings
{% for booking in bookings %} {% endfor %}
No. Invoice Booking Date Name Arrival Date Amount Status Payment
{{ 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 %}
Last 30 Days Revenue by Country
Best-Selling Tickets in the Last 30 Days
{% for key, ticket in bestselling %} {% endfor %}
Ticket Amount Total Revenue
{{ ticket.ticketName(ticket.ticket_id) }} {{ ticket.amount }} IDR {{ ticket.priceFormat(ticket.revenue) }}
Lead Time Bookings
{% put scripts %} {# donut chart #} {% endput %}