Skip to content
Snippets Groups Projects
Commit f38bc6dd authored by Beaumont Mogridge's avatar Beaumont Mogridge :gorilla:
Browse files

added connectivity to main project as well as page load for all working spaces...

added connectivity to main project as well as page load for all working spaces plus working additional photos in every webpage
parent e32b6fcb
No related branches found
No related tags found
1 merge request!64added connectivity to main project as well as page load for all working spaces...
...@@ -42,37 +42,26 @@ def returnListLocations(): ...@@ -42,37 +42,26 @@ def returnListLocations():
conn.close() conn.close()
return render_template("Locations.html", data = locationData) return render_template("Locations.html", data = locationData)
@app.route("/Load/CodeBase") @app.route("/Load/Page/<Name>")
def Load():
Name = "Codebase"; def Load(Name=None):
conn = sqlite3.connect(DATABASE)
cur = conn.cursor() conn = sqlite3.connect(DATABASE)
print(Name) cur = conn.cursor()
# getAddress(Name) print(Name)
cur.execute("SELECT * FROM 'coworking_spaces' WHERE Name =?;", [Name]) PageName = Name
data = cur.fetchall() cur.execute("SELECT Additional_photos FROM 'coworking_spaces' WHERE Name = ?;", [Name])
print(data) AddPhotos = cur.fetchall()
# cur.execute("SELECT Address FROM coworking_spaces WHERE Name =? ;", [Name]) ImageStr="".join(str(x) for x in AddPhotos)
# Address = cur.fetchall() ListImage = ImageStr.split(',')
# print(Address) FirstImage = ListImage[0]
# cur.execute("SELECT Main_Photo FROM coworking_spaces WHERE Name =? ;", [Name]) FirstImage = FirstImage[2::]
# Main_Photo = cur.fetchall() cur.execute("UPDATE 'coworking_spaces' SET Additional_photos= ? ",[FirstImage])
# print(Main_Photo) cur.execute("SELECT * FROM 'coworking_spaces' WHERE Name =?;", [Name])
# cur.execute("SELECT Additional_photos FROM coworking_spaces WHERE Name =? ;", [Name]) data = cur.fetchall()
# Additional_photos = cur.fetchall() print(data)
# print(Additional_photos) conn.close()
# cur.execute("SELECT Description FROM coworking_spaces WHERE Name =? ;", [Name]) return render_template('Space.html', data = data)
# Description = cur.fetchall()
# print(Description)
# cur.execute("SELECT Website FROM coworking_spaces WHERE Name =? ;", [Name])
# Website = cur.fetchall()
# print(Website)
# cur.execute("SELECT Opening_Hours FROM coworking_spaces WHERE Name =? ;", [Name])
# Opening_Hours = cur.fetchall()
# print(Opening_Hours)
conn.close()
return render_template('Space.html', data = data)
# pageAddress = Address, pageMain_Photo = Main_Photo, pageAdditional_photos = Additional_photos, pageDescription = Description, pageWebsite = Website, pageOpening_Hours = Opening_Hours )
@app.route("/SearchRecord", methods=['POST', 'GET']) @app.route("/SearchRecord", methods=['POST', 'GET'])
def searchRecord(): def searchRecord():
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<li> <li>
<div class="container"> <div class="container">
<img src= "{{data[x][1]}}" class="image" > <img src= "{{data[x][1]}}" class="image" >
<h2> {{data[x][0]}} </h2> <h2 onclick="window.location.href='/Load/Page/{{data[x][0]}}'"> {{data[x][0]}} </h2>
<p>hhhhhhhhhhhhhhhhhhhhhhhhhhh</p> <p>hhhhhhhhhhhhhhhhhhhhhhhhhhh</p>
<div class= star> <div class= star>
<span class="fa fa-star fa-3x checked" ></span> <span class="fa fa-star fa-3x checked" ></span>
......
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