←':''; //Check if allowed if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){ header('location: index.php'); exit; } //GET PARAMETERS && STORE in SESSION for FURTHER USE/NAVIGATION $pagination_page = $_SESSION['p'] = isset($_GET['p']) ? $_GET['p'] : 1; //PAGE Security $page_manage = 'order_manage'; $update_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'U'); $update_allowed_edit = isAllowed($page_manage ,$_SESSION['profile'],$_SESSION['permission'],'U'); $delete_allowed = isAllowed($page_manage ,$_SESSION['profile'],$_SESSION['permission'],'D'); $create_allowed = isAllowed($page_manage ,$_SESSION['profile'],$_SESSION['permission'],'C'); //GET Details from URL $_GET['list'] = 'order'; $GET_VALUES = urlGETdetails($_GET) ?? ''; //CALL TO API $api_url = '/v2/transactions/'.$GET_VALUES; $order = ioServer($api_url,''); //Decode Payload if (!empty($order)){$order = json_decode($order,true);}else{$order = null;} // Handle success messages if (isset($_GET['success_msg'])) { if ($_GET['success_msg'] == 1) { $success_msg = $message_order_1 ?? 'Created'; } if ($_GET['success_msg'] == 2) { $success_msg = $message_order_2 ?? 'Updated'; } if ($_GET['success_msg'] == 3) { $success_msg = $message_order_3 ?? 'Deleted' ; } } template_header('order', 'order', 'view'); $view = '
'.$success_msg.'
' . $order['header']['id'] . '
' . $order['header']['txn_id'] . '
' . htmlspecialchars($order['header']['shipping_method'], ENT_QUOTES) . '
' . (${$payment_method} ?? $order['header']['payment_method'] ). '
' . (${$payment_status} ?? $order['header']['payment_status'] ). '
'.getRelativeTime($order['header']['created']). '
' . htmlspecialchars($order['header']['discount_code'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['name'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['street'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['city'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['state'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['zip'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['country'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['phone'], ENT_QUOTES) . '
The order is not associated with an account.
'; } $view .='' . htmlspecialchars($order['customer']['email'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['name'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['street'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['city'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['state'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['zip'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['country'], ENT_QUOTES) . '
' . htmlspecialchars($order['customer']['phone'], ENT_QUOTES) . '
| Product | Options | Qty | Price | Total |
| There are no order items | ||||
| ' . ($item['product_name'] ? htmlspecialchars(${$item['product_name']} ?? $item['product_name'] , ENT_QUOTES) : '(Product ' . $item['item_id'] . ')') . ' | ' . ($item['options'] ? htmlspecialchars(implode(", ", $item['options']), ENT_QUOTES) : '--') . ' | ' . $item['quantity'] . ' | ' . number_format($item['price'], 2) . ' | ' . number_format($item['line_total'], 2) . ' |
| Subtotal | ' . number_format($order['pricing']['subtotal'], 2) . ' | |||
| Shipping | ' . number_format($order['pricing']['shipping_total'], 2) . ' | |||
| Discount | ' . number_format($order['pricing']['discount_total'], 2) . ' | |||
| VAT | ' . number_format($order['pricing']['tax_total'], 2) . ' | |||
| Total | ' . number_format($order['pricing']['payment_amount'], 2) . ' | |||
| Giftcard | Valid | Value | ||
| There are no order items | ||||
| ' . $giftcard['discount_code'] . ' | ' . ($current_date >= strtotime($giftcard['start_date']) && $current_date <= strtotime($giftcard['end_date']) ? 'Yes' : 'No') . ' | ' . number_format($giftcard['discount_value'], 2) . ' | ||