Skip to content
Snippets Groups Projects
Commit 66a06171 authored by Arianne Bayliss's avatar Arianne Bayliss
Browse files

Merge branch '7-as-a-user-i-want-to-see-all-of-the-working-spaces-available-2'...

Merge branch '7-as-a-user-i-want-to-see-all-of-the-working-spaces-available-2' into '7-as-a-user-i-want-to-see-all-of-the-working-spaces-available'

Update static/testSearch.html, templates/OurSpaces.html, templates/Space.html,...

See merge request !25
parents fffdce15 f6031055
No related branches found
No related tags found
2 merge requests!47Update static/testSearch.html, templates/OurSpaces.html, templates/Space.html,...,!25Update static/testSearch.html, templates/OurSpaces.html, templates/Space.html,...
DELETE FROM 'coworking_spaces' WHERE Name = 'Name';
db.db 0 → 100644
File added
<?xml version="1.0" encoding="UTF-8"?><sqlb_project><db path="C:/Users/c21070842/OneDrive - Cardiff University/Desktop/tramshed-tech-client-project-team-15/db.db" readonly="0" foreign_keys="1" case_sensitive_like="0" temp_store="0" wal_autocheckpoint="1000" synchronous="2"/><attached/><window><main_tabs open="structure browser pragmas query" current="1"/></window><tab_structure><column_width id="0" width="300"/><column_width id="1" width="0"/><column_width id="2" width="150"/><column_width id="3" width="2218"/><column_width id="4" width="0"/><expanded_item id="0" parent="1"/><expanded_item id="1" parent="1"/><expanded_item id="2" parent="1"/><expanded_item id="3" parent="1"/></tab_structure><tab_browse><current_table name="4,16:maincoworking_spaces"/><default_encoding codec=""/><browse_table_settings><table schema="main" name="coworking_spaces" show_row_id="0" encoding="" plot_x_axis="" unlock_view_pk="_rowid_"><sort/><column_widths><column index="1" value="139"/><column index="2" value="300"/><column index="3" value="300"/><column index="4" value="300"/><column index="5" value="300"/><column index="6" value="299"/><column index="7" value="265"/><column index="8" value="199"/><column index="9" value="169"/><column index="10" value="300"/></column_widths><filter_values/><conditional_formats/><row_id_formats/><display_formats/><hidden_columns/><plot_y_axes/><global_filter/></table></browse_table_settings></tab_browse><tab_sql><sql name="SQL 1">DELETE FROM coworking_spaces WHERE Name = 'Name';
</sql><current_tab id="0"/></tab_sql></sqlb_project>
main.py 0 → 100644
from flask import Flask, request, render_template, redirect
import sqlite3
DATABASE = "db.db"
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
app = Flask(__name__)
@app.route("/Load/CodeBase", methods = ['GET','POST'])
def Load():
if request.method =='GET':
return render_template('Space.html')
if request.method =='POST':
try:
Name = "CodeBase";
conn = sqlite3.connect(DATABASE)
cur = conn.cursor()
document.getElementById("name").innerHTML= Name;
cur.execute("SELECT Address FROM coworking_spaces WHERE Name =? ;", [Name])
Address = cur.fetch();
cur.execute("SELECT Main_Photo FROM coworking_spaces WHERE Name =? ;", [Name])
Main_Photo = cur.fetch();
cur.execute("SELECT Additional_photos FROM coworking_spaces WHERE Name =? ;", [Name])
Additional_photos = cur.fetch();
cur.execute("SELECT Description FROM coworking_spaces WHERE Name =? ;", [Name])
Description = cur.fetch();
cur.execute("SELECT Website FROM coworking_spaces WHERE Name =? ;", [Name])
Website = cur.fetch();
cur.execute("SELECT Opening_Hours FROM coworking_spaces WHERE Name =? ;", [Name])
Opening_Hours = cur.fetch();
except:
print('error', data)
conn.close()
finally:
conn.close()
return str(data)
if __name__ == "__main__":
app.run(debug=True)
<head>
<link rel="stylesheet" href="framework.css">
</head>
<body class="body">
<header>
<li><a href="/Load/CodeBase">view CodeBase</a></li>
</head
<head>
<link rel="stylesheet" href="framework.css">
</head>
<body class="body">
<header>
{% block titleBlock%}
<h1> the working space name</h1>
<img src="header.png"/>
{%endblock%}
</header>
<div class="Address box">
{% block addressBlock%}
<h2>Address info</h2>
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d4957.954181608377!2d-2.999839445369478!3d51.58698324808131!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4871e6cc3bd82553%3A0x684c1227f14b4a15!2sNational%20Software%20Academy%20(Cardiff%20University)!5e0!3m2!1sen!2suk!4v1669722978098!5m2!1sen!2suk"
width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
{%endblock%}
</div>
<div class="Description box">
{% block descriptionBlock%}
<h2>About us</h2>
<h3>description</h3>
{%endblock%}
</div>
<div class="Image box">
<img scr= {% block imageBlock%} {%endblock%}>
</div>
<div class="AddImage box">
<img scr="{% block addimageBlock%} {%endblock%}">
</div>
<div class="times box">
<h2>{% block timeBlock%} times {%endblock%}</h2>
</div>
</body>
{%extends 'OurSpaces.html'%}
<form id='myForm' action='/Load/CodeBase>' method ='post'>
{% block titleBlock%}
<p id="name"></p>
<img src= Main_Photo ><br>"/>
<script>
document.getElementById("name").innerHTML = Name;
</script>
{%endblock%}
{% block addressBlock%}
<h2><input type = "text" name = "Name"><br></h2>
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d4957.954181608377!2d-2.999839445369478!3d51.58698324808131!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4871e6cc3bd82553%3A0x684c1227f14b4a15!2sNational%20Software%20Academy%20(Cardiff%20University)!5e0!3m2!1sen!2suk!4v1669722978098!5m2!1sen!2suk"
width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
{%endblock%}
{% block descriptionBlock%}
<h2>About us</h2>
<h3><input type = "text" name = "Description"><br></h3>
{%endblock%}
{% block imageBlock%}
"<input type = "text" name = "Main_Photos">"<br>
{%endblock%}
{% block addimageBlock%}
"<input type = "text" name = "Additional_photos">"<br>
{%endblock%}
{% block timeBlock%} <input type = "text" name = "Opening_Hours"> {%endblock%}
<span id='txt'></span>
</form>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment