prepare('SELECT COUNT(DISTINCT t.id) AS total FROM transactions t LEFT JOIN transactions_items ti ON ti.txn_id = t.txn_id ' . $where); if ($search) $stmt->bindParam('search', $param3, PDO::PARAM_STR); if ($account_id) $stmt->bindParam('account_id', $account_id, PDO::PARAM_INT); $stmt->execute(); $orders_total = $stmt->fetchColumn(); // Retrieve transactions $stmt = $pdo->prepare('SELECT t.*, COUNT(ti.id) AS total_products FROM transactions t LEFT JOIN transactions_items ti ON ti.txn_id = t.txn_id ' . $where . ' 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 ' . $order_by . ' ' . $order . ' LIMIT :start_results,:num_results'); // Bind params $stmt->bindParam('start_results', $param1, PDO::PARAM_INT); $stmt->bindParam('num_results', $param2, PDO::PARAM_INT); if ($search) $stmt->bindParam('search', $param3, PDO::PARAM_STR); if ($account_id) $stmt->bindParam('account_id', $account_id, PDO::PARAM_INT); $stmt->execute(); // Retrieve query results $orders = $stmt->fetchAll(PDO::FETCH_ASSOC); // Determine the URL $url = 'index.php?page=orders&search=' . $search . '&status=' . $status . '&method=' . $method . '&account_id=' . $account_id; // Handle success messages if (isset($_GET['success_msg'])) { if ($_GET['success_msg'] == 1) { $success_msg = 'Order created successfully!'; } if ($_GET['success_msg'] == 2) { $success_msg = 'Order updated successfully!'; } if ($_GET['success_msg'] == 3) { $success_msg = 'Order deleted successfully!'; } } ?>

Orders

View, create, and search orders.

Create Order
Filters
# Customer Email Products Total Method Status Date Actions
There are no orders
View Edit