Code:
$insertOrderSql = "INSERT INTO " . TABLE_ORDERS .
"(orders_id, customers_id, customers_name, payment_method, payment_module_code, shipping_method, shipping_module_code, date_purchased, orders_status, currency, currency_value, order_cogs, order_total, order_tax)" .
" VALUES ('".$newoID."','429', 'Amazon Gmail Import','Amazon Payments', 'amazon', 'Store Pickup (Walk In)', 'storepickup', '" . $newdate . "', 1, 'USD', '1.000000', '".$_POST['Cogs']."', '".$_POST['SoldFor']."', '0.0000');";
$insertOrdersTotalsSubsql = "INSERT INTO " . TABLE_ORDERS_TOTAL .
"(orders_id, title, text, value, class, sort_order)" .
" VALUES ('". $newoID . "', 'Sub-Total:', '$".$_POST['SoldFor']. "', '".$_POST['SoldFor']. "', 'ot_subtotal', '100');";
$insertOrdersTotalsShipSql = "INSERT INTO " . TABLE_ORDERS_TOTAL .
"(orders_id, title, text, value, class, sort_order)" .
" VALUES ('". $newoID . "', 'Amazon Shipping:', '$".$_POST['Ship']. "', '".$_POST['Ship']. "', 'ot_shipping', '200');";
$insertOrdersTotalsSql = "INSERT INTO " . TABLE_ORDERS_TOTAL .
"(orders_id, title, text, value, class, sort_order)" .
" VALUES ('". $newoID . "', 'Total:', '$".$_POST['SoldFor']. "', '".$_POST['SoldFor']. "', 'ot_total', '999');";
$insertOrdersStatusSql = "INSERT INTO " . TABLE_ORDERS_STATUS_HISTORY .
"(orders_id, orders_status_id, date_added, comments)" .
" VALUES ('". $newoID . "', '3', '" . $newdate . "', '" . $orderData . "');";
$insertOrdersProdsSql = "INSERT INTO " . TABLE_ORDERS_PRODUCTS .
"(orders_id, products_id, products_model, products_name, products_price, products_cost, final_price, products_tax, products_quantity)" .
" VALUES ('". $newoID . "', '".$_POST['Pid']."', '".$_POST['Model']. "', '".$_POST['Skus']. "', '".$_POST['SoldFor']. "', '".$_POST['Cogs']. "', '".$_POST['SoldFor']. "', '0.0000', '".$_POST['Quan']. "');";
$insertOrdersAmazonSql = "INSERT INTO `orders_amazon` " .
"(orders_id, orders_id_amazon, orders_amazon_status, orders_amazon_earnings, orders_amazon_shipping)" .
" VALUES ('".$newoID."','".$_POST['AmazonOrderId']."', '".$status."','".$_POST['Earn']."', '".$valueShipWePaid."');";
...followed by the respective globe db->execute's ...is just setting the orderID/$oID
Bookmarks