<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Uniform Sales</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 20px;
            background-color: #f5f7fa;
        }
        .container {
            max-width: 1000px;
            margin: 0 auto;
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        h2 {
            color: #3c8dbc;
            margin-bottom: 15px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 10px;
        }
        th, td {
            padding: 12px 15px;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }
        th {
            background-color: #3c8dbc;
            color: white;
        }
        tr:hover {
            background-color: #f5f5f5;
        }
        .total-row {
            font-weight: bold;
            background-color: #e8f4fc;
        }
    </style>
</head>
<body>
    <div class="container">
        <h2>Uniform Sales</h2>
        <table id="uniformTable">
            <thead>
                <tr>
                    <th>Item Code</th>
                    <th>Description</th>
                    <th>Quantity</th>
                    <th>Amount ($)</th>
                    <th>Total ($)</th>
                </tr>
            </thead>
            <tbody>
                <!-- Data will be populated here -->
            </tbody>
        </table>
    </div>

    <script>
        // Sample data - replace with your actual data source
        const uniformData = [
            { code: "UNF-001", name: "Boys White Shirt", quantity: 50, amount: 25.00 },
            { code: "UNF-002", name: "Girls White Blouse", quantity: 45, amount: 28.00 },
            { code: "UNF-003", name: "Navy Blue Trousers", quantity: 40, amount: 35.00 },
            { code: "UNF-004", name: "School Blazer", quantity: 30, amount: 85.00 },
            { code: "UNF-005", name: "Sports T-Shirt", quantity: 60, amount: 20.00 }
        ];

        // Function to populate the table
        function populateTable() {
            const tableBody = document.querySelector('#uniformTable tbody');
            let grandTotal = 0;
            
            uniformData.forEach(item => {
                const total = item.quantity * item.amount;
                grandTotal += total;
                
                const row = document.createElement('tr');
                row.innerHTML = `
                    <td>${item.code}</td>
                    <td>${item.name}</td>
                    <td>${item.quantity}</td>
                    <td>${item.amount.toFixed(2)}</td>
                    <td>${total.toFixed(2)}</td>
                `;
                tableBody.appendChild(row);
            });
            
            // Add grand total row
            const totalRow = document.createElement('tr');
            totalRow.className = 'total-row';
            totalRow.innerHTML = `
                <td colspan="4" style="text-align: right;">Grand Total:</td>
                <td>${grandTotal.toFixed(2)}</td>
            `;
            tableBody.appendChild(totalRow);
        }

        // Populate table when page loads
        window.onload = populateTable;
    </script>
</body>
</html>