def edit_reservation(id): reservation = reservation_repository.select(id) guests = guest_repository.select_all() rooms = room_repository.select_all() today = datetime.date.today() stay_length = reservation_repository.stay_length(id) return render_template('reservations/edit.html', reservation=reservation, guests=guests, rooms=rooms, today=today, stay_length=stay_length)
def new_schedule(): instructors = details_repository.select_all() classes = gym_class_repository.select_all() rooms = room_repository.select_all() return render_template('schedule/new.html', instructors=instructors, classes=classes, rooms=rooms)
def schedules(): rooms = room_repository.select_all() schedules = schedule_repository.select_dates() schedules_dict = {} dates = [date.today() + timedelta(days=i) for i in range(7)] days = [calendar.day_name[dates[i].weekday()] for i in range(7)] for i in range(7): if schedules[i] is not None: schedules_dict['today_schedules_' + str(i)] = schedules[i] else: schedules_dict['today_schedules_' + str(i)] = None return render_template('schedule/index.html', schedules=schedules, dates=dates, days=days, schedules_dict=schedules_dict, rooms=rooms)
def rooms(): rooms = room_repository.select_all() reservation_repository.arrival_status() return render_template('rooms/room.html', rooms=rooms)
def search_name(): search_name = request.form['search'] reservation = reservation_repository.search(search_name.title()) guests = guest_repository.select_all() rooms = room_repository.select_all() return render_template('reservations/edit.html', reservation=reservation, guests=guests, rooms=rooms)
def rooms(): rooms = room_repository.select_all() return render_template('rooms/index.html', rooms=rooms)
def expected_occupancy(): total_rooms = len(room_repository.select_all()) - 1 inh = total_inh_rooms() expected_occupancy = ((inh - total_departures() + total_arrivals()) / total_rooms) * 100 return round(expected_occupancy, 1)
def current_occupancy(): total_rooms = len(room_repository.select_all()) - 1 inh = total_inh_rooms() current_occupancy = (inh/ total_rooms) * 100 return round(current_occupancy, 1)