Skip to content
Snippets Groups Projects
Commit 0c019563 authored by Rajesh, Anisha (PG/T - Comp Sci & Elec Eng)'s avatar Rajesh, Anisha (PG/T - Comp Sci & Elec Eng)
Browse files

routing for homepage, about-us, sports page

parent 584c3aa7
No related branches found
No related tags found
2 merge requests!2Pushing the final code to main after testing in QA.,!1Merging the the code to QA for testing
<<<<<<< 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment