<div class="wrap chainpay-admin">
    <h1>Subscriptions</h1>
    
    <div class="chainpay-stats">
        <span>Total: <strong><?php echo esc_html($total); ?></strong></span>
        <span>Active: <strong><?php echo esc_html($active); ?></strong></span>
        <span>Canceled: <strong><?php echo esc_html($canceled); ?></strong></span>
    </div>
    
    <table class="wp-list-table widefat fixed striped">
        <thead><tr><th>ID</th><th>Email</th><th>Plan</th><th>Amount</th><th>Status</th><th>Next Billing</th><th>Created</th></tr></thead>
        <tbody>
            <?php if (empty($subscriptions)): ?>
                <tr><td colspan="7">No subscriptions found.</td></tr>
            <?php else: ?>
                <?php foreach ($subscriptions as $sub): ?>
                <tr>
                    <td><code><?php echo esc_html($sub->subscription_id); ?></code></td>
                    <td><?php echo esc_html($sub->user_email); ?></td>
                    <td><?php echo esc_html($sub->plan_name); ?></td>
                    <td>$<?php echo number_format($sub->amount, 2); ?></td>
                    <td><span class="status-<?php echo esc_attr($sub->status); ?>"><?php echo esc_html(ucfirst($sub->status)); ?></span></td>
                    <td><?php echo esc_html($sub->next_billing_date); ?></td>
                    <td><?php echo esc_html($sub->created_at); ?></td>
                </tr>
                <?php endforeach; ?>
            <?php endif; ?>
        </tbody>
    </table>
</div>
