prepare('SELECT ti.*, p.productcode, p.name FROM transactions t JOIN transactions_items ti ON ti.txn_id = t.txn_id LEFT JOIN products p ON p.id = ti.item_id WHERE t.id = ?'); $stmt->execute([ $_GET['id'] ]); $order_items = $stmt->fetchAll(PDO::FETCH_ASSOC); // Retrieve order details $stmt = $pdo->prepare('SELECT a.email, a.id AS a_id, a.first_name AS a_first_name, a.last_name AS a_last_name, a.address_street AS a_address_street, a.address_city AS a_address_city, a.address_state AS a_address_state, a.address_zip AS a_address_zip, a.address_country AS a_address_country, a.address_phone AS a_address_phone, t.* FROM transactions t LEFT JOIN transactions_items ti ON ti.txn_id = t.txn_id LEFT JOIN accounts a ON a.id = t.account_id WHERE t.id = ?'); $stmt->execute([ $_GET['id'] ]); $order = $stmt->fetch(PDO::FETCH_ASSOC); // Get tax $stmt = $pdo->prepare('SELECT * FROM taxes WHERE country = ?'); $stmt->execute([$order['a_address_country']]); $tax = $stmt->fetch(PDO::FETCH_ASSOC); $tax_rate = $tax ? $tax['rate'] : 0.00; //Add giftcards if (isset($_GET['add_giftcard'])){ createGiftCart($pdo, $order['txn_id']); } //Get connected giftcards $giftcards_template = $order['txn_id'].'#%#%'; $stmt = $pdo->prepare('SELECT * from discounts WHERE discount_code like ?'); $stmt->execute([$giftcards_template]); $giftcards = $stmt->fetchAll(PDO::FETCH_ASSOC); // Get the current date $current_date = strtotime((new DateTime())->format('Y-m-d H:i:s')); // Delete transaction if (isset($_GET['delete'])) { // Delete the transaction $stmt = $pdo->prepare('DELETE t, ti FROM transactions t LEFT JOIN transactions_items ti ON ti.txn_id = t.txn_id WHERE t.id = ?'); $stmt->execute([ $_GET['id'] ]); // Deactive giftcards removeGiftCart($pdo, $_GET['txn']); header('Location: index.php?page=orders&success_msg=3'); exit; } if (!$order) { exit('Invalid ID!'); } ?>

Order #

Cancel Delete Edit
Order Details

Order ID

Transaction ID

Shipping Method

Payment Method

Payment Status

Date

Discount Code

Account Details

Email

Name

Address





Contact

The order is not associated with an account.

Customer Details

Email

Name

Address





Contact

Order
Product Options Qty Price Total
There are no order items
Subtotal
Shipping
Discount
VAT
Total
Giftcards
Relate giftcards
Giftcard Valid Value
There are no order items
= strtotime($giftcard['start_date']) && $current_date <= strtotime($giftcard['end_date']) ? 'Yes' : 'No'?>
Invoice