def check_rates(self): with self._cursor() as cursor: cursor.execute("select `room type`, `beds`, `AC`, `rate`\ from `rates` order by `room type`;") data = cursor.fetchall() rows = cursor.rowcount if (rows == 0) or (len(data) == 0): print("No rates available. Please contact the Hotel Manager.") else: data = [("Room type", "Beds", "AC", "Rate per day")] + data util.print_table(data)
def show_room_types(self): with self._cursor() as cursor: cursor.execute("select `room type`, `beds`, `AC`, `rate`\ from `rates` order by `room type`;") rows = cursor.rowcount data = cursor.fetchall() if (rows == 0) or (len(data) == 0): print("No room type has been added till now.") else: data = [("Room type", "Beds", "AC", "Rate per day")] + data util.print_table(data)
def show_rooms(self): with self._cursor() as cursor: cursor.execute("select `room number`, `room type`, `occupied` \ from `rooms` order by `room number`;") rows = cursor.rowcount data = cursor.fetchall() if (rows == 0) or (len(data) == 0): print("No room has been added till now.") else: data = [("Room no.", "Room type", "Occupied")] + data util.print_table(data)
def check_rooms(self): with self._cursor() as cursor: cursor.execute("select `room number`, `room type` from `rooms` \ where `occupied` = 0 order by `room number`;") rows = cursor.rowcount data = cursor.fetchall() if (rows == 0) or (len(data) == 0): print( "No empty rooms available right now. Please check again later." ) else: data = [("Room no.", "Room type")] + data util.print_table(data)
def check_both(self): with self._cursor() as cursor: cursor.execute("select `room number`, `beds`, `AC`, `rate` \ from `rooms`, `rates` where `occupied` = 0 and \ `rooms`.`room type` = `rates`.`room type` \ order by `room number`;") data = cursor.fetchall() rows = cursor.rowcount if (rows == 0) or (len(data) == 0): print( "No empty rooms available right now. Please check again later." ) else: data = [("Room no.", "Beds", "AC", "Rate per day")] + data util.print_table(data)