window.location.href = "MyOrder.php?orderAction="+value;
	}
</script>
</head>
<body>
<?php 
global $customer;
global $orders;
global $order;
global $orderItems;
global $order_id;
$customer = $_SESSION["customer"];
$custId = $customer->CustId;
$oService = new OrderService();
$sql = "select o.*,(round(o.order_subtotal + ( o.order_gst * o.order_subtotal /100 ),2)) AS order_grandtotal\n\t\t from `order` o where o.order_customer_id = '" . $custId . "' order by o.order_id desc";
$orders = $oService->GetRows($sql);
if (isset($_GET["orderAction"])) {
    $order_id = $_GET["orderAction"];
} else {
    if ($orders) {
        $order_id = $orders[0]["order_id"];
    }
}
if ($order_id) {
    $itemService = new OrderItemService();
    $sql = "select o.*, round((o.item_quantity*o.item_price),2) as item_subtotal,h.hat_title from order_item o,hat h where o.item_hat_id=h.hat_id and item_order_id='" . $order_id . "'";
    $orderItems = $itemService->GetRows($sql);
}
?>
<div id="body_wrapper">
  <div id="wrapper">
	font-weight: bold;
	background-color: #404040; 
	border: 1px solid #fff; 
	color: #fff; 
	font-size:12px; 
	cursor: pointer;
}
</style>
</head>
<body>
<?php 
global $order;
$orderId = $_GET["order_id"];
$service = new OrderService();
$sql = "select *, (round(o.order_subtotal + ( o.order_gst * o.order_subtotal /100 ),2)) AS order_grandtotal from `order` o,customer c where o.order_customer_id = c.customer_id and o.order_id='" . $orderId . "'";
$orows = $service->GetRows($sql);
if (count($orows) != 0) {
    $order = $orows[0];
}
?>
<div id="content" class="float_r">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						
						<td style="width:5px" valign="bottom" class="navigation">&nbsp;
							
						</td>
						<td valign="bottom" class="navigation">