@extends('layouts.admin.main') @section('main-section')

Dashboard

  • {{ dashboardCalculations(request()->propertyId)['total_amount'] - $completed_booking_expenses_by_type}} AED
    Total Profit
    {{ dashboardCalculations(request()->propertyId)['nights'] == 0 ? 0 : dashboardCalculations(request()->propertyId)['total_profit'] / dashboardCalculations(request()->propertyId)['nights'] }}
    Average Daily Rate
    {{ dashboardCalculations(request()->propertyId)['total_reservation'] }}
    Reservation
    {{ dashboardCalculations(request()->propertyId)['reservedDaysInCurrentMonth'] == 0 ? 0 : number_format((dashboardCalculations(request()->propertyId)['reservedDaysInCurrentMonth'] / dashboardCalculations(request()->propertyId)['totalDays']) * 100, 2) }}%
    Occupancy (Current Month)
    {{ dashboardCalculations(request()->propertyId)['nights'] }}
    Rented Nights
    {{ dashboardCalculations(request()->propertyId)['upcoming_property_rates'] }} AED
    Upcoming Rent

    • Available
    • Booked
    • Owner Stay
    {{--
    --}} {{-- calenders --}}
    @php // Get the current currentYear $request_year = request()->get('year'); $year = date($request_year ? $request_year : 'Y'); $current_month = date('m'); for($x = 0; $x < 9; $x++){ if($current_month == $x){ $current_month = $x; } } // dd($current_month); // Loop through each month $count = 1; for ($month = $request_year ? 1 : $current_month; $month <= 12; $month++) { //only get 3 months calendar // if($count > 3){ // continue; // } $count += 1; // Get the first day of the month $firstDay = mktime(0, 0, 0, $month, 1, $year); // Get the number of days in the month $daysInMonth = date('t', $firstDay); // Get the month name $monthName = date('F', $firstDay); // Create the calendar table echo '
    ' . $monthName . ' ' . $year . '
    '; echo '
    '; echo '
    Sun
    Mon
    Tus
    Wed
    Thus
    Fri
    Sat
    '; // Calculate the offset to start the first day of the month $offset = date('w', $firstDay); // Start the first row echo '
    '; // Print empty cells for the offset for ($i = 0; $i < $offset; $i++) { echo ''; } // Loop through each day of the month for ($day = 1; $day <= $daysInMonth; $day++) { // Check if it's the first day of the week if (($day + $offset - 1) % 7 == 0 && $day != 1) { // End the current row and start a new one echo '
    '; } $value = null; $d = null; $m = null; $y = $year; if($day <= 9){ $d = "0". $day; }else{ $d = $day; } if($month <= 9 && strlen($month)==1){ $m = "0". $month; }else{ $m = $month; } $value = $y ."-". $m ."-". $d; $propertyRate = collect($booking_property_rates)->where('date', $value)->first(); $bookingPropertyRate = collect($order_property_rate)->where("date","==", $value)->first(); //dd($bookingPropertyRate); //dd(gettype($value), $value); // Print the day echo ' '.(isset($bookingPropertyRate) && isset($bookingPropertyRate->booking) && $bookingPropertyRate->booking->owner_stay == 1 ? '
    ' : '').' '.(isset($bookingPropertyRate) && isset($bookingPropertyRate->booking) && $bookingPropertyRate->booking->tentative_booking == 1 ? '
    ' : '').' '. $day .'

    '; //'. $day .'

    '. (isset($propertyRate) ? "AED ".$propertyRate->rate_per_night : ' ') .'

    '; } // Print empty cells for the remaining days $remainingDays = 7 - (($daysInMonth + $offset) % 7); if ($remainingDays != 7) { for ($i = 0; $i < $remainingDays; $i++) { echo ''; } } // End the last row and the table echo '
    '; echo '
    '; } @endphp
    {{-- calenders --}}
    @endsection @push('scripts') @endpush