Skip to content
Snippets Groups Projects

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

3 files
+ 92
29
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 56
5
{%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;
<h1 id="name"></h1><br>
<td>data</td>
<img src= Main_Photo><br>
<<script type="text/javascript">
document.getElementById("name").innerHTML= data;
</script>
<table border = 1>
<thead>
<td>Name</td>
<td>Address</td>
<td>Main_Photo</td>
<td>Additional_photos</td>
<td>Description</td>
<td>Website</td>
<td>Opening_Hours</td>
</thead>
{% for row in data %}
<tr>
<td>{{row[0]}}</td>
<td>{{row[1]}}</td>
<td>{{row[2]}}</td>
<td>{{row[3]}}</td>
<td>{{row[4]}}</td>
<td>{{row[5]}}</td>
<td>{{row[6]}}</td>
</tr>
{% endfor %}
</table>
{%endblock%}
{% block addressBlock%}
<h2><input type = "text" name = "Name"><br></h2>
<h2><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%}
@@ -31,6 +56,32 @@ document.getElementById("name").innerHTML = Name;
<span id='txt'></span>
<script>
function loadSpace() {
var Name = document.forms["coworking_spaces"]["Name"].value;
var Address = document.forms["coworking_spaces"]["Address"].value;
var Main_Photo = document.forms["coworking_spaces"]["Main_Photo"].value;
var Additional_photos = document.forms["coworking_spaces"]["Main_Photo"].value;
var Description = document.forms["coworking_spaces"]["Description"].value;
var Website = document.forms["coworking_spaces"]["Website"].value;
var Opening_Hours = document.forms["coworking_spaces"]["Opening_Hours"].value;
var xhttp = new XMLHttpRequest();
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.onload = function() {
if (xhttp.readyState === 4 && xhttp.status === 200) {
console.log(xhttp.responseText);
document.getElementById("txt").innerHTML = xhttp.responseText;
} else {
console.error(xhttp.statusText);
}
};
xhttp.send(params);
return false;
}
</script>
</form>
Loading