getOrdersReturn;
$accountSummary = GetUserAccountSummary($ordersReturn);
$userAccountDataReturn =
GetAccountData(GetUserFromCookie())->getAccountDataReturn;
$userAccountProfileDataReturn =
GetAccountProfileData(GetUserFromCookie())->getAccountProfileDataReturn;
}
?>
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])
{
$openDate = new DateTime($getClosedOrdersReturn->OrderDataBean[$index]->openDate);
$completionDate =new DateTime( $getClosedOrdersReturn->OrderDataBean[$index]->completionDate);
print ("".$getClosedOrdersReturn->OrderDataBean[$index]->orderID." |
".$getClosedOrdersReturn->OrderDataBean[$index]->orderStatus." |
".$openDate->format("m/d/Y h:i:s A")." |
".$completionDate->format("m/d/Y h:i:s A")." |
$".$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])
{
$openDate = new DateTime($ordersReturn->OrderDataBean[$index]->openDate);
$completionDate = new DateTime($ordersReturn->OrderDataBean[$index]->completionDate);
print ("".$ordersReturn->OrderDataBean[$index]->orderID." |
".$ordersReturn->OrderDataBean[$index]->orderStatus." |
".$openDate->format("m/d/Y h:i:s A")."
| ".$completionDate->format("m/d/Y h:i:s A")." |
$".$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 ("