getOrdersReturn;
$accountSummary = GetUserAccountSummary($ordersReturn);
$userAccountDataReturn =
GetAccountData(GetUserFromCookie())->getAccountDataReturn;
$userAccountProfileDataReturn =
GetAccountProfileData(GetUserFromCookie())->getAccountProfileDataReturn;
}
function FormatDate($date) {
if ($date) {
return date("m/d/Y h:i:s A", $date);
}
return "-";
}
?>
Trade Alert:
The following orders have completed.");
print("
Order ID | Order Status |
Creation Date | Completion Date |
Txn Fee | Type | Symbol |
Quantity |
");
$index = 0;
while ($getClosedOrdersReturn->OrderDataBean[$index])
{
print ("".$getClosedOrdersReturn->OrderDataBean[$index]->orderID." |
".$getClosedOrdersReturn->OrderDataBean[$index]->orderStatus." |
".FormatDate($getClosedOrdersReturn->OrderDataBean[$index]->openDate)." |
".FormatDate($getClosedOrdersReturn->OrderDataBean[$index]->completionDate)." |
$".$getClosedOrdersReturn->OrderDataBean[$index]->orderFee." |
".$getClosedOrdersReturn->OrderDataBean[$index]->orderType." |
".$getClosedOrdersReturn->OrderDataBean[$index]->symbol." |
".$getClosedOrdersReturn->OrderDataBean[$index]->quantity." |
");
$index ++;
}
print("
");
}
/*Display the account summary information of a particular user.*/
if ($accountSummary)
{
print ("
Account Information
");
print ("
Subtotal Buys | Subtotal Sells | Subtotal Fees
| Net Impact Cash Balance |
---|
");
printf("$%.2f | ", $accountSummary->totalBuys);
printf("$%.2f | ", $accountSummary->totalSells);
printf("$%.2f | ", $accountSummary->totalTax);
printf("");
if ($accountSummary->totalImpact > 0)
{
printf("$%.2f", $accountSummary->totalImpact);
}
else if ($accountSummary->totalImpact < 0)
{
printf("$%.2f", $accountSummary->totalImpact);
}
else
{
printf("($%.2f)", $accountSummary->totalImpact);
}
printf(" |
");
}
/*Display the orders a particular user is associated with.*/
if ($ordersReturn)
{
print("
");
print("
");
print("Order ID | Order Status | Creation Date | Completion Date
| Txn Fee | Type | Symbol | Quantity | Price
| Total |
");
$index = 0;
while ($ordersReturn->OrderDataBean[$index])
{
print ("".$ordersReturn->OrderDataBean[$index]->orderID." |
".$ordersReturn->OrderDataBean[$index]->orderStatus." |
".FormatDate($ordersReturn->OrderDataBean[$index]->openDate)."
| ".FormatDate($ordersReturn->OrderDataBean[$index]->completionDate)." |
$".$ordersReturn->OrderDataBean[$index]->orderFee." |
".$ordersReturn->OrderDataBean[$index]->orderType." | ");
print (" | ");
print ("".$ordersReturn->OrderDataBean[$index]->quantity." |
$".$ordersReturn->OrderDataBean[$index]->price." |
$".(($ordersReturn->OrderDataBean[$index]->price *
$ordersReturn->OrderDataBean[$index]->quantity) +
$ordersReturn->OrderDataBean[$index]->orderFee)." |
");
$index ++;
}
print ("
");
}
/*Display the account profile information associted to a
the user.*/
if ($userAccountProfileDataReturn)
{
print ("