"; $g_objDB->ExecuteSQL($strSQL, 0, $sclUpdateID, "Delete unshipped order items"); if($g_objDB->HasError()) $g_objDB->DisplayError(__FILE__, __LINE__, "Delete unshipped order items failed"); else { if($f_strStatus == "PARTIAL") { if(SettleOrderPayment($f_intOrderID) == true) { $strSQL = "UPDATE tblOrderData SET fldStatus='SHIPPED' WHERE fldOrderID=$f_intOrderID"; } else { include "bottom.phtml"; exit; } } else { $strSQL ="SELECT * FROM tblShipments WHERE fldOrderID=$f_intOrderID"; //print $strSQL."
"; $sclShResultID = $g_objDB->GetFirstRowOfSet($strSQL, &$ascShResult, SQL_GET_ROW_COUNT, "Get Shipment Date"); if((!$g_objDB->HasError()) && ($g_objDB->GetRowCount($sclShResultID) > 0)) StatisticsCounter("Sales", "decrement", $ascShResult['fldShipDate']); $strSQL = "DELETE FROM tblOrderData WHERE fldOrderID=$f_intOrderID"; } //print $strSQL."
"; $g_objDB->ExecuteSQL($strSQL, 0, $sclUpdateID, "Delete or Update Order."); if($g_objDB->HasError()) $g_objDB->DisplayError(__FILE__, __LINE__, "Delete or Update Order Failed"); // Don't delete tblPayment record : //$strSQL = "DELETE FROM tblPayment WHERE fldTransactionID='$f_strTransID'"; $strSQL = "DELETE FROM tblCreditCard WHERE fldOrderID=$f_intOrderID"; $g_objDB->ExecuteSQL($strSQL, 0, &$sclDeleteID, "Delete Credit Card Data"); // Ignore errors, credit card record may not be present //if($g_objDB->HasError()) // $g_objDB->DisplayError(__FILE__, __LINE__, "Delete Credit Card Data Failed"); ?>

All unshipped order items have been cancelled.
 
"; $sclCustResultID = $g_objDB->GetFirstRowOfSet($strSQL, &$ascCustResult, SQL_GET_ROW_COUNT, "Get CustomerID"); if(!$g_objDB->HasError()) { if($g_objDB->GetRowCount($sclCustResultID) == 1) { $intCustomerID = $ascCustResult['fldCustomerID']; } else { $intCustomerID = 0; } } } } if(isset($g_intOrderID) && ($g_intOrderID != "") && // NOSCRIPT compatible ((!isset($f_intOrderID)) || ($f_intOrderID != ""))) $f_intOrderID = $g_intOrderID; if(isset($f_intOrderID) && ($f_intOrderID != "")) { if(isset($intCustomerID) && ($intCustomerID != 0)) $strSQL ="SELECT * FROM tblOrderData WHERE fldOrderID=$f_intOrderID AND fldCustomerID=$intCustomerID"; else $strSQL ="SELECT * FROM tblOrderData WHERE fldOrderID=$f_intOrderID"; //print $strSQL."
"; $sclOrResultID = $g_objDB->GetFirstRowOfSet($strSQL, &$ascOrResult, SQL_GET_ROW_COUNT, "Get order data"); $intRowCount = 0; if(!$g_objDB->HasError()) $intRowCount = $g_objDB->GetRowCount($sclOrResultID); if($intRowCount == 0) { ?>

Order # could not be found or does not exist.

View Status of Order

GetAllRows($strSQL, &$ascShResult, &$blnMoreRows, SQL_GET_ROW_COUNT, &$sclShResultID, "Get More pending orders"); if($g_objDB->HasError()) $g_objDB->DisplayError(__FILE__, __LINE__, "Get Shipment Items Failed"); else $intShRowCount = $g_objDB->GetRowCount($sclShResultID); // Now get any product data that may have been removed from their sale items - discontinued $strSQL = "SELECT sh.fldShipmentID, sh.fldProductID, sh.fldQuantity, pr.ProductName, sh.fldUnitPrice, pr.weight FROM tblShipItems sh, tblProductDel pr WHERE sh.fldOrderID=$f_intOrderID AND pr.ProductID=sh.fldProductID"; $g_objDB->LogIt($strSQL."\n"); //print $strSQL."
"; $sclDelResultID = 0; $g_objDB->GetAllRows($strSQL, &$ascDelResult, &$blnMoreRows, SQL_GET_ROW_COUNT, &$sclDelResultID, "Get All Order Items"); if(!$g_objDB->HasError()) { $intDelRowCount = $g_objDB->GetRowCount($sclDelResultID); $intCurRow = 0; while($intCurRow < $intDelRowCount) { $ascShResult[$intShRowCount] = $ascDelResult[$intCurRow]; $intCurRow++; $intShRowCount++; // Another product in list } if($intCurRow > 0) $g_objDB->FreeResults($sclDelResultID); } //$strActionURL = $g_strSecureURL.$g_strViewOrderURL; $strActionURL = $g_strViewOrderURL; ?>
0) { $strStatus = "SHIPPED"; $blnShipped = true; } else { $strStatus = "PENDING"; $blnCancelOK = true; } ?> 0)) { $strSQL = "SELECT * FROM tblPayment WHERE fldPaymentID=".$ascOrResult['fldPaymentID']; $sclPayResultID = $g_objDB->GetFirstRowOfSet($strSQL, &$ascPayResult, SQL_GET_ROW_COUNT, "Get Payment Data"); if($g_objDB->HasError()) { $g_objDB->DisplayError(__FILE__, __LINE__, "Get Payment Data Failed"); include "bottom.phtml"; exit; } if(!($intPayRowCount = $g_objDB->GetRowCount($sclPayResultID))) $ascPayResult['fldAmount'] = 0.0; } ?> GetAllRows($strSQL, &$ascChildPayResult, &$blnMoreRows, SQL_GET_ROW_COUNT, &$sclChildPayResultID, "Look for any child payments"); if($g_objDB->HasError()) { $g_objDB->DisplayError(__FILE__, __LINE__, "Getting child payment data failed"); include "bottom.phtml"; exit; } if($g_objDB->GetRowCount($sclChildPayResultID) > 0) { ?> GetFirstRowOfSet($strSQL, &$ascShipResult, SQL_GET_ROW_COUNT, "Get Shippers"); if($g_objDB->HasError()) { $g_objDB->DisplayError(__FILE__, __LINE__, "Get Shippers Failed"); } if(($intShipCount = $g_objDB->GetRowCount($sclShipResultID))) { $intCurShip = 0; ?> FreeResults($sclShipResultID); } ?> FreeResults($sclPayResultID); unset($ascPayResult); } if($blnCancelOK == true) { ?>
Order Number
Product Name Product ID Quantity Status
 
TAX :
SHIPPING :
TOTAL BILLED AMOUNT :
ORDER DATE :
SHIP DATE : "; $sclShResultID = $g_objDB->GetFirstRowOfSet($strSQL, &$ascShResult, SQL_GET_ROW_COUNT, "Get Shipment Date"); if((!$g_objDB->HasError()) && ($g_objDB->GetRowCount($sclShResultID) > 0)) print $ascShResult['fldShipDate']; else print "UNKNOWN"; ?>
PAYMENT TRANSACTION ID :
AUTHORIZATION CODE :
TRANSACTION ORDER ID :


The payment settlement failed and therefore, final shipment of the order is on hold pending resolution of the problems.
SHIP USING :
SHIP TO : "; $strSQL = "SELECT addr.fldCompany,addr.fldStreet1,addr.fldStreet2,addr.fldCity,addr.fldRegion,addr.fldPostCode,addr.fldCountry,cust.fldFirstName,cust.fldLastName,cust.fldEmail FROM tblCustomer cust, tblAddress addr WHERE cust.fldCustomerID=".$ascOrResult['fldShipToID']." AND addr.fldAddressID=cust.fldAddressID"; $sclAddrResultID = $g_objDB->GetFirstRowOfSet($strSQL, &$ascAddrResult, SQL_GET_ROW_COUNT, "Get Customer Address"); if((!$g_objDB->HasError()) && $g_objDB->GetRowCount($sclAddrResultID)) { $strCompany = $ascAddrResult['fldCompany']; $strAddress1 = $ascAddrResult['fldStreet1']; $strAddress2 = $ascAddrResult['fldStreet2']; $strCity = $ascAddrResult['fldCity']; $strRegion = $ascAddrResult['fldRegion']; $strPostalCode = $ascAddrResult['fldPostCode']; $strCountry = $ascAddrResult['fldCountry']; $strFirstName = $ascAddrResult['fldFirstName']; $strLastName = $ascAddrResult['fldLastName']; $strCustEmail = $ascAddrResult['fldEmail']; print ($strFirstName." ".$strLastName) ?>





FreeResults($sclAddrResultID); } ?>
BILL TO : "; $strSQL = "SELECT addr.fldCompany,addr.fldStreet1,addr.fldStreet2,addr.fldCity,addr.fldRegion,addr.fldPostCode,addr.fldCountry,cust.fldFirstName,cust.fldLastName,cust.fldEmail FROM tblCustomer cust, tblAddress addr WHERE cust.fldCustomerID=".$ascOrResult['fldCustomerID']." AND addr.fldAddressID=cust.fldAddressID"; $g_objDB->LogIt($strSQL."\n"); $sclAddrResultID = $g_objDB->GetFirstRowOfSet($strSQL, &$ascAddrResult, SQL_GET_ROW_COUNT, "Get Customer Address"); if((!$g_objDB->HasError()) && $g_objDB->GetRowCount($sclAddrResultID)) { $strCompany = $ascAddrResult['fldCompany']; $strAddress1 = $ascAddrResult['fldStreet1']; $strAddress2 = $ascAddrResult['fldStreet2']; $strCity = $ascAddrResult['fldCity']; $strRegion = $ascAddrResult['fldRegion']; $strPostalCode = $ascAddrResult['fldPostCode']; $strCountry = $ascAddrResult['fldCountry']; $strFirstName = $ascAddrResult['fldFirstName']; $strLastName = $ascAddrResult['fldLastName']; $strCustEmail = $ascAddrResult['fldEmail']; print ($strFirstName." ".$strLastName) ?>





FreeResults($sclAddrResultID); } ?>
CUSTOMER'S COMMENTS :  
MERCHANT'S MESSAGE :  
"; $sclCountryResultID = $g_objDB->GetFirstRowOfSet($strSQL, &$ascCountryResult, SQL_GET_ROW_COUNT, "Get UPS Country"); if($g_objDB->HasError()) { $g_objDB->DisplayError(__FILE__, __LINE__, "Get UPS Country Failed"); } if($g_objDB->GetRowCount($sclCountryResultID)) { $strShipCountry = $ascCountryResult['fldCountryUPS']; $g_objDB->FreeResults($sclCountryResultID); } else $strShipCountry = $strCountry; ?>
 

 

FreeResults($sclShResultID); } include "bottom.phtml"; ?>