<?php //view confirmation page $lib_path = $_SERVER['DOCUMENT_ROOT'] . '/lib/'; require_once $lib_path . 'EShopDb.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/standardfuncs.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/display_price.php'; @($pmt_id = $_GET['pmt_id']); if (!$pmt_id) { print "Invalid Page Access."; die; } $db_cart = EShopDb::inst(); $query = "SELECT paypal_transaction.line1, paypal_transaction.line2, paypal_transaction.city, paypal_transaction.postal_code, paypal_transaction.payer_email, cart_transactions.price, cart_transactions.id, cart_transactions.product_id_list, cart_transactions.quantity_list FROM cart_transactions LEFT JOIN paypal_transaction ON paypal_transaction.transaction_id=cart_transactions.id WHERE paypal_transaction.payment_id = ?"; $result = $db_cart->query($query, $pmt_id); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $line1 = $row['line1']; @($line2 = $row['line2']); $city = $row['city']; $postal_code = $row['postal_code']; $payer_email = $row['payer_email']; $price = '£' . $row['price']; $txn_id = $row['id']; $product_id_list = $row['product_id_list']; $quantity_list = $row['quantity_list']; } $product_ids = explode(';', $product_id_list); $quantities = explode(';', $quantity_list); $product_title_array = array(); $product_description_array = array(); $product_price_array = array();
<?php $docRoot = $_SERVER['DOCUMENT_ROOT']; require_once $docRoot . '/lib/EShopDb.php'; require_once $docRoot . '/inc/display_price.php'; $db_eshop = EShopDb::inst(); $id = (int) $_GET['id']; $productDisplay = ""; $optionTitle = array(); $optionDesc = array(); $optionId = array(); $sql_query = "SELECT * FROM products WHERE id=? LIMIT 1"; $sql_result = $db_eshop->query($sql_query, $id); if ($sql_result->rowCount() > 0) { while ($row = $sql_result->fetch(PDO::FETCH_ASSOC)) { $title = $row['title']; $price = $row['price']; $weight = $row['weight']; $allergyinfo = $row['allergyinfo']; $description = $row['description']; $category = $row['category']; $live = $row['live']; $option = $row['options']; $dateadded = $row['dateadded']; $extraimg = $row['extraimg']; $prevchoc = $row['preview_chocs']; $prevchocarray = explode(';', $prevchoc); //check for extra image and create preview image $previewImg = '<div class="extra-product-image"><img width="62" height="47" alt="' . $title . '" class="thumb" src="/images/chocolates/' . $category . '/' . $id . '.png">'; if ($extraimg == 1) { $previewImg .= '<img width="62" height="47" alt="' . $title . '" class="thumb" src="/images/chocolates/' . $category . '/' . $id . '_' . $id . '.png"></div>';