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/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 af115bce1e4207ef4c5ad703820af8d3cdc7cdc2..d709010e14e748dbf47d179730473d5c3b694ef5 100644 --- a/project_server.py +++ b/project_server.py @@ -1,11 +1,30 @@ import os -import csv +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']) +@app.route("/SearchRecord", methods=['POST']) +def searchRecord(): + + if request.method =='POST': + try: + 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() + except: + print(f"Error: {recordData}") + conn.close() + finally: + conn.close() + print(f"{str(recordData)} Record found.") + return str(recordData) + # Adds a record to the CSV file. @app.route("/AddRecord", methods=['POST']) def addRecord(): @@ -26,15 +45,65 @@ def addRecord(): recordCheckinInstructions = request.form['recordCheckinInstructions'] recordData = [recordName, recordAddress, recordMainPhotos, recordAdditionalPhotos, recordDescription, recordWebsite, recordEmail, recordPhoneNumber, recordOpeningHours, recordCheckinInstructions] - with open('coworking_spaces.csv', 'a') as addToFile: - csvWriter = csv.writer(addToFile) - csvWriter.writerow(recordData) - addToFile.close() + 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) +@app.route("/DeleteRecord", methods=['POST']) +def deleteRecord(): + + if request.method =='POST': + try: + recordName = request.form.get('recordName', default="Error") + conn = sqlite3.connect(DATABASE) + cur = conn.cursor() + cur.execute("DELETE FROM coworking_spaces WHERE Name=?;", [recordName]) + conn.commit() + except: + print(f"Error: {recordData}") + conn.close() + finally: + conn.close() + print("Record deleted.") + return ("Record deleted.") + +@app.route("/EditRecord", methods=['POST']) +def editRecord(): + + 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("UPDATE coworking_spaces SET 'Name' = ?, 'Address' = ?, 'Main_Photo' = ?, 'Additional_Photos' = ?, 'Description' = ?, 'Website' = ?, 'Email' = ?, 'Phone_Number' = ?, 'Opening_Hours' = ?, 'Checkin_Instructions' = ? WHERE Name=?;", [recordName, recordAddress, recordMainPhotos, recordAdditionalPhotos, recordDescription, recordWebsite, recordEmail, recordPhoneNumber, recordOpeningHours, recordCheckinInstructions, recordName]) + conn.commit() + conn.close() + + infoMessage = (f'{recordData} Record amended.') + + print(infoMessage) + return (infoMessage) + if __name__ == "__main__": app.run(debug=True) diff --git a/static/Manage_Coworking_Spaces.css b/static/CSS/Manage_Coworking_Spaces.css similarity index 73% rename from static/Manage_Coworking_Spaces.css rename to static/CSS/Manage_Coworking_Spaces.css index 45f7b3fc7235e7db8221659b381317165b18d223..b9b1e4a439d856607d7bba1fe3a0af72c13b3a42 100644 --- a/static/Manage_Coworking_Spaces.css +++ b/static/CSS/Manage_Coworking_Spaces.css @@ -47,25 +47,42 @@ a { /* [#1] Page header styling. Uses [#2]. header #pageHeader - main #headerMain + div #headerDiv nav #headerNav .navBar ul .Right, ul .Left li a */ -#headerMain { +#headerDiv { text-align: center; background-color: white; padding: 20px 0px; + display: flex; + align-items: center; + justify-content: flex-start; } -#headerMain a { +#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; @@ -76,6 +93,11 @@ header #pageHeader padding: 7.5px 10px; } +#headerNav img { + width: 55px; + height: 20px; +} + /* [#2] Page navigation styling. Used in [#1] and [#4]. */ .navBar { @@ -101,15 +123,27 @@ header #pageHeader /* [#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 - main #footerMain nav #footerNav .navBar ul .Center li a diff --git a/static/CSS/landingstyle.css b/static/CSS/landingstyle.css new file mode 100644 index 0000000000000000000000000000000000000000..a63b29d5a4cab5686387807774ac244875f7baa7 --- /dev/null +++ b/static/CSS/landingstyle.css @@ -0,0 +1,59 @@ +header{ + background-color: black; + display: block; + color: black; + margin-left: auto; + margin-right: inherit; + width: 100%; + height: 75%; +} + + +#logo{ + width: 10%; +} + + +button{ + font-family: 'Sora', sans-serif; + cursor: pointer; +} + +body{ + background-color: #212529; + font-family: 'Sora', sans-serif; +} + +.container-fluid{ + display: flex; + flex-direction: column; + justify-content: space-around; + align-items: center; +} +#tramshed{ + width: 45%; + height: 45%; + display: inline-block; + transform: translate(60%, 0%); + border: 1px solid #ddd; + border-radius: 4px; + padding: 5px; +} + +#buttons{ + width: 25%; + height: 25%; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + margin-left: auto; + margin-right: auto; + transform: translate(-10%, 0%); +} + +#dropdownmenu{ + background-color: grey; + color: #212529; + text-align: end; +} 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/loginstyle.css b/static/CSS/loginstyle.css new file mode 100644 index 0000000000000000000000000000000000000000..dcb9b6845e58916f793bc9f3e02e554da07a83d2 --- /dev/null +++ b/static/CSS/loginstyle.css @@ -0,0 +1,25 @@ +header{ + background-color: black; + display: block; + color: black; + margin-left: auto; + margin-right: inherit; + width: 100%; + height: 75%; +} + +.card{ + margin: 0 auto; + float: none; + margin-bottom: 10px; +} + +#logo{ + width: 10%; +} + +body{ + font-family: 'Sora', sans-serif; + background-color: #212529; + color: white; +} 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..c3efb0f50541ce04eecd8d3f6dde8f3fc20fd81b --- /dev/null +++ b/static/JS/Manage_Coworking_Spaces.js @@ -0,0 +1,162 @@ +// 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; + + // Creating a form data-type to transfer multiple parameters to the server. + var params = 'recordName='+recordName; + + 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 52f9ea310c31e22ce615946a554b14cccfe092e3..26908ef8108f7b8ae8876a4f7d7e9018dadee7bc 100644 --- a/static/Manage_Coworking_Spaces.html +++ b/static/Manage_Coworking_Spaces.html @@ -3,25 +3,31 @@ <head> <meta charSet="UTF-8"> <title> Manage Coworking Spaces </title> - <link rel="stylesheet" href="Manage_Coworking_Spaces.css"> + <link rel="stylesheet" href="CSS/Manage_Coworking_Spaces.css"> </head> <body onLoad="pageLoad()"> <header id="pageHeader" class="pageHeader"> - <main id="headerMain"> - <a href="Manage_Coworking_Spaces.html">Manage Coworking Spaces</a> - </main> + <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">Left</a></li> - <li><a href="Manage_Coworking_Spaces.html">Home</a></li> - <li><a href="Manage_Coworking_Spaces.html">Left</a></li> + <li><a href="Manage_Coworking_Spaces.html">Locations</a></li> </ul> <ul class="Right"> - <li><a href="Manage_Coworking_Spaces.html">Home</a></li> - <li><a href="Manage_Coworking_Spaces.html">Right</a></li> + <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> @@ -31,32 +37,34 @@ </nav> </header> - <main id="recordSection"> - <br> + <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> @@ -68,21 +76,19 @@ </main> <footer id="pageFooter"> - <main id="footerMain"> - <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> - </main> + <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 cd99c349a737f789d40218bbba02f7717693ef13..0000000000000000000000000000000000000000 --- a/static/Manage_Coworking_Spaces.js +++ /dev/null @@ -1,67 +0,0 @@ -// Replaces the onSubmit attribute for the addRecord form. -function onSubmitLoad() { - document.getElementById('addButton').addEventListener('click',addRecord); -} - - -function headerLoad() { - let headerMain = document.querySelector('#headerMain'); - let headerMainHeight = headerMain.offsetHeight; - let headerNav = document.querySelector('#headerNav'); - let headerNavHeight = headerNav.offsetHeight; - let pageHeaderHeight = headerMainHeight + headerNavHeight; - document.getElementById("pageHeader").style.height = pageHeaderHeight + "px"; -} - -window.onscroll = function() {parallaxNavScroll()}; - -function parallaxNavScroll() { - let headerMain = document.querySelector('#headerMain'); - let headerHeight = headerMain.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(); -} - -// 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/logo.jpg b/static/Media/logo.jpg similarity index 100% rename from static/logo.jpg rename to static/Media/logo.jpg diff --git a/static/Media/logo.png b/static/Media/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f385aaf178033943a2dd7f9cde33a5cf5f230515 Binary files /dev/null and b/static/Media/logo.png differ diff --git a/static/Media/tramshed.jpg b/static/Media/tramshed.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1924701c2bbdc9e71753db086605e4b2149a918b Binary files /dev/null and b/static/Media/tramshed.jpg differ diff --git a/static/landingpage.html b/static/landingpage.html index c91743899013c95405a401465c373d13e5e3233f..b56e8fd9532a49e78e2bf27015a65014f5bd3d18 100644 --- a/static/landingpage.html +++ b/static/landingpage.html @@ -1,11 +1,56 @@ -<html> -<head><link rel="stylesheet" href="landingstyle.css"></head> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> +</head> <header> - <title>Tramshed Tech</title> - <img src="logo.jpg"/><br><br><br><br> + <nav class="navbar navbar-expand-sm bg-dark navbar-dark"> + <div class="container-fluid"> + <ul class="navbar-nav"> + <li class="nav-item"> + <a class="nav-link" href="locations.html">Coworking locations</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="Manage_Coworking_Spaces.html">Manage locations</a> + </li> + </ul> + </div> + </nav> +</header> +<header class="masthead bg-dark text-white text-left"> + <div class="container-fluid"> + <img id="logo" src="Media/logo.png"/> + <h1 id="header">Tramshed Tech</h1> + </div> </header> <body> - <img src="title.png"/> - <button id= "ViewLocations" type="ViewLocations" href="locations.html">View Locations</button> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"> + <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" ></script> + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.min.js" integrity="sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT" crossorigin="anonymous"></script> + <link rel="preconnect" href="https://fonts.googleapis.com"> + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> + <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="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"> + <span class="spinner-grow spinner-grow-sm"></span> + View Locations + </button> + <br> + <div class="dropdown"> + <button class="btn btn-light dropdown-toggle" type="button" id="dropdownMenubutton" data-bs-toggle="dropdown">Socials</button> + <ul class="dropdown-menu" id="dropdownmenu" aria-labelledby="dropdownMenubutton"> + <li><button class="dropdown-item" type="button" onclick="window.location.href='https://www.linkedin.com/company/tramshed-tech';" target="_blank" rel="noopener" class="footer-social-media-icon"> <img class="no-border-radius" src="https://cdn.tramshedtech.co.uk/static/img/home/Linkedin%20Logo.svg" alt="LinkedIn"> LinkedIn</button></li> + <li><button class="dropdown-item" type="button" onclick="window.location.href='https://www.facebook.com/tramshedtech';" target="_blank" rel="noopener" class="footer-social-media-icon"> <img class="no-border-radius" src="https://cdn.tramshedtech.co.uk/static/img/home/Facebook%20Logo.svg" alt="Facebook"> Facebook</button></li> + <li><button class="dropdown-item" type="button" onclick="window.location.href='https://twitter.com/TramshedTech';" target="_blank" rel="noopener" class="footer-social-media-icon"> <img class="no-border-radius" src="https://cdn.tramshedtech.co.uk/static/img/home/Twitter%20Logo.svg" alt="Twitter"> Twitter</button></li> + <li><button class="dropdown-item" type="button" onclick="window.location.href='https://www.instagram.com/tramshedtech/?hl=en';" target="_blank" rel="noopener" class="footer-social-media-icon"> <img class="no-border-radius" src="https://cdn.tramshedtech.co.uk/static/img/home/Instagram%20Logo.svg" alt="Instagram"> Instagram</button></li> + </ul> + </div> + </div> + </div> </body> </html> diff --git a/static/landingstyle.css b/static/landingstyle.css deleted file mode 100644 index 496bb079cca6cccfe95dfac79cc0822052fca366..0000000000000000000000000000000000000000 --- a/static/landingstyle.css +++ /dev/null @@ -1,33 +0,0 @@ -header{ - background-color: black; - display: block; - color: black; - margin-left: auto; - margin-right: inherit; - width: 100%; - height: 75%; -} - -button{ - background-color: white; - color: black; - text-align: center; - position: absolute; - margin: inherit; - display: inline-block; - line-height: 20px; - width: 10%; - height: 15%; - font-size: 16px; - border-radius: 12px; - padding: 1px 10px; - transform: translate(350%, 50%); - font-family: monospace; - font-style: oblique; - font-weight: bolder; - cursor: pointer; -} - -body{ - display: block; -} diff --git a/static/locations.html b/static/locations.html index 3946db329e227f05cfdb74164975f825e75e21a1..b2d35675eb5ad782b154eddb1550a1ef5de6cb9f 100644 --- a/static/locations.html +++ b/static/locations.html @@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> - <link rel="stylesheet" href= "css/locations.css"> + <link rel="stylesheet" href= "CSS/locations.css"> <title> Locations </title> </head> <body> @@ -74,6 +74,6 @@ </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/login.html b/static/login.html new file mode 100644 index 0000000000000000000000000000000000000000..c76f858a582dfd602be21343a4f7ebeba22bb3f8 --- /dev/null +++ b/static/login.html @@ -0,0 +1,63 @@ +<!DOCTYPE html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> +</head> +<header class="masthead bg-dark text-white text-center"> + <div class="container-fluid"> + <img id="logo" src="Media/logo.png"/> + <h1 id="header">Tramshed Tech</h1> + </div> + </header> +<body> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"> + <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" ></script> + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.min.js" integrity="sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT" crossorigin="anonymous"></script> + <link rel="preconnect" href="https://fonts.googleapis.com"> + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> + <link href="https://fonts.googleapis.com/css2?family=Sora:wght@800&display=swap" rel="stylesheet"> + <link rel="stylesheet" href="CSS/loginstyle.css"> + <title>Login</title> + <div id="card" class="card text-dark w-25 text-center"> + <div class="card-body text-center"> + + + <form> + <!-- Email input --> + <div class="form-outline mb-4"> + <input type="email" id="form2Example1" class="form-control" /> + <label class="form-label" for="form2Example1">Email address</label> + </div> + + <!-- Password input --> + <div class="form-outline mb-4"> + <input type="password" id="form2Example2" class="form-control" /> + <label class="form-label" for="form2Example2">Password</label> + </div> + + <!-- 2 column grid layout for inline styling --> + <div class="row mb-4"> + <div class="col d-flex justify-content-center"> + <!-- Checkbox --> + <div class="form-check"> + <input class="form-check-input" type="checkbox" value="" id="form2Example31" checked /> + <label class="form-check-label" for="form2Example31"> Remember me </label> + </div> + </div> + + <div class="col"> + <!-- Simple link --> + <a href="#!">Forgot password?</a> + </div> + + <!-- Submit button --> + <button onclick="window.location.href='landingpage.html';" type="button" class="btn btn-light"> + <span class="spinner-grow spinner-grow-sm"></span> + Sign in + </button> + <!-- Register buttons --> + <div class="text-center"> + <p>Not a member? <a href="#!">Register</a></p> + </form> + </body> +</html> 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> diff --git a/static/title.png b/static/title.png deleted file mode 100644 index ecd6448502b63a65b44067ae8bb7b05b64cacc43..0000000000000000000000000000000000000000 Binary files a/static/title.png and /dev/null differ