prepare('SELECT t.*, COUNT(ti.id) AS total_products FROM transactions t JOIN transactions_items ti ON ti.txn_id = t.txn_id WHERE cast(t.created as DATE) = cast(now() as DATE) GROUP BY t.id, t.txn_id, t.payment_amount, t.payment_status, t.created, t.payer_email, t.first_name, t.last_name, t.address_street, t.address_city, t.address_state, t.address_zip, t.address_country, t.account_id, t.payment_method, t.discount_code, t.shipping_method, t.shipping_amount ORDER BY t.created DESC'); $stmt->execute(); $orders = $stmt->fetchAll(PDO::FETCH_ASSOC); // Get the orders statistics $stmt = $pdo->prepare('SELECT SUM(payment_amount) AS earnings FROM transactions WHERE payment_status = "Completed" AND cast(created as DATE) = cast(now() as DATE)'); $stmt->execute(); $order_stats = $stmt->fetch(PDO::FETCH_ASSOC); // Get the total number of accounts $stmt = $pdo->prepare('SELECT COUNT(*) AS total FROM accounts'); $stmt->execute(); $accounts = $stmt->fetch(PDO::FETCH_ASSOC); // Get the total number of products $stmt = $pdo->prepare('SELECT COUNT(*) AS total FROM products'); $stmt->execute(); $products = $stmt->fetch(PDO::FETCH_ASSOC); ?> =template_admin_header('Dashboard', 'dashboard')?>
View statistics, today's transactions, and more.
=number_format(count($orders))?>
=currency_code?>=number_format($order_stats['earnings'] ?? 0, 2)?>
=number_format($accounts['total'])?>
=number_format($products['total'])?>
List of transactions for today.
| # | Customer | Products | Total | Method | Status | Date | Actions | |
| There are no recent orders | ||||||||
| =$order['id']?> | =htmlspecialchars($order['first_name'], ENT_QUOTES)?> =htmlspecialchars($order['last_name'], ENT_QUOTES)?> | =htmlspecialchars($order['payer_email'], ENT_QUOTES)?> | =$order['total_products']?> | =currency_code?>=number_format($order['payment_amount'], 2)?> | =$order['payment_method']?> | =$order['payment_status']?> | =date('F j, Y', strtotime($order['created']))?> | View Edit |