1 | <!DOCTYPE html>
|
---|
2 | <html lang="en">
|
---|
3 | <head>
|
---|
4 | <meta charset="UTF-8">
|
---|
5 | <title>Admin Page - Scheduled Reservations</title>
|
---|
6 | <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
---|
7 | <!-- Font Awesome -->
|
---|
8 | <link
|
---|
9 | href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
|
---|
10 | rel="stylesheet"
|
---|
11 | />
|
---|
12 | <!-- Google Fonts -->
|
---|
13 | <link
|
---|
14 | href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
|
---|
15 | rel="stylesheet"
|
---|
16 | />
|
---|
17 | <!-- MDB -->
|
---|
18 | <link
|
---|
19 | href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/5.0.0/mdb.min.css"
|
---|
20 | rel="stylesheet"
|
---|
21 | />
|
---|
22 | <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css"
|
---|
23 | integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
---|
24 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
---|
25 | </head>
|
---|
26 | <body>
|
---|
27 | <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
---|
28 | <a class="navbar-brand" href="#">Salon Bella</a>
|
---|
29 | <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
|
---|
30 | aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
---|
31 | <span class="navbar-toggler-icon"></span>
|
---|
32 | </button>
|
---|
33 |
|
---|
34 | <div class="collapse navbar-collapse" id="navbarSupportedContent">
|
---|
35 | <ul class="navbar-nav mr-auto">
|
---|
36 | <li class="nav-item ">
|
---|
37 | <a class="nav-link" href="/adminDashboard">Home <span class="sr-only">(current)</span></a>
|
---|
38 | </li>
|
---|
39 |
|
---|
40 | <li class="nav-item dropdown">
|
---|
41 | <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
|
---|
42 | aria-haspopup="true" aria-expanded="false">
|
---|
43 | Functions - Reservations
|
---|
44 | </a>
|
---|
45 | <div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
---|
46 | <a class="dropdown-item" href="/admin-scheduled-reservations">Scheduled Reservations</a>
|
---|
47 | <a class="dropdown-item" href="/admin-schedule-reservation">Schedule reservation</a>
|
---|
48 | <div class="dropdown-divider"></div>
|
---|
49 | <a class="dropdown-item" href="/admin-get-blocked-reservations">Blocked reservations</a>
|
---|
50 | <a class="dropdown-item" href="/admin-block-reservation">Block reservation</a>
|
---|
51 | </div>
|
---|
52 | </li>
|
---|
53 |
|
---|
54 | <li class="nav-item dropdown">
|
---|
55 | <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
|
---|
56 | aria-haspopup="true" aria-expanded="false">
|
---|
57 | Functions - Orders
|
---|
58 | </a>
|
---|
59 | <div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
---|
60 | <a class="dropdown-item" href="/admin-get-orders">Ordered Products</a>
|
---|
61 | <a class="dropdown-item" href="/admin-add-product">Add product</a>
|
---|
62 | <a class="dropdown-item" href="/admin-remove-product">Remove product</a>
|
---|
63 | </div>
|
---|
64 | </li>
|
---|
65 |
|
---|
66 | </ul>
|
---|
67 | <form class="form-inline my-2 my-lg-0" method="get" action="/logout">
|
---|
68 | <button class="btn btn-outline-info my-2 my-sm-0" type="submit">Log out</button>
|
---|
69 | </form>
|
---|
70 | </div>
|
---|
71 | </nav>
|
---|
72 | <br>
|
---|
73 |
|
---|
74 | <table class="table table-striped">
|
---|
75 | <thead>
|
---|
76 | <tr>
|
---|
77 | <th scope="col">Name/Surname</th>
|
---|
78 | <th scope="col">Date/Time</th>
|
---|
79 | <th scope="col">Type</th>
|
---|
80 | <th scope="col">Valid</th>
|
---|
81 | <th scope="col">Cancel</th>
|
---|
82 | </tr>
|
---|
83 | </thead>
|
---|
84 | <tbody>
|
---|
85 | <#if reservations??>
|
---|
86 | <#list reservations as res>
|
---|
87 | <tr>
|
---|
88 | <td>${res['name']} ${res['surname']}</td>
|
---|
89 | <td>${res['localDateTime']}</td>
|
---|
90 | <td>${res['type']}</td>
|
---|
91 | <td id="valid" class="temp">${res['valid']?string("TRUE","FALSE")}</td>
|
---|
92 | <td>
|
---|
93 | <form method="post" action="/admin-cancel-reservation">
|
---|
94 | <input type="text" value="${res['id']}" name="id" hidden/>
|
---|
95 | <input type="text" value="${date}" name="date" hidden/>
|
---|
96 | <input type="text" value="${type}" name="type" hidden/>
|
---|
97 | <button type="submit" class="btn btn-primary">Cancel Reservation</button>
|
---|
98 | </form>
|
---|
99 | </td>
|
---|
100 | </tr>
|
---|
101 | </#list>
|
---|
102 | </#if>
|
---|
103 | </tbody>
|
---|
104 | </table>
|
---|
105 | <script>
|
---|
106 | let element = document.getElementsByClassName("temp")
|
---|
107 | for (let i = 0; i < element.length; i++) {
|
---|
108 | if (element[i].innerText === "TRUE") {
|
---|
109 | element[i].style.color = 'blue'
|
---|
110 | } else {
|
---|
111 | element[i].style.color = 'red'
|
---|
112 | }
|
---|
113 | }
|
---|
114 |
|
---|
115 | </script>
|
---|
116 | <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
|
---|
117 | integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
|
---|
118 | crossorigin="anonymous"></script>
|
---|
119 | <script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js"
|
---|
120 | integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
|
---|
121 | crossorigin="anonymous"></script>
|
---|
122 | <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js"
|
---|
123 | integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
|
---|
124 | crossorigin="anonymous"></script>
|
---|
125 | <script
|
---|
126 | type="text/javascript"
|
---|
127 | src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/5.0.0/mdb.min.js"
|
---|
128 | ></script>
|
---|
129 | </body>
|
---|
130 | </html> |
---|