101 lines
3.4 KiB
Plaintext
101 lines
3.4 KiB
Plaintext
<!-- views/location.ejs -->
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Home</title>
|
|
<link rel="stylesheet" href="style.css">
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<header>
|
|
<h1>ECOSAVER MANAGEMENT</h1>
|
|
</header>
|
|
<nav>
|
|
<a href="#" id="allLocationLink">All Locations</a>
|
|
<a href="#" id="addLocationLink">Add Locations</a>
|
|
<a href="#" id="updateLocationLink">Update Locations</a>
|
|
<a href="#">Delete Locations</a>
|
|
<a href="/home" id="homeLink">Home</a>
|
|
</nav>
|
|
<main>
|
|
<h2>Welcome to the Location Page</h2>
|
|
</main>
|
|
<div id="locationContainer">
|
|
<table class="nice-table">
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Location</th>
|
|
<th>Descriptions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="locationTableBody"></tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div id="createLocationForm" class="location-creation-container custom-location-form" style="display: none;">
|
|
<h3>Add Location</h3>
|
|
<div class="content">
|
|
<form action="/location/new" id="locationForm" method="post">
|
|
<div class="Location-details">
|
|
<div class="input-box">
|
|
<span class="details">Location Name</span>
|
|
<input type="text" name="location" id="location" placeholder="Enter Location name" required>
|
|
</div>
|
|
<div class="input-box">
|
|
<span class="details">Description</span>
|
|
<input type="text" name="description" id="description" placeholder="Enter the description here" required>
|
|
</div>
|
|
</div>
|
|
<input type="hidden" name="csrf_token" value="<%= csrfToken %>">
|
|
<div class="button">
|
|
<input type="submit" value="submit">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="updateLocationForm" class="location-update-container" style="display: none;">
|
|
<h3>Add Location</h3>
|
|
<div class="content">
|
|
<form action="/api/v0/location/update" id="updateForm" method="put">
|
|
<div class="Location-details">
|
|
<div class="input-box">
|
|
<span class="details">Location to Update</span>
|
|
<select name="location" id="locationDropdown" required>
|
|
</select>
|
|
</div>
|
|
<div class="input-box">
|
|
<span class="details">Location Name</span>
|
|
<input type="text" name="location" id="location" placeholder="Enter Location name" required>
|
|
</div>
|
|
<div class="input-box">
|
|
<span class="details">Description</span>
|
|
<input type="text" name="description" id="description" placeholder="Enter the description here" required>
|
|
</div>
|
|
</div>
|
|
<input type="hidden" name="csrf_token" value="<%= csrfToken %>">
|
|
<div class="button">
|
|
<input type="submit" value="submit">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<footer>
|
|
Any Issue faced, Please contact the administrator at 11111111 or ecosaverAdmin@gmail.com
|
|
</footer>
|
|
<script>
|
|
const locationsData = <%- JSON.stringify(locationsData) %>;
|
|
</script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.3.3/purify.min.js"></script>
|
|
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
|
<script src="location.js"></script>
|
|
</body>
|
|
|
|
</html> |