File size: 4,270 Bytes
fcda489
 
 
 
 
 
 
 
 
 
56d82eb
 
fcda489
 
 
 
 
56d82eb
fcda489
 
 
 
 
 
 
56d82eb
fcda489
56d82eb
fcda489
 
 
 
 
 
 
 
56d82eb
fcda489
 
 
 
 
 
 
 
56d82eb
fcda489
 
 
 
 
 
 
 
 
 
56d82eb
 
 
 
 
fcda489
 
 
 
56d82eb
fcda489
 
 
 
 
 
 
 
 
56d82eb
 
 
 
 
 
fcda489
 
 
 
 
 
 
 
56d82eb
 
 
 
 
 
 
 
 
 
 
 
 
 
fcda489
56d82eb
 
 
 
fcda489
 
56d82eb
 
fcda489
 
 
 
 
 
 
 
 
56d82eb
 
 
 
fcda489
 
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Previous Orders</title>
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #fdf4e3;
            color: #333333;
        }
        .order-container {
            max-width: 768px;
            margin: 40px auto;
            padding: 20px;
            background-color: #ffffff;
            border-radius: 15px;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
        }
        .cart-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background-color: #fffcf5;
            border-radius: 8px;
            border: 1px solid #ffe5b4;
            padding: 10px;
            margin-bottom: 10px;
        }
        .cart-item img {
            width: 70px;
            height: 70px;
            object-fit: cover;
            border-radius: 5px;
            border: 1px solid #ffcc80;
        }
        .cart-item-details {
            flex: 1;
            margin-left: 15px;
        }
        .cart-item-title {
            font-size: 1.2rem;
            font-weight: bold;
            color: #c04e01;
        }
        .cart-item-addons,
        .cart-item-instructions {
            font-size: 0.9rem;
            color: #6c757d;
        }
        .order-summary {
            text-align: right;
            margin-top: 15px;
        }
        .total-price {
            font-size: 1.5rem;
            font-weight: bold;
            color: #2b9348;
        }
        .back-to-menu {
            display: block;
            margin: 30px auto 10px auto;
            padding: 10px 20px;
            background-color: #ff5722;
            color: #ffffff;
            border: none;
            border-radius: 25px;
            font-size: 1rem;
            font-weight: bold;
            text-align: center;
            text-decoration: none;
            width: 100%;
        }
        footer {
            background-color: #333333;
            color: #ffffff;
            text-align: center;
            padding: 15px 10px;
            margin-top: auto;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="order-container">
            <h4 class="mb-4 text-center">Your Previous Orders</h4>

            {% if orders %}
                {% for order in orders %}
                    <div class="order-items">
                        <h5 class="text-center">Order Date: {{ order.order_date }}</h5>
                        {% for item in order.items %}
                            <div class="cart-item">
                                <!-- Item Image -->
                                <img src="{{ item.image }}" alt="{{ item.name }}" onerror="this.src='/static/placeholder.jpg';">
                                
                                <!-- Item Details -->
                                <div class="cart-item-details">
                                    <div class="cart-item-title">{{ item.name }}</div>
                                    <div class="cart-item-addons">Add-ons: {{ item.addons }}</div>
                                    <div class="cart-item-instructions">Instructions: {{ item.instructions }}</div>
                                </div>
                                
                                <!-- Price -->
                                <div class="cart-item-actions">
                                    <strong>{{ item.price }}</strong>
                                </div>
                            </div>
                        {% endfor %}
                    </div>
                {% endfor %}
            {% else %}
                <p class="text-center">No previous orders found.</p>
            {% endif %}

            <!-- Back to Menu Button -->
            <a href="/menu" class="back-to-menu">Back to Menu</a>
        </div>
    </div>

    <footer>
        <p>Thank you for dining with us! <span>We look forward to serving you again.</span></p>
    </footer>
</body>
</html>