File size: 2,249 Bytes
a593a1f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!-- templates/admin/orders.html -->
{% extends 'admin/layout.html' %}

{% block content %}
<div class="bg-white rounded-2xl shadow-lg p-8 mb-32 max-w-7xl mx-auto">
    <h1 class="text-4xl font-bold text-[var(--main-green)] mb-8">Order Management</h1>
    
    <div class="overflow-x-auto rounded-xl border border-gray-200">
        <table class="min-w-full bg-white text-sm">
            <thead class="bg-[var(--main-green)] text-white uppercase text-left">
                <tr>
                    <th class="py-3 px-4">Order ID</th>
                    <th class="py-3 px-4">Date</th>
                    <th class="py-3 px-4">Customer</th>
                    <th class="py-3 px-4">Product</th>
                    <th class="py-3 px-4">Quantity</th>
                    <th class="py-3 px-4">Total</th>
                    <th class="py-3 px-4">Payment</th>
                    <th class="py-3 px-4">Contact</th>
                </tr>
            </thead>
            <tbody>
                {% for order in orders %}
                <tr class="border-b hover:bg-gray-50 transition">
                    <td class="py-3 px-4 font-medium">{{ order.id }}</td>
                    <td class="py-3 px-4">{{ order.order_date.strftime('%Y-%m-%d %H:%M') }}</td>
                    <td class="py-3 px-4">
                        <div class="font-semibold">{{ order.customer_name }}</div>
                        <div class="text-gray-500 text-xs">{{ order.address }}</div>
                    </td>
                    <td class="py-3 px-4">
                        <div class="font-semibold">{{ order.product_name }}</div>
                        <div class="text-gray-500 text-xs">{{ order.category|capitalize }}</div>
                    </td>
                    <td class="py-3 px-4">{{ order.quantity }}</td>
                    <td class="py-3 px-4 text-green-700 font-semibold">₹{{ "%.2f"|format(order.price * order.quantity) }}</td>
                    <td class="py-3 px-4">{{ order.payment_method }}</td>
                    <td class="py-3 px-4">{{ order.mobile }}</td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}