diff --git a/.gitignore b/.gitignore index 5056a5f7dc6cec2702fe24271b02e674b76c7f82..70d303bcfab11137ed08b2532e3b82f478cc2109 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ Database Files *.db -Coworking_Spaces.db +*.db-journal diff --git a/Coworking_Functions.py b/Coworking_Functions.py deleted file mode 100644 index 0d170f2afee63de6e65e5244c28ea7bca7b3b309..0000000000000000000000000000000000000000 --- a/Coworking_Functions.py +++ /dev/null @@ -1,25 +0,0 @@ -from flask import request -from csv import writer - -def getCoworkingSpaces(): - - recordName = request.form['recordName'] - recordAddress = request.form['recordAddress'] - recordMainPhotos = request.form['recordMainPhotos'] - recordAdditionalPhotos = request.form['recordAdditionalPhotos'] - recordDescription = request.form['recordDescription'] - recordWebsite = request.form['recordWebsite'] - recordEmail = request.form['recordEmail'] - recordPhoneNumber = request.form['recordPhoneNumber'] - recordOpeningHours = request.form['recordOpeningHours'] - recordCheckinInstructions = request.form['recordCheckinInstructions'] - recordData = [recordName, recordAddress, recordMainPhotos, recordAdditionalPhotos, recordDescription, recordWebsite, recordEmail, recordPhoneNumber, recordOpeningHours, recordCheckinInstructions] - return recordData - -def addCoworkingSpaces(data): - - with open('coworking_spaces.csv', 'a') as addToFile: - csvWriter = writer(addToFile) - csvWriter.writerow(data) - addToFile.close() - return (f"{data} added.") diff --git a/project_db.sql b/project_db.sql index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..65d9b087e57eae411834ef03779849edf0270f18 100644 --- a/project_db.sql +++ b/project_db.sql @@ -0,0 +1,19 @@ +BEGIN TRANSACTION; +CREATE TABLE IF NOT EXISTS "coworking_spaces" ( + "Name" TEXT, + "Address" TEXT, + "Main_Photo" TEXT, + "Additional_Photos" TEXT, + "Description" TEXT, + "Website" TEXT, + "Email" TEXT, + "Phone_Number" TEXT, + "Opening_Hours" TEXT, + "Checkin_Instructions" TEXT +); +INSERT INTO "coworking_spaces" VALUES ('Codebase','CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL','https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w','https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w','Hi. We’re CodeBase. We''ve been exploring the world of startups and innovation for over five years now. We''re not really sure how to best describe what we do, but we think the words "tech cluster" probably do it best. Please get in touch! We’re friendly people who are geeky about building tech startups, managing disruption and innovation.','https://www.thisiscodebase.com','info@thisiscodebase.com','(+44) 0131 560 2003','08:00 - 17:00','Use the email address or phone number to call ahead and book a desk, let them know you''re a Tramshed member'); +INSERT INTO "coworking_spaces" VALUES ('Catalyst','Titanic Quarter, Queens Road, Belfast, BT3 9DT','https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg','https://wearecatalyst.org/wp-content/uploads/2022/03/DSC07673-scaled-2048x1570.jpg,https://wearecatalyst.org/wp-content/uploads/2021/01/2F6A1513.jpg','We are an independent, not-for-profit organisation working together for the greater good, enabling a connected community of like-minded innovators in an entrepreneurial eco-system that is the key driver of the knowledge economy in Northern Ireland.','https://wearecatalyst.org','enquiries@wearecatalyst.org','+44(0)28 9073 7800','08:00 - 18:00','Use the email address or phone number to call ahead and book a desk, let them know you''re a Tramshed member'); +INSERT INTO "coworking_spaces" VALUES ('C4DI','C4DI Campus, 31-38 Queen Street, Hull, HU1 1UU','https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w','https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1588346951023-V0QWKQI35IDUACMOJ0WM/_MKL2718.jpg?format=750w,https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1588346977833-LGY6P9473H2C5JF6I2UG/_K5M5505.jpg?format=750w','C4DI is an incubator that helps tech companies grow, and traditional businesses innovate.','http://www.c4di.co.uk','lc@c4di.net','+44 1482 304244','9am - 5pm','Use the email address or phone number to call ahead and book a desk, let them know you''re a Tramshed member'); +INSERT INTO "coworking_spaces" VALUES ('Dogpatch Labs','Custom House Quay, Dublin, D01 Y6H7','https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg','https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2021/07/bordered.jpg,https://dogpatchlabs.com/wp-content/uploads/2020/03/UG_3-1.jpg','Dogpatch Labs is a startup hub, located in the heart of Dublin’s Digital Docklands.','https://dogpatchlabs.com','info@dogpatchlabs.com',NULL,'8:30 - 5:30','Use the email address or phone number to call ahead and book a desk, let them know you''re a Tramshed member'); +INSERT INTO "coworking_spaces" VALUES ('Stafion F','5 Parvis Alan Turing, Paris','https://stationf.co/img/misc/create-zone.jpg',',https://stationf.co/img/flatmates/coffee-restaurant.jpg','Based in central Paris, STATION F gathers a whole entrepreneurial ecosystem under one roof. We help entrepreneurs bring their ambitious ideas to life.','https://stationf.co',NULL,NULL,'0:00 - 0:00','Book through the Tramshed Tech app'); +COMMIT; diff --git a/project_server.py b/project_server.py index edb3daf8c64334d9af1fadcd79d52b67a1a31444..1173479f42c1eab611a5a83c287ba0ecbc6a6712 100644 --- a/project_server.py +++ b/project_server.py @@ -1,12 +1,64 @@ import os +import sqlite3 from flask import Flask, redirect, request, render_template, jsonify - app = Flask(__name__) +DATABASE = "project_db.db" ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) -#PUT ROUTES HERE +@app.route("/SearchRecord", methods=['POST']) +def searchRecord(): + + print('Processing search.') + infoMessage = ('Record not found.') + + if request.method =='POST': + recordName = request.form.get('recordName', default="Error") + + conn = sqlite3.connect(DATABASE) + cur = conn.cursor() + cur.execute("SELECT * FROM coworking_spaces WHERE Name=?;", [recordName]) + recordData = cur.fetchall() + conn.close() + + infoMessage = (f'{recordData} Record search.') + return str(recordData) + + print(infoMessage) + return (infoMessage) + +# Adds a record to the CSV file. +@app.route("/AddRecord", methods=['POST']) +def addRecord(): + + print('Processing record.') + infoMessage = ('Add record failed.') + + if (request.method == 'POST'): + recordName = request.form['recordName'] + recordAddress = request.form['recordAddress'] + recordMainPhotos = request.form['recordMainPhotos'] + recordAdditionalPhotos = request.form['recordAdditionalPhotos'] + recordDescription = request.form['recordDescription'] + recordWebsite = request.form['recordWebsite'] + recordEmail = request.form['recordEmail'] + recordPhoneNumber = request.form['recordPhoneNumber'] + recordOpeningHours = request.form['recordOpeningHours'] + recordCheckinInstructions = request.form['recordCheckinInstructions'] + recordData = [recordName, recordAddress, recordMainPhotos, recordAdditionalPhotos, recordDescription, recordWebsite, recordEmail, recordPhoneNumber, recordOpeningHours, recordCheckinInstructions] + + conn = sqlite3.connect(DATABASE) + cur = conn.cursor() + cur.execute("INSERT INTO coworking_spaces ('Name', 'Address', 'Main_Photo', 'Additional_Photos', 'Description', 'Website', 'Email', 'Phone_Number', 'Opening_Hours', 'Checkin_Instructions')\ + VALUES (?,?,?,?,?,?,?,?,?,?)", (recordName, recordAddress, recordMainPhotos, recordAdditionalPhotos, recordDescription, recordWebsite, recordEmail, recordPhoneNumber, recordOpeningHours, recordCheckinInstructions)) + conn.commit() + conn.close() + + infoMessage = (f'{recordData} Record added.') + + print(infoMessage) + return (infoMessage) if __name__ == "__main__": app.run(debug=True) diff --git a/static/CSS/Manage_Coworking_Spaces.css b/static/CSS/Manage_Coworking_Spaces.css new file mode 100644 index 0000000000000000000000000000000000000000..b9b1e4a439d856607d7bba1fe3a0af72c13b3a42 --- /dev/null +++ b/static/CSS/Manage_Coworking_Spaces.css @@ -0,0 +1,156 @@ +/* #iD and .Class + +font, color, text +padding, background, border, margin +width, height, +position, top/right/bottom/left +overflow, float, display + + +.my-class { + width: calc(100% - 20px); + height: calc(50% + 10px); +} */ + +* { + font-family: Helvetica, Verdana, Arial, sans-serif; +} + +body { + margin: 0; + padding: 0; +} + +ul, li { + list-style-type: none; + margin: 0; + padding: 0; +} + +a { + text-decoration: none; +} + +.Left { + margin-right: auto; +} + +.Center { + margin-left: auto; + margin-right: auto; +} + +.Right { + margin-left: auto; +} + +/* [#1] Page header styling. Uses [#2]. + +header #pageHeader + div #headerDiv + nav #headerNav .navBar + ul .Right, ul .Left + li a + +*/ + +#headerDiv { + text-align: center; + background-color: white; + padding: 20px 0px; + display: flex; + align-items: center; + justify-content: flex-start; +} + +#headerDiv a { + font-size: 30px; + font-weight: bold; + color: black; +} + +#headerText { + width: 100%; + margin-left: -220px; +} + +#headerImg { + width: 180px; + height: 65px; + margin-top: -10px; + margin-right: 20px; + margin-bottom: -17.5px; + margin-left: 20px; +} + +#headerNav { + width: 100%; + position: absolute; +} + +#headerNav a { + font-size: 20px; + padding: 7.5px 10px; +} + +#headerNav img { + width: 55px; + height: 20px; +} + +/* [#2] Page navigation styling. Used in [#1] and [#4]. */ + +.navBar { + background-color: #282A35; + display: flex; + justify-content: center; + align-items: center; +} + +.navBar ul, .navBar li { + display: flex; + align-items: center; +} + +.navBar a { + color: white; +} + +.navBar a:hover { + background-color: #0B0C0F; +} + +/* [#3] Page main styling. + +main #pageMain + form #recordForm + label + input .formTextInput + button #addButton + + */ + +#pageMain {} + +#recordForm { + margin-left: 5px; +} + +#recordForm .formTextInput { + margin-top: 5px; + width: 50%; +} + +/* [#4] Page footer styling. Uses [#2]. + +footer #pageFooter + nav #footerNav .navBar + ul .Center + li a + +*/ + +#footerNav a { + font-size: 15px; + padding: 5px 10px; +} diff --git a/static/landingstyle.css b/static/CSS/landingstyle.css similarity index 100% rename from static/landingstyle.css rename to static/CSS/landingstyle.css diff --git a/static/locations.css b/static/CSS/locations.css similarity index 100% rename from static/locations.css rename to static/CSS/locations.css diff --git a/static/CSS/make_booking.css b/static/CSS/make_booking.css new file mode 100644 index 0000000000000000000000000000000000000000..34bb55e6c7a61fac6ebd14e69d8764085fa7974c --- /dev/null +++ b/static/CSS/make_booking.css @@ -0,0 +1,14 @@ +#header { + display: block; + width: 30%; +} + + +h1 { +color: black; +font-family: arial, sans-serif; +font-size: 40px; +font-weight: bold; +margin-top: 70px; +text-align: center; +} diff --git a/static/JS/Manage_Coworking_Spaces.js b/static/JS/Manage_Coworking_Spaces.js new file mode 100644 index 0000000000000000000000000000000000000000..3028a6889e13c10d865c1926b4fc71c8cdd3d51a --- /dev/null +++ b/static/JS/Manage_Coworking_Spaces.js @@ -0,0 +1,171 @@ +// Replaces the onSubmit attribute for the addRecord form. +function onSubmitLoad() { + document.getElementById('searchButton').addEventListener('click',searchRecord); + document.getElementById('addButton').addEventListener('click',addRecord); + document.getElementById('editButton').addEventListener('click',editRecord); + document.getElementById('deleteButton').addEventListener('click',deleteRecord); +} + +function headerLoad() { + let headerDiv = document.querySelector('#headerDiv'); + let headerDivHeight = headerDiv.offsetHeight; + let headerNav = document.querySelector('#headerNav'); + let headerNavHeight = headerNav.offsetHeight; + let pageHeaderHeight = headerDivHeight + headerNavHeight; + document.getElementById("pageHeader").style.height = pageHeaderHeight + "px"; +} + +window.onscroll = function() {parallaxNavScroll()}; + +function parallaxNavScroll() { + let headerDiv = document.querySelector('#headerDiv'); + let headerHeight = headerDiv.offsetHeight; + if (document.body.scrollTop > headerHeight || document.documentElement.scrollTop > headerHeight) { + document.getElementById("headerNav").style.top = "0"; + document.getElementById("headerNav").style.position = "fixed"; + } else { + document.getElementById("headerNav").style.top = headerHeight + "px"; + document.getElementById("headerNav").style.position = "absolute"; + } +} + +function pageLoad() { + onSubmitLoad(); + headerLoad(); +} + +// Searches for a record in the database. +function searchRecord(e) { + // Removes the standard form processing. + e.preventDefault(); + e.stopPropagation(); + + // Assigning form element values to variables. + var recordName = document.getElementById("recordName").value; + + // Creating a form data-type to transfer multiple parameters to the server. + var params = 'recordName='+recordName; + + var xhttp = new XMLHttpRequest(); + xhttp.open("POST", '/SearchRecord', true); + xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + xhttp.onreadystatechange = function() { + if (xhttp.readyState === 4 && xhttp.status === 200) { + console.log(xhttp.responseText); + document.getElementById("DEBUGserverMessage").innerHTML = xhttp.responseText; + } else { + console.error(`Status Text: ${xhttp.statusText}.`); + console.error(`Ready State: ${xhttp.readyState}.`); + } + }; + xhttp.send(params); +} + + +// Adds a record to the database. +function addRecord(e) { + // Removes the standard form processing. + e.preventDefault(); + e.stopPropagation(); + + // Assigning form element values to variables. + var recordName = document.getElementById("recordName").value; + var recordAddress = document.getElementById("recordAddress").value; + var recordMainPhotos = document.getElementById("recordMainPhotos").value; + var recordAdditionalPhotos = document.getElementById("recordAdditionalPhotos").value; + var recordDescription = document.getElementById("recordDescription").value; + var recordWebsite = document.getElementById("recordWebsite").value; + var recordEmail = document.getElementById("recordEmail").value; + var recordPhoneNumber = document.getElementById("recordPhoneNumber").value; + var recordOpeningHours = document.getElementById("recordOpeningHours").value; + var recordCheckinInstructions = document.getElementById("recordCheckinInstructions").value; + + // Creating a form data-type to transfer multiple parameters to the server. + var params = 'recordName='+recordName+'&recordAddress='+recordAddress+'&recordMainPhotos='+recordMainPhotos+'&recordAdditionalPhotos='+recordAdditionalPhotos+'&recordDescription='+recordDescription+'&recordWebsite='+recordWebsite+'&recordEmail='+recordEmail+'&recordPhoneNumber='+recordPhoneNumber+'&recordOpeningHours='+recordOpeningHours+'&recordCheckinInstructions='+recordCheckinInstructions; + + var xhttp = new XMLHttpRequest(); + xhttp.open("POST", '/AddRecord', true); + xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + xhttp.onreadystatechange = function() { + if (xhttp.readyState === 4 && xhttp.status === 200) { + console.log(xhttp.responseText); + document.getElementById("DEBUGserverMessage").innerHTML = xhttp.responseText; + } else { + console.error(`Status Text: ${xhttp.statusText}.`); + console.error(`Ready State: ${xhttp.readyState}.`); + } + }; + xhttp.send(params); +} + +// Edits a record in the database. +function editRecord(e) { + // Removes the standard form processing. + e.preventDefault(); + e.stopPropagation(); + + // Assigning form element values to variables. + var recordName = document.getElementById("recordName").value; + var recordAddress = document.getElementById("recordAddress").value; + var recordMainPhotos = document.getElementById("recordMainPhotos").value; + var recordAdditionalPhotos = document.getElementById("recordAdditionalPhotos").value; + var recordDescription = document.getElementById("recordDescription").value; + var recordWebsite = document.getElementById("recordWebsite").value; + var recordEmail = document.getElementById("recordEmail").value; + var recordPhoneNumber = document.getElementById("recordPhoneNumber").value; + var recordOpeningHours = document.getElementById("recordOpeningHours").value; + var recordCheckinInstructions = document.getElementById("recordCheckinInstructions").value; + + // Creating a form data-type to transfer multiple parameters to the server. + var params = 'recordName='+recordName+'&recordAddress='+recordAddress+'&recordMainPhotos='+recordMainPhotos+'&recordAdditionalPhotos='+recordAdditionalPhotos+'&recordDescription='+recordDescription+'&recordWebsite='+recordWebsite+'&recordEmail='+recordEmail+'&recordPhoneNumber='+recordPhoneNumber+'&recordOpeningHours='+recordOpeningHours+'&recordCheckinInstructions='+recordCheckinInstructions; + + var xhttp = new XMLHttpRequest(); + xhttp.open("POST", '/EditRecord', true); + xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + xhttp.onreadystatechange = function() { + if (xhttp.readyState === 4 && xhttp.status === 200) { + console.log(xhttp.responseText); + document.getElementById("DEBUGserverMessage").innerHTML = xhttp.responseText; + } else { + console.error(`Status Text: ${xhttp.statusText}.`); + console.error(`Ready State: ${xhttp.readyState}.`); + } + }; + xhttp.send(params); +} + +// Deletes a record in the database. +function deleteRecord(e) { + // Removes the standard form processing. + e.preventDefault(); + e.stopPropagation(); + + // Assigning form element values to variables. + var recordName = document.getElementById("recordName").value; + var recordAddress = document.getElementById("recordAddress").value; + var recordMainPhotos = document.getElementById("recordMainPhotos").value; + var recordAdditionalPhotos = document.getElementById("recordAdditionalPhotos").value; + var recordDescription = document.getElementById("recordDescription").value; + var recordWebsite = document.getElementById("recordWebsite").value; + var recordEmail = document.getElementById("recordEmail").value; + var recordPhoneNumber = document.getElementById("recordPhoneNumber").value; + var recordOpeningHours = document.getElementById("recordOpeningHours").value; + var recordCheckinInstructions = document.getElementById("recordCheckinInstructions").value; + + // Creating a form data-type to transfer multiple parameters to the server. + var params = 'recordName='+recordName+'&recordAddress='+recordAddress+'&recordMainPhotos='+recordMainPhotos+'&recordAdditionalPhotos='+recordAdditionalPhotos+'&recordDescription='+recordDescription+'&recordWebsite='+recordWebsite+'&recordEmail='+recordEmail+'&recordPhoneNumber='+recordPhoneNumber+'&recordOpeningHours='+recordOpeningHours+'&recordCheckinInstructions='+recordCheckinInstructions; + + var xhttp = new XMLHttpRequest(); + xhttp.open("POST", '/DeleteRecord', true); + xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + xhttp.onreadystatechange = function() { + if (xhttp.readyState === 4 && xhttp.status === 200) { + console.log(xhttp.responseText); + document.getElementById("DEBUGserverMessage").innerHTML = xhttp.responseText; + } else { + console.error(`Status Text: ${xhttp.statusText}.`); + console.error(`Ready State: ${xhttp.readyState}.`); + } + }; + xhttp.send(params); +} diff --git a/static/locations.js b/static/JS/locations.js similarity index 100% rename from static/locations.js rename to static/JS/locations.js diff --git a/static/Manage_Coworking_Spaces.html b/static/Manage_Coworking_Spaces.html index 7f11000886aacb8cee0fcd49beeab6f63d791756..26908ef8108f7b8ae8876a4f7d7e9018dadee7bc 100644 --- a/static/Manage_Coworking_Spaces.html +++ b/static/Manage_Coworking_Spaces.html @@ -2,54 +2,93 @@ <html lang="EN" dir="ltr"> <head> <meta charSet="UTF-8"> - <title> Page Template </title> - <link rel="stylesheet" href="StylingSheet.css"> + <title> Manage Coworking Spaces </title> + <link rel="stylesheet" href="CSS/Manage_Coworking_Spaces.css"> </head> <body onLoad="pageLoad()"> - <header id="header"> - <a href=""><h1>Page Header</h1></a> + <header id="pageHeader" class="pageHeader"> + <div id="headerDiv"> + <a href="Manage_Coworking_Spaces.html"> + <img id="headerImg" class="headerImg" + src="Media/Tramshed-Logo-Main-Black.png"></img></a> + <a id="headerText" class="headerText" + href="Manage_Coworking_Spaces.html"> + Manage Coworking Spaces</a> + </div> + <nav id="headerNav" class="navBar"> + <ul class="Left"> + <li><a href="Manage_Coworking_Spaces.html"> + <img id="navImg" class="navImg" + src="Media/Tramshed-Logo-Main-White.png"></img></a></li> + <li><a href="Manage_Coworking_Spaces.html">Home</a></li> + <li><a href="Manage_Coworking_Spaces.html">Locations</a></li> + </ul> + <ul class="Right"> + <li><a href="Manage_Coworking_Spaces.html">Manage</a></li> + <li><a href="Manage_Coworking_Spaces.html">Login</a></li> + <li><div class="navHamburger"> + <span></span> + <span></span> + <span></span> + </div></li> + </ul> + </nav> </header> - <hr> - - <main id="recordSection"> + <main id="pageMain"> <form id="recordForm" title="Record Form"> - <label>Name: <input name="record_name" id="recordName" - type="text"></label><br> - <label>Address: <input name="record_address" id="recordAddress" - type="text"></label><br> - <label>Main Photograph: <input name="record_MP" id="recordMainPhotos" - type="text"></label><br> - <label>Additional Photographs: <input name="record_AP" id="recordAdditionalPhotos" - type="text"></label><br> - <label>Description: <input name="record_description" id="recordDescription" - type="text"></label><br> - <label>Website: <input name="record_website" id="recordWebsite" - type="text"></label><br> - <label>Email: <input name="record_email" id="recordEmail" - type="text"></label><br> - <label>Phone Number: <input name="record_PN" id="recordPhoneNumber" - type="text"></label><br> - <label>Opening Hours: <input name="record_OH" id="recordOpeningHours" - type="text"></label><br> - <label>Checkin Instructions: <input name="record_CI" id="recordCheckinInstructions" - type="text"></label> + <label>Name: <input id="recordName" class="formTextInput" + name="record_name" type="text"></label><br> + <label>Address: <input id="recordAddress" class="formTextInput" + name="record_address" type="text"></label><br> + <label>Main Photograph: <input id="recordMainPhotos" class="formTextInput" + name="record_MP" type="text"></label><br> + <label>Additional Photographs: <input id="recordAdditionalPhotos" class="formTextInput" + name="record_AP" type="text"></label><br> + <label>Description: <input id="recordDescription" class="formTextInput" + name="record_description" type="text"></label><br> + <label>Website: <input id="recordWebsite" class="formTextInput" + name="record_website" type="text"></label><br> + <label>Email: <input id="recordEmail" class="formTextInput" + name="record_email" type="text"></label><br> + <label>Phone Number: <input id="recordPhoneNumber" class="formTextInput" + name="record_PN" type="text"></label><br> + <label>Opening Hours: <input id="recordOpeningHours" class="formTextInput" + name="record_OH" type="text"></label><br> + <label>Checkin Instructions: <input id="recordCheckinInstructions" class="formTextInput" + name="record_CI" type="text"></label> <br><br> + <button id="searchButton" type="submit">Search</button> <button id="addButton" type="submit">Add</button> + <button id="editButton" type="submit">Edit</button> + <button id="deleteButton" type="submit">Delete</button> </form> <br> <span id="DEBUGserverMessage"> </span> - </main> - <hr> + <br><br><br><br><br><br><br><br><br><br><br><br> + <br><br><br><br><br><br><br><br><br><br><br><br> + <br><br><br><br><br><br><br><br><br><br><br><br> + <br><br><br><br><br><br><br><br><br><br><br><br> + </main> - <footer id="footer"> - <a href="#header">Top</a> + <footer id="pageFooter"> + <nav id="footerNav" class="navBar"> + <ul class="Center"> + <li><a href="Manage_Coworking_Spaces.html">Left</a></li> + </ul> + <ul class="Center"> + <li><a href="Manage_Coworking_Spaces.html">Center</a></li> + </ul> + <ul class="Center"> + <li><a href="Manage_Coworking_Spaces.html">Right</a></li> + </ul> + </nav> </footer> - <script src="Manage_Coworking_Spaces.js"></script> + <script src="JS/Manage_Coworking_Spaces.js"></script> </body> </html> diff --git a/static/Manage_Coworking_Spaces.js b/static/Manage_Coworking_Spaces.js deleted file mode 100644 index 2cd7b3f2be8e9f5992b19ea8866cf64c34e7e23b..0000000000000000000000000000000000000000 --- a/static/Manage_Coworking_Spaces.js +++ /dev/null @@ -1,38 +0,0 @@ -// Replaces the onSubmit attribute for the addRecord form. -function pageLoad() { - document.getElementById('addButton').addEventListener('click',addRecord); -} - -// Adds a record to the CSV file. -function addRecord(e) { - // Removes the standard form processing. - e.preventDefault(); - e.stopPropagation(); - - var recordName = document.getElementById("recordName").value; - var recordAddress = document.getElementById("recordAddress").value; - var recordMainPhotos = document.getElementById("recordMainPhotos").value; - var recordAdditionalPhotos = document.getElementById("recordAdditionalPhotos").value; - var recordDescription = document.getElementById("recordDescription").value; - var recordWebsite = document.getElementById("recordWebsite").value; - var recordEmail = document.getElementById("recordEmail").value; - var recordPhoneNumber = document.getElementById("recordPhoneNumber").value; - var recordOpeningHours = document.getElementById("recordOpeningHours").value; - var recordCheckinInstructions = document.getElementById("recordCheckinInstructions").value; - - var params = 'recordName='+recordName+'&recordAddress='+recordAddress+'&recordMainPhotos='+recordMainPhotos+'&recordAdditionalPhotos='+recordAdditionalPhotos+'&recordDescription='+recordDescription+'&recordWebsite='+recordWebsite+'&recordEmail='+recordEmail+'&recordPhoneNumber='+recordPhoneNumber+'&recordOpeningHours='+recordOpeningHours+'&recordCheckinInstructions='+recordCheckinInstructions; - - var xhttp = new XMLHttpRequest(); - xhttp.open("POST", '/AddRecord', true); - xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); - xhttp.onreadystatechange = function() { - if (xhttp.readyState === 4 && xhttp.status === 200) { - console.log(xhttp.responseText); - document.getElementById("DEBUGserverMessage").innerHTML = xhttp.responseText; - } else { - console.error(`Status Text: ${xhttp.statusText}.`); - console.error(`Ready State: ${xhttp.readyState}.`); - } - }; - xhttp.send(params); -} diff --git a/static/Media/Tramshed-Logo-Main-Black.png b/static/Media/Tramshed-Logo-Main-Black.png new file mode 100644 index 0000000000000000000000000000000000000000..455f7390c61fde648e50fd2a762d15feba6337dd Binary files /dev/null and b/static/Media/Tramshed-Logo-Main-Black.png differ diff --git a/static/Media/Tramshed-Logo-Main-White.png b/static/Media/Tramshed-Logo-Main-White.png new file mode 100644 index 0000000000000000000000000000000000000000..b446f08b72112aef326461887d89437c3eeb901d Binary files /dev/null and b/static/Media/Tramshed-Logo-Main-White.png differ diff --git a/static/Media/logo.jpg b/static/Media/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7a579221e061328e4b7d95bad5964a572398b79a Binary files /dev/null and b/static/Media/logo.jpg differ diff --git a/static/logo.png b/static/Media/logo.png similarity index 100% rename from static/logo.png rename to static/Media/logo.png diff --git a/static/tramshed.jpg b/static/Media/tramshed.jpg similarity index 100% rename from static/tramshed.jpg rename to static/Media/tramshed.jpg diff --git a/static/landingpage.html b/static/landingpage.html index e2c6ac3745e3154b3024a336c659317a45670ff3..b56e8fd9532a49e78e2bf27015a65014f5bd3d18 100644 --- a/static/landingpage.html +++ b/static/landingpage.html @@ -20,7 +20,7 @@ </header> <header class="masthead bg-dark text-white text-left"> <div class="container-fluid"> - <img id="logo" src="logo.png"/> + <img id="logo" src="Media/logo.png"/> <h1 id="header">Tramshed Tech</h1> </div> </header> @@ -33,7 +33,7 @@ <link href="https://fonts.googleapis.com/css2?family=Sora:wght@800&display=swap" rel="stylesheet"> <link rel="stylesheet" href="landingstyle.css"> <title>Tramshed Tech</title> - <img id="tramshed" src="tramshed.jpg"> + <img id="tramshed" src="Media/tramshed.jpg"> <div class="bg-dark p-3"> <div id="buttons" class="flex-container"> <button onclick="window.location.href='locations.html';" type="button" class="btn btn-light"> diff --git a/static/locations.html b/static/locations.html index 7b935a80f6106ff7c5f4ff458b225b6ba02e1dd2..b2d35675eb5ad782b154eddb1550a1ef5de6cb9f 100644 --- a/static/locations.html +++ b/static/locations.html @@ -1,29 +1,28 @@ <!DOCTYPE html> <html> <head> - <link rel="stylesheet" href= "css/locations.css"> + <link rel="stylesheet" href= "CSS/locations.css"> <title> Locations </title> </head> <body> <section> + <h1><img src="https://www.4piproductions.com/wp-content/uploads/2017/04/tramshed_.png" class="logo"> Our Locations </h1> + <button> + <span></span> + <span></span> + <span></span> + </button> + <nav> + <ul> + <li><a href="#"> Home </a></li> + <li><a href="#"> ### </a></li> + <li><a href="#"> ### </a></li> + </ul> + </nav> - <h1><img src="https://www.4piproductions.com/wp-content/uploads/2017/04/tramshed_.png" class="logo"> Our Locations </h1> - <button> - <span></span> - <span></span> - <span></span> - </button> - <nav> - <ul> - <li><a href="#"> Home </a></il> - <li><a href="#"> ### </a></il> - <li><a href="#"> ### </a></il> - </ul> - </nav> - - <div class="contain"> - <ul class= "list"> - <li> + <div class="contain"> + <ul class= "list"> + <li> <div class="container"> <img src="https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" class="image" > @@ -45,10 +44,36 @@ <li> <div class="container"> <img src="https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w" Class="image" > - </li> - </ul> - </div> + + <div class="middle"> + <div class="text"> C4DI </div> + </div> + </div> + </li> + + <li> + <div class="container"> + <img src="https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg" class="image" > + + <div class="middle"> + <div class="text"> Dogpatch </div> + </div> + </div> + </li> + + <li> + <div class="container"> + <img src="https://stationf.co/img/misc/create-zone.jpg" class="image" > + + <div class="middle"> + <div class="text"> Station F </div> + </div> + </div> + </li> + </ul> + </div> + </section> - <script src="C:\Users\c22086220\OneDrive - Cardiff University\Desktop\our locations\JScript\locations.js"> </script> + <script src="JS/locations.js"> </script> </body> diff --git a/static/make_booking.html b/static/make_booking.html new file mode 100644 index 0000000000000000000000000000000000000000..8dc4473e1139406d80d2c3e85c519abdd151c490 --- /dev/null +++ b/static/make_booking.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> +<link rel="stylesheet" href="CSS/make_booking.css"> + +<title>Make a Booking</title> +</head> + + <header> + <img src="Tramshed-Logo-Main-Black.png" id=header /> + </header> + + <body> + <h1 class="bookingtitle">Make a Booking</h1> + + </body> + + + + + + + + + + + + + + + + +</html>