Skip to content
Snippets Groups Projects
Commit c168b56a authored by Pawar, Ajinkya (PG/T - Comp Sci & Elec Eng)'s avatar Pawar, Ajinkya (PG/T - Comp Sci & Elec Eng)
Browse files

Test commit

parent 594d2519
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
body, heading, list {
margin: 0; /* remove default margin */
padding: 0; /* remove default padding */
overflow-x: hidden; /* prevents scrolling - horizaontal */
box-sizing: border-box;
}
*, *::before, *::after { /*insert content before, after content of element */
box-sizing: inherit; /* gets element size from main element*/
}
banner {
background-color:#096981;
color: #fff;
padding: 10px 20px;
text-align: center;
width: 100%;
font-family: 'Arial', sans-serif;
box-shadow: 0 4px 6px rgba(253, 253, 253, 0.1);
border-bottom: 4px solid #023834;
display: flex;
align-items: center;
}
#bannerLogo {
height: auto;
width: 200px;
object-fit: contain;
margin-right: 20px;
}
nav {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
padding: 0;
margin-top: 45px;
}
nav a {
margin: 0 30px;
color: #f6f5f5;
text-decoration: none;
font-size: 18px;
padding: 0px 15px;
border-radius: 5px;
transition: background-color 0,3s ease;
}
nav a:hover{
background-color: rgba(16, 15, 15, 0.2);
text-decoration: none;
}
main {
font-family: 'Arial', sans-serif;
padding: 10px;
max-width: 800px;
margin: 20px auto;
text-align: center;
}
main h2 {
color: #096981;
margin: 0;
padding: 10px 0;
}
.table-wrapper {
margin: 25px 0px auto auto;
border-collapse: collapse;
font-family: sans-serif;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
overflow-x: auto;
}
.table-wrapper table {
width: 100%;
border-collapse: collapse;
}
.table-wrapper th, .table-wrapper td {
padding: 12px 15px;
text-align: left;
}
.table-wrapper thead tr {
background-color: #096981;
color: #ffffff;
}
footer {
background-color: #096981; /* Similar to header */
color: #fff; /* The text color */
padding: 10px 20px; /* Same as that of the header for similarity */
text-align: center; /* Center text */
font-family: 'Arial', sans-serif; /* Similar font */
border-top: 4px solid #023834; /* Border head same as header border */
width: 100%; /* Complete width */
position: fixed; /* Fixed at the bottom */
bottom: 0; /* Align to bottom */
left: 0; /* Align to left */
box-shadow: 0 -4px 6px rgba(253, 253, 253, 0.1); /* Shadow effect */
}
main a, main a:visited {
color: #0b0b0b;
text-decoration: none;
}
.user-details {
background-color: #ffffff;
color: #023834;
margin: 0px;
padding: 10px 0;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
max-width: 1000px;
}
.user-details p {
font-size: 16px;
margin-bottom: 10px;
line-height: 1.5;
}
.user-details table {
width: 100%; /* full width */
border-collapse: collapse; /* Removes the spaces between borders */
margin-top: 20px; /* Adds some space on top of the table */
}
.user-details th, .user-details td {
text-align: left; /* text to the left */
padding: 8px; /* Adds padding for space */
border-bottom: 1px solid #ddd; /* Adds a border below to every cell */
}
.user-details th {
background-color: #096981; /* header background colour */
color: white; /* text colour */
font-weight: normal; /* Normal font */
}
.user-details tr:hover {
background-color: #f5f5f5; /* hover effect */
=======
/* styles.css */
body {
font-family: Arial, sans-serif;
background-color: #f7f7f7;
}
.site-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 20px;
background-color: #323f48;
color: white;
}
.site-header .logo {
height: 50px; /* Adjust size as needed */
}
nav a {
text-decoration: none;
color: white;
padding: 0 15px;
}
nav a:hover {
text-decoration: underline;
}
@media (max-width: 600px) {
.site-header {
flex-direction: column;
}
.site-header .logo {
margin-bottom: 10px;
}
nav a {
display: block;
text-align: center;
}
}
#confirmation {
max-width: 600px;
margin: 2em auto;
padding: 2em;
background-color: white;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
color: #333;
text-align: center;
}
p {
font-size: 1em;
line-height: 1.5;
color: #666;
}
strong {
color: #333;
>>>>>>> 0c0195639191e2624ce3f84a0b434578d8d91fa6
}
<!DOCTYPE html>
<html lang="en">
<<<<<<< HEAD
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/static/styles.css">
<title>Student List</title>
</head>
<body>
<banner>
<img src="/static/logo.png" alt="Logo" id="bannerLogo">
<nav>
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Sports</a>
<a href="#">Booking</a>
<a href="#">Membership</a>
</nav>
</banner>
<main>
<h2>List of Students</h2>
<div class="table-wrapper">
<table border="1" style="width: 100%;">
<thead>
<tr>
<th>ID</th>
<th>USERNAME</th>
<th>STUDENT ID</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user.id }}</td>
<td><a href="/user/{{ user.id }}">{{ user.username }}</td>
<td>{{ user.student_id }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</main>
<footer>
© 2024 Surrey Sports Park. All rights reserved.
</footer>
</body>
</html>
=======
<head>
<meta charset="UTF-8">
<title>Surrey Sports Park</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous" />
<link rel="stylesheet" href="../static/style.css" />
</head>
<body>
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid" style="margin-top: -2px;">
<a class="navbar-logo" href="#"></a>
<img src="../static/logo.png" alt="Surrey Sports Park logo" height="50" />
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="navigation-bar">
<a class="nav-link active" href="http://127.0.0.1:5000/" style="color: white">Home</a>
</li>
<li class="navigation-bar">
<a class="nav-link" aria-current="page" href="http://127.0.0.1:5000/about-us"
>About</a>
</li>
<li class="navigation-bar">
<a class="nav-link" href="http://127.0.0.1:5000/sports">Sports</a>
</li>
<li class="navigation-bar">
<a class="nav-link" href="#">Booking</a>
</li>
<li class="navigation-bar">
<a class="nav-link" href="#">Membership</a>
</li>
<div class="dropdown text-end" style="
position: relative;
top: 25px;
padding-right: 0px;
padding-left: 0px;
margin-left: 0px;
left: 100%;
right: 50px;
">
<a href="#" class="d-block link-body-emphasis text-decoration-none dropdown-toggle"
data-bs-toggle="dropdown" aria-expanded="false">
<img src="../static/box-arrow-left.svg" alt="logout icon" />
</a>
<ul class="dropdown-menu text-small">
<li><a class="dropdown-item" href="#">Profile</a></li>
<li>
<hr class="dropdown-divider" />
</li>
<li><a class="dropdown-item" href="#">Sign out</a></li>
</ul>
</div>
</ul>
</div>
</div>
</nav>
<div id="Autoplaying-slides" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
<h1>Welcome To Surrey Sports Park</h1>
<div class="carousel-item active">
<img src="../static/surrey-sports-park-pitches-media.jpg" class="d-block w-100" alt="image of pitches"
height="400px">
</div>
<div class="carousel-item">
<img src="../static/indoor-surrey-sports-park.jpg" class="d-block w-100" alt="indoor surrey sports park"
height="400px">
</div>
<div class="carousel-item">
<img src="../static/swimming.png" class="d-block w-100" alt="Surrey sports park swimming"
height="400px">
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#Autoplaying-slides" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#Autoplaying-slides" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
<div style="background-color: #096981; padding: 20px; margin-top: 10px; font-weight: 300; color: aliceblue; font-family:'Times New Roman', Times, serif">
<p style="text-align: center;">
Sports at Surrey Sports Park fosters community engagement, promotes physical well-being, cultivates athletic excellence, and provides a vibrant hub for recreational activities, enhancing overall health and quality of life.
Join us at Surrey Sports Park to experience the joy of sports, foster community connections, prioritize health, and pursue excellence in a vibrant, inclusive environment. Embrace the benefits of an active lifestyle with us!
</p>
</div>
<!--
<div class="container mt-5">
<div class="row">
<div class="col">
<h1>Current Bookings</h1>
<div id="current-bookings">
Render current bookings here
{% for booking in current_bookings %}
<div class="booking-item">
<h3>{{ booking.sport }} - {{ booking.date }}</h3>
<p>Time: {{ booking.time }}</p>
<p>Status: {{ booking.status }}</p>
</div>
{% endfor %}
</div>
</div>
<div class="col">
<h1>Past Bookings</h1>
<div id="past-bookings">
Render past bookings here
{% for booking in past_bookings %}
<div class="booking-item">
<h3>{{ booking.sport }} - {{ booking.date }}</h3>
<p>Time: {{ booking.time }}</p>
<p>Status: {{ booking.status }}</p>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
-->
<div class="Sports-options" style="position: absolute; margin-top: 60px; left:100px">
<div class="container">
<div class="row">
<div class="col-lg-4">
<div class="card mb-4 box-shadow">
<a href="http://127.0.0.1:5000/football"> <img class="card-img-top" alt="Football Thumbnail"
style="height: 225px; width: 100%; display: block;" src="../static/football.png"
data-holder-rendered="true"> </a>
<div class="card-body">
<h3>Football</h3>
<p class="card-text" style="padding: 10px;"> Description: Football, a sport played by two
teams of eleven players, aims to score goals by getting the ball into the opposing
team's net using feet, head, or torso. <br /> Pitches: 2 <br /> Location: UK </p>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card mb-4 box-shadow">
<a href="http://127.0.0.1:5000/badminton"> <img class="card-img-top" alt="Badminton Thumbnail"
style="height: 225px; width: 100%; display: block;" src="../static/batminton-thumbnail.png"
data-holder-rendered="true"> </a>
<div class="card-body">
<h3>Badminton</h3>
<p class="card-text" style="padding: 10px;"> Description: Badminton, played on a court,
involves hitting a shuttlecock over a net. Players aim to score points by landing the
shuttlecock within the opponent's court. <br /> Pitches: 5 <br /> Location: UK </p>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card mb-4 box-shadow">
<a href="http://127.0.0.1:5000/cricket"> <img class="card-img-top" alt="Cricket Thumbnail"
style="height: 225px; width: 100%; display: block;" src="../static/cricket.png"
data-holder-rendered="true"> </a>
<div class="card-body">
<h3>Cricket</h3>
<p class="card-text" style="padding: 10px;"> Description: Cricket, a team sport played with
a bat and ball, involves scoring runs and taking wickets. Two teams of eleven players
compete, aiming to score more runs than their opponents.<br /> Pitches: 2 <br />
Location: UK </p>
</div>
</div>
</div>
</div>
</div>
<div class="container" id="Contact-Us">
<div class="row">
<hr />
<div class="col-lg col-md col-sm">
<div>
<h5>
Surrey Sports Park
<address>
University of Surrey, Richard Meyjes Road, Guildford Surrey, GU2
7AD Tel. 01483 689111
</address>
</h5>
</div>
</div>
<div class="col-lg col-md col-sm">
<h5>Mail us</h5>
<div>
<img src="../static/envelope-at-fill.svg" alt="Mail-icon" />
<p>info@surreysportspark.co.uk</p>
</div>
</div>
<div class="col-lg col-md col-sm" id="Follow">
<h5>Follow us</h5>
<div>
<img src="../static/facebook.svg" alt="Facebook-icon" />
<a href="https://www.facebook.com/surreysportspark">Facebook</a>
</div>
<div>
<img src="../static/twitter.svg" alt="Twitter-icon" /><a
href="https://twitter.com/Surreysportpark">Twitter</a>
</div>
<div>
<img src="../static/instagram.svg" alt="Instagram-icon" /><a
href="https://www.instagram.com/surreysportpark/">Instagram</a>
</div>
<div>
<img src="../static/youtube.svg" alt="Youtube-icon" /><a
href="https://www.youtube.com/user/SurreySportsPark">YouTube</a>
</div>
</div>
</div>
<hr />
<div id="footer">
<footer>
<p style="text-align: center;">© 2024 Company, Inc. All rights reserved.</p>
</footer>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>
>>>>>>> 0c0195639191e2624ce3f84a0b434578d8d91fa6
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///users.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
app.app_context().push()
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(50), nullable=False)
phone = db.Column(db.String(20), nullable=False)
email = db.Column(db.String(100), nullable=False)
student_id = db.Column(db.String(50), nullable=False)
password = db.Column(db.String(100), nullable=False)
gender = db.Column(db.String(10), nullable=False)
address = db.Column(db.String(200), nullable=False)
@app.route('/')
def index():
users = User.query.all()
return render_template('index.html', users=users)
@app.route('/user/<int:user_id>')
def user_detail(user_id):
# Query for the specific user by ID
user = User.query.get_or_404(user_id) # This returns the user or a 404 error if not found
return render_template('user_details.html', user=user)
if __name__ == '__main__':
app.run(debug=True)
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