incubator-stonehenge-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bende...@apache.org
Subject svn commit: r834764 - /incubator/stonehenge/trunk/stocktrader/php/trader_client/account.php
Date Wed, 11 Nov 2009 04:34:54 GMT
Author: bendewey
Date: Wed Nov 11 04:34:53 2009
New Revision: 834764

URL: http://svn.apache.org/viewvc?rev=834764&view=rev
Log:
STONEHENGE-59, added a FormatDate function that handles the null case from DB with a '-'

Modified:
    incubator/stonehenge/trunk/stocktrader/php/trader_client/account.php

Modified: incubator/stonehenge/trunk/stocktrader/php/trader_client/account.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/account.php?rev=834764&r1=834763&r2=834764&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/trader_client/account.php (original)
+++ incubator/stonehenge/trunk/stocktrader/php/trader_client/account.php Wed Nov 11 04:34:53
2009
@@ -43,6 +43,13 @@
 	$userAccountProfileDataReturn = 
 		GetAccountProfileData(GetUserFromCookie())->getAccountProfileDataReturn;
 }
+
+function FormatDate($date) {
+	if ($date) {
+		return date("m/d/Y h:i:s A", $date);
+	}
+	return "-";
+}
 ?>
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -114,8 +121,8 @@
 					{
 						print ("<tr><td>".$getClosedOrdersReturn->OrderDataBean[$index]->orderID."</td>
 							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->orderStatus."</td>
-							<td>".date("m/d/Y h:i:s A", $getClosedOrdersReturn->OrderDataBean[$index]->openDate)."</td>
-							<td>".date("m/d/Y h:i:s A", $getClosedOrdersReturn->OrderDataBean[$index]->completionDate)."</td>
+							<td>".FormatDate($getClosedOrdersReturn->OrderDataBean[$index]->openDate)."</td>
+							<td>".FormatDate($getClosedOrdersReturn->OrderDataBean[$index]->completionDate)."</td>
 							<td>$".$getClosedOrdersReturn->OrderDataBean[$index]->orderFee."</td>
 							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->orderType."</td>
 							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->symbol."</td>
@@ -170,8 +177,8 @@
 					{
 						print ("<tr><td>".$ordersReturn->OrderDataBean[$index]->orderID."</td>
 							<td>".$ordersReturn->OrderDataBean[$index]->orderStatus."</td>
-							<td>".date("m/d/Y h:i:s A", $ordersReturn->OrderDataBean[$index]->openDate)."
-							</td><td>".date("m/d/Y h:i:s A", $ordersReturn->OrderDataBean[$index]->completionDate)."</td>
+							<td>".FormatDate($ordersReturn->OrderDataBean[$index]->openDate)."
+							</td><td>".FormatDate($ordersReturn->OrderDataBean[$index]->completionDate)."</td>
 							<td class=\"currency\">$".$ordersReturn->OrderDataBean[$index]->orderFee."</td>
 							<td>".$ordersReturn->OrderDataBean[$index]->orderType."</td>");
 							
@@ -222,10 +229,10 @@
 						print("<table align=\"center\" class=\"profile-content\" cellspacing=\"0\"><tbody>");
 						print ("<tr><td class=\"left\">Account ID:</td>
 							<td>".$userAccountDataReturn->accountID."</td><td class=\"left\">
-							Account Created</td><td>".date("m/d/Y h:i:s A", $userAccountDataReturn->creationDate)."</td></tr>");
+							Account Created</td><td>".FormatDate($userAccountDataReturn->creationDate)."</td></tr>");
 						print ("<tr><td class=\"left\">User ID:</td>
 							<td>".$userAccountDataReturn->profileID."</td><td class=\"left\">
-							Last Login:</td><td>".date("m/d/Y h:i:s A", $userAccountDataReturn->lastLogin)."</td></tr>");
+							Last Login:</td><td>".FormatDate($userAccountDataReturn->lastLogin)."</td></tr>");
 						print ("<tr><td class=\"left\">Opening Balance:</td>
 							<td>".$userAccountDataReturn->openBalance."</td>
 							<td class=\"left\">Total Logins:</td>



Mime
View raw message