source: target/classes/templates/admin-schedule-reservation.ftl

Last change on this file was 0f3491d, checked in by makyjovanovsky <mjovanovski04@…>, 22 months ago

reservation

  • Property mode set to 100644
File size: 7.3 KB
Line 
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="UTF-8">
5 <title>Admin Page - Schedule Reservation</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
26 <script>
27 async function sendRequest() {
28 let date = document.getElementById("date").value;
29 let type = document.getElementById("type").value;
30 console.log(date)
31 const params = {
32 "date": String(date),
33 "type": String(type)
34 };
35 const options = {
36 method: 'POST',
37 body: JSON.stringify(params)
38 };
39 fetch('http://localhost:8080/reservation', options)
40 .then(response => response.json())
41 .then(response => {
42 console.log(response)
43 });
44
45 }
46 </script>
47</head>
48<body>
49
50<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
51 <a class="navbar-brand" href="#">Salon Bella</a>
52 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
53 <span class="navbar-toggler-icon"></span>
54 </button>
55
56 <div class="collapse navbar-collapse" id="navbarSupportedContent">
57 <ul class="navbar-nav mr-auto">
58 <li class="nav-item ">
59 <a class="nav-link" href="/adminDashboard">Home <span class="sr-only">(current)</span></a>
60 </li>
61
62 <li class="nav-item dropdown">
63 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
64 Functions - Reservations
65 </a>
66 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
67 <a class="dropdown-item" href="/admin-scheduled-reservations">Scheduled Reservations</a>
68 <a class="dropdown-item" href="/admin-schedule-reservation">Schedule reservation</a>
69 <div class="dropdown-divider"></div>
70 <a class="dropdown-item" href="/admin-get-blocked-reservations">Blocked reservations</a>
71 <a class="dropdown-item" href="/admin-block-reservation">Block reservation</a>
72 </div>
73 </li>
74
75 <li class="nav-item dropdown">
76 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
77 Functions - Orders
78 </a>
79 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
80 <a class="dropdown-item" href="/admin-get-orders">Ordered Products</a>
81 <a class="dropdown-item" href="/admin-add-product">Add product</a>
82 <a class="dropdown-item" href="/admin-remove-product">Remove product</a>
83 </div>
84 </li>
85
86 </ul>
87 <form class="form-inline my-2 my-lg-0" method="get" action="/logout">
88 <button class="btn btn-outline-info my-2 my-sm-0" type="submit">Log out</button>
89 </form>
90 </div>
91</nav>
92<br>
93<div class="h-100 d-flex align-items-center justify-content-center">
94 <form method="post" action="/admin-get-free-reservations">
95 <#if date??>
96 <div class="d-flex justify-content-center">
97 <input type="date" min="" name="date" id="date" value="${date}" required/>
98 </div>
99 <#else>
100 <div class="d-flex justify-content-center">
101 <input type="date" min="" name="date" id="date" required/>
102 </div>
103 </#if>
104
105 <br>
106 <div class="d-flex justify-content-center">
107 <select name="type" id="type" required>
108 <option value="NAILS">NAILS</option>
109 <option value="MAKEUP">MAKEUP</option>
110 <option value="WAXING">WAXING</option>
111 </select>
112 </div>
113 <br>
114
115 <button class="btn btn-primary" type="submit">Get Free Reservations</button>
116 </form>
117</div>
118<br>
119<div class="h-100 d-flex align-items-center justify-content-center">
120 <#if tip??>
121
122 <form method="post" action="/admin-make-reservation">
123 <div class="d-flex justify-content-center">
124 <input type="date" name="date" value="${date}" hidden/>
125 </div>
126
127 <div class="d-flex justify-content-center">
128 <select name="type" id="type" hidden>
129 <option value="NAILS">NAILS</option>
130 <option value="MAKEUP">MAKEUP</option>
131 <option value="WAXING">WAXING</option>
132 </select>
133 </div>
134
135 <div class="d-flex justify-content-center">
136 <#if free_reservations??>
137 <select name="time" id="time">
138 <#list free_reservations as reservation>
139 <option value="${reservation}">${reservation}</option>
140 </#list>
141 </select>
142 </#if>
143 </div>
144 <br>
145 <button class="btn btn-primary" type="submit">Reserve</button>
146 </form>
147 </#if>
148</div>
149
150
151
152<#if tip??>
153 <script>
154 let array = document.getElementsByTagName("option");
155 for (let i = 0; i < array.length; i++) {
156 if (array[i].value == "${tip}") {
157 array[i].setAttribute("selected", "");
158 }
159 }
160 </script>
161</#if>
162<script>
163 document.getElementById("date").setAttribute("min", new Date().toISOString().split('T')[0])
164</script>
165<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
166<script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
167<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
168<script
169 type="text/javascript"
170 src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/5.0.0/mdb.min.js"
171></script>
172</body>
173</html>
Note: See TracBrowser for help on using the repository browser.