Spaces:
Sleeping
Sleeping
Update templates/order_history.html
Browse files- templates/order_history.html +99 -28
templates/order_history.html
CHANGED
@@ -5,38 +5,109 @@
|
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>Order History</title>
|
7 |
<style>
|
8 |
-
body {
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
</style>
|
14 |
</head>
|
15 |
<body>
|
16 |
-
|
17 |
-
|
18 |
-
<
|
19 |
-
|
20 |
-
|
21 |
-
<th>Order Details</th>
|
22 |
-
<th>Total Amount</th>
|
23 |
-
<th>Discount</th>
|
24 |
-
<th>Total Bill</th>
|
25 |
-
<th>Status</th>
|
26 |
-
</tr>
|
27 |
{% for order in orders %}
|
28 |
-
<
|
29 |
-
<
|
30 |
-
<
|
31 |
-
<
|
32 |
-
<
|
33 |
-
<
|
34 |
-
<
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
36 |
{% endfor %}
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
41 |
</body>
|
42 |
</html>
|
|
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>Order History</title>
|
7 |
<style>
|
8 |
+
body {
|
9 |
+
font-family: Arial, sans-serif;
|
10 |
+
background-color: #f8f9fa;
|
11 |
+
margin: 0;
|
12 |
+
padding: 0;
|
13 |
+
text-align: center;
|
14 |
+
}
|
15 |
+
|
16 |
+
.container {
|
17 |
+
max-width: 600px;
|
18 |
+
margin: 40px auto;
|
19 |
+
background: white;
|
20 |
+
padding: 20px;
|
21 |
+
border-radius: 10px;
|
22 |
+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
|
23 |
+
}
|
24 |
+
|
25 |
+
h2 {
|
26 |
+
color: #007bff;
|
27 |
+
margin-bottom: 20px;
|
28 |
+
}
|
29 |
+
|
30 |
+
.order-card {
|
31 |
+
background: #fff;
|
32 |
+
padding: 15px;
|
33 |
+
margin: 15px 0;
|
34 |
+
border-radius: 8px;
|
35 |
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
36 |
+
text-align: left;
|
37 |
+
}
|
38 |
+
|
39 |
+
.order-card p {
|
40 |
+
margin: 5px 0;
|
41 |
+
font-size: 14px;
|
42 |
+
}
|
43 |
+
|
44 |
+
.order-status {
|
45 |
+
font-weight: bold;
|
46 |
+
padding: 5px 10px;
|
47 |
+
border-radius: 5px;
|
48 |
+
display: inline-block;
|
49 |
+
}
|
50 |
+
|
51 |
+
.status-pending {
|
52 |
+
background-color: #ffc107;
|
53 |
+
color: #fff;
|
54 |
+
}
|
55 |
+
|
56 |
+
.status-completed {
|
57 |
+
background-color: #28a745;
|
58 |
+
color: #fff;
|
59 |
+
}
|
60 |
+
|
61 |
+
.status-cancelled {
|
62 |
+
background-color: #dc3545;
|
63 |
+
color: #fff;
|
64 |
+
}
|
65 |
+
|
66 |
+
.back-button {
|
67 |
+
display: block;
|
68 |
+
margin-top: 20px;
|
69 |
+
background-color: #007bff;
|
70 |
+
color: white;
|
71 |
+
padding: 10px 15px;
|
72 |
+
border: none;
|
73 |
+
border-radius: 5px;
|
74 |
+
font-size: 16px;
|
75 |
+
cursor: pointer;
|
76 |
+
text-decoration: none;
|
77 |
+
}
|
78 |
+
|
79 |
+
.back-button:hover {
|
80 |
+
background-color: #0056b3;
|
81 |
+
}
|
82 |
</style>
|
83 |
</head>
|
84 |
<body>
|
85 |
+
|
86 |
+
<div class="container">
|
87 |
+
<h2>Your Order History</h2>
|
88 |
+
|
89 |
+
{% if orders %}
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
{% for order in orders %}
|
91 |
+
<div class="order-card">
|
92 |
+
<p><strong>Date:</strong> {{ order['CreatedDate'][:10] }}</p>
|
93 |
+
<p><strong>Order:</strong> {{ order['Order_Details__c'] }}</p>
|
94 |
+
<p><strong>Total Amount:</strong> ${{ order['Total_Amount__c'] }}</p>
|
95 |
+
<p><strong>Discount:</strong> ${{ order['Discount__c'] }}</p>
|
96 |
+
<p><strong>Total Bill:</strong> ${{ order['Total_Bill__c'] }}</p>
|
97 |
+
<p class="order-status
|
98 |
+
{% if order['Order_Status__c'] == 'Pending' %}status-pending
|
99 |
+
{% elif order['Order_Status__c'] == 'Completed' %}status-completed
|
100 |
+
{% elif order['Order_Status__c'] == 'Cancelled' %}status-cancelled{% endif %}">
|
101 |
+
{{ order['Order_Status__c'] }}
|
102 |
+
</p>
|
103 |
+
</div>
|
104 |
{% endfor %}
|
105 |
+
{% else %}
|
106 |
+
<p>No past orders found.</p>
|
107 |
+
{% endif %}
|
108 |
+
|
109 |
+
<a href="{{ url_for('menu') }}" class="back-button">Back to Menu</a>
|
110 |
+
</div>
|
111 |
+
|
112 |
</body>
|
113 |
</html>
|