Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
surrey-sports-park
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rajesh, Anisha (PG/T - Comp Sci & Elec Eng)
surrey-sports-park
Commits
0c019563
Commit
0c019563
authored
10 months ago
by
Rajesh, Anisha (PG/T - Comp Sci & Elec Eng)
Browse files
Options
Downloads
Patches
Plain Diff
routing for homepage, about-us, sports page
parent
584c3aa7
No related branches found
Branches containing commit
No related tags found
2 merge requests
!2
Pushing the final code to main after testing in QA.
,
!1
Merging the the code to QA for testing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
homeapp.py
+96
-0
96 additions, 0 deletions
homeapp.py
with
96 additions
and
0 deletions
homeapp.py
0 → 100644
+
96
−
0
View file @
0c019563
<<<<<<<
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment