Prev | Current Page 682 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

php:
// Creates audit record
public static function CreateAudit($orderId, $message, $code)
{
// Build the SQL query
$sql = 'CALL orders_create_audit(:order_id, :message, :code)';
// Build the parameters array
$params = array (':order_id' => $orderId,
':message' => $message,
':code' => $code);
// Execute the query
DatabaseHandler::Execute($sql, $params);
}
5. Add a new file to the business directory called order_processor.php with the following code:
/* Main class, used to obtain order information,
run pipeline sections, audit orders, etc. */
class OrderProcessor
{
public $mOrderInfo;
public $mOrderDetailsInfo;
public $mCustomerInfo;
public $mContinueNow;
private $_mCurrentPipelineSection;
private $_mOrderProcessStage;
// Class constructor
public function __construct($orderId)
{
// Get order
$this->mOrderInfo = Orders::GetOrderInfo($orderId);
CHAPTER 18 ?–  IMPLEMENTING THE ORDER PIPELINE: PART 1 576
if (empty ($this->mOrderInfo['shipping_id']))
$this->mOrderInfo['shipping_id'] = -1;
if (empty ($this->mOrderInfo['tax_id']))
$this->mOrderInfo['tax_id'] = -1;
// Get order details
$this->mOrderDetailsInfo = Orders::GetOrderDetails($orderId);
// Get customer associated with the processed order
$this->mCustomerInfo = Customer::Get($this->mOrderInfo['customer_id']);
$credit_card = new SecureCard();
$credit_card->LoadEncryptedDataAndDecrypt(
$this->mCustomerInfo['credit_card']);
$this->mCustomerInfo['credit_card'] = $credit_card;
}
/* Process is called from presentation/checkout_info.


Pages:
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694
Apartamenty Świnoujście noclegi hel Lokaty jednodniowe projekty domków letniskowych męskie skarpetki rowerowe