Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<<<<<<< HEAD
from flask import Flask, render_template, jsonify , redirect
import pymysql
import os
app = Flask(__name__)
# MySQL Configuration
#DB_HOST = os.environ.get('DB_HOST')
#DB_USER = os.environ.get('DB_USER')
#DB_PASS = os.environ.get('DB_PASS')
#DB_NAME = os.environ.get('DB_NAME')
#JWT_SECRET = os.environ.get('JWT_SECRET')
#PORT = os.environ.get('PORT', 3000)
#def query_database(query):
# conn = pymysql.connect(host=DB_HOST, user=DB_USER, password=DB_PASS, database=DB_NAME)
# cursor = conn.cursor(pymysql.cursors.DictCursor)
# cursor.execute(query)
# results = cursor.fetchall()
# cursor.close()
# conn.close()
# return results
# Route for the home page
#@app.route('/home')
#def home():
# current_query = "SELECT * FROM bookings WHERE date >= CURDATE()"
# past_query = "SELECT * FROM bookings WHERE date < CURDATE()"
# current_bookings = query_database(current_query)
# past_bookings = query_database(past_query)
# return render_template('home.html', current_bookings=current_bookings, past_bookings=past_bookings)
# Route for the home page
@app.route('/')
def home():
return render_template('index.html')
# Route for the about-us page
@app.route('/about-us')
def about_us():
return render_template('about-us.html')
# Route for the sports page
@app.route('/sports')
def sports():
return render_template('sports.html')
# Route for the football page
@app.route('/football')
def football():
return render_template('football.html')
# Route for the badminton page
@app.route('/badminton')
def badminton():
return render_template('badminton.html')
# Route for the cricket page
@app.route('/cricket')
def cricket():
return render_template('cricket.html')
# Route for the my-bookings page
#@app.route('/booking')
#def booking():
# return redirect('/<bookingurl>')
if __name__ == '__main__':
app.run(debug=True)
=======
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/confirmation/<int:booking_id>')
def confirmation(booking_id):
# In a real app, you'd fetch these details from a database based on the booking_id
booking_details = {
'activity': 'Tennis Court Rental',
'date': 'April 22, 2024',
'time': '10:00 AM to 12:00 PM',
'location': 'Surrey Central Sports Complex, Court #5',
'name': 'John Doe',
'total_cost': '$30.00',
'payment_status': 'Paid'
}
return render_template('confirmation.html', details=booking_details)
if __name__ == '__main__':
app.run(debug=True)
>>>>>>> ae8fb441f991aaba278d5c04cae37b5caef3c7dd