Prev | Current Page 654 | Next

Emilian Balanescu and Cristian Darie

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

..
if (isset ($_GET['submitOrdersByStatus']))
{
$this->mSelectedStatus = $_GET['status'];
$this->mOrders = Orders::GetOrdersByStatus($this->mSelectedStatus);
}
// If the "Show orders by customer ID" filter is in action ...
if (isset ($_GET['submitByCustomer']))
{
if (empty ($_GET['customer_id']))
$this->mErrorMessage = 'No customer has been selected';
else
{
$this->mCustomerId = $_GET['customer_id'];
$this->mOrders = Orders::GetByCustomerId($this->mCustomerId);
}
}
// If the "Get order by ID" filter is in action ...
if (isset ($_GET['submitByOrderId']))
{
if (empty ($_GET['orderId']))
$this->mErrorMessage = 'You must enter an order ID.';
else
{
$this->mOrderId = $_GET['orderId'];
$this->mOrders = Orders::GetOrderShortDetails($this->mOrderId);
}
}
$this->mCustomers = Customer::GetCustomersList();
if (is_array($this->mOrders) && count($this->mOrders) == 0)
$this->mErrorMessage =
'No orders found matching your searching criteria!';
4. Add a new member to the AdminOrderDetails class in presentation/admin_order_details.php:
public $mLinkToAdmin;
public $mLinkToOrdersAdmin;
public $mCustomerInfo;
CHAPTER 17 ?–  STORING CUSTOMER ORDERS 556
5. Modify the line that updates an order in the init() method of AdminOrderDetails as highlighted:
// Initializes class members
public function init()
{
if (isset ($_GET['submitUpdate']))
{
Orders::UpdateOrder($this->mOrderId, $_GET['status'],
$_GET['comments'], $_GET['authCode'], $_GET['reference']);
}
6.


Pages:
642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666
matchbox sklep Futro mieszkania szczecin geovision meble drewniane