@extends('layouts.app') @section('content')
TODAY BOOKING
{{$today_booking}}
TOTAL AMOUNT
{{$total_booking_amount}}
TOTAL CUSTOMER
{{$total_customer}}
TOTAL CHECKIN
{{$total_booking}}
@foreach($rooms as $room) @php $assign = App\Models\RoomAssign::find($room->id); $back_class = '#478778'; $size = 'color:white;font-weight:bold;text-align:center;'; $title = 'Avaialable'; if($assign->status == 1) { $back_class = '#3b82f6 var(--tw-gradient-from-position)'; $title = 'Booked'; } if($assign->status == 2) { $back_class = '#22d3ee var(--tw-gradient-to-position)'; $title = 'Checkin'; } if($assign->status == 3) { $back_class = 'black'; $title = 'Blocked'; } @endphp
status == 2) onclick='window.open("{{action('CheckoutController@index')}}", "_blank");' @elseif($assign->status == 0 || $assign->status == 1 ) onclick='window.open("{{action('CheckinController@create', ['room_no' => $room->room_id, 'room_type' => $room->room_type])}}", "_blank");'@endif class="col-sm-1" title="{{$title}}" style="{{$size}}border-style: solid;border-width: thin;background:{{$back_class}}">{{$room->room_id}}
@endforeach

Today Checkouts

Booking No Rooms Name Check Out Type
@php $dt = request()->get('start_date') ? strtotime(request()->get('start_date')) : strtotime(date("Y-m-d")); $end_time = request()->get('end_date') ? strtotime(request()->get('end_date')) : strtotime("+1 week", $dt); @endphp @for($i=$dt; $i<$end_time; $i+=86400) @endfor @foreach($rooms as $room) @for($i=$dt; $i<$end_time; $i+=86400) @php $room_booked = App\Models\BookingRoom::join('transactions', 'booking_rooms.transaction_id', '=', 'transactions.id') ->join('room_assigns', 'room_assigns.room_id', '=', 'booking_rooms.room_no') ->where('booking_rooms.room_no', $room->room_id) ->whereIn('room_assigns.status', [1,2]) ->whereIn('transactions.type', ['checkin','booking']) ->where('transactions.status', '!=', 'canceled') ->select( 'booking_rooms.id', 'booking_rooms.transaction_id', 'booking_rooms.check_in_at', 'booking_rooms.check_out_at', 'transactions.type', ) ->first(); @endphp @if(isset($room_booked) && date('Y-m-d', strtotime($room_booked->check_in_at)) <= date("Y-m-d", $i) && date('Y-m-d', strtotime($room_booked->check_out_at)) >= date("Y-m-d", $i)) @if($room_booked->type == 'booking') @elseif($room_booked->type == 'checkin') @endif @else @if($room->status == 3) @else @endif @endif @endfor @endforeach
Rooms{{date("Y-m-d", $i)}}
{{$room->room_id}}   
  
Total Booking History

Rooms

@foreach($types as $type) @php $total = App\Models\RoomAssign::where('room_type', $type->name)->count(); $total_checkin = App\Models\RoomAssign::where('room_type', $type->name)->where('status', 2)->count(); $total_booked = App\Models\RoomAssign::where('room_type', $type->name)->where('status', 1)->count(); $total_avaialbe = App\Models\RoomAssign::where('room_type', $type->name)->where('status', 0)->count(); @endphp @endforeach
Type Available Booked Checkin Total
{{$type->name}} {{ $total_avaialbe }} {{ $total_booked }} {{ $total_checkin }} {{ $total }}

Customer Due

Customer Due
@endsection @section('javascript') @endsection