-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorder.jsp
More file actions
55 lines (51 loc) · 2.15 KB
/
order.jsp
File metadata and controls
55 lines (51 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<title>Оформление заказа</title>
</head>
<body>
<h1>Оформление заказа</h1>
<!-- Форма оформления заказа -->
<form action="/order" method="post">
<!-- Данные заказчика -->
<label>Имя: <input type="text" name="name" required></label><br>
<label>Телефон: <input type="text" name="phone" required></label><br>
<label>Адрес: <textarea name="address" required></textarea></label><br>
<!-- Данные о доставке и оплате -->
<label>Способ доставки:
<select name="delivery">
<option value="courier">Курьер</option>
<option value="pickup">Самовывоз</option>
</select>
</label><br>
<label>Способ оплаты:
<select name="payment">
<option value="card">Банковская карта</option>
<option value="cash">Наличными</option>
</select>
</label><br>
<!-- Список товаров -->
<h2>Состав заказа</h2>
<table border="1">
<tr>
<th>Название</th>
<th>Цена</th>
<th>Количество</th>
<th>Сумма</th>
</tr>
<c:forEach var="entry" items="${cart.products}">
<tr>
<td>${entry.value.name}</td>
<td>${entry.value.price}</td>
<td>${cart.quantities[entry.key]}</td>
<td>${entry.value.price * cart.quantities[entry.key]}</td>
</tr>
</c:forEach>
</table>
<h3>Итого: <fmt:formatNumber value="${cart.totalPrice}" pattern="#,###.##" /> руб.</h3>
<input type="submit" value="Оформить заказ">
</form>
</body>
</html>