incubator-stonehenge-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r744093 [2/2] - in /incubator/stonehenge/trunk/stocktrader/ruby: ./ order_processor/ order_processor/controllers/ order_processor/controllers/keys/ order_processor/controllers/policies/ trader_client/ trader_client/controllers/ trader_clien...
Date Fri, 13 Feb 2009 12:04:56 GMT
Added: incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/layouts/default.html.erb
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/layouts/default.html.erb?rev=744093&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/layouts/default.html.erb (added)
+++ incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/layouts/default.html.erb Fri Feb 13 12:04:55 2009
@@ -0,0 +1,59 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
+		<meta name="generator" content="Adobe GoLive" />
+		<title>WSO2 WSF/Ruby StockTrader Welcome</title>
+		<link href="/stylesheets/style.css" rel="stylesheet" type="text/css" media="all" />
+	</head>
+
+	<body>
+
+	<div id="content">
+		<div id="header">
+			<div class="logo"><img src="/images/logo.gif"></div>
+		</div>
+
+		<div id="header-links">
+		<table>
+			<tr>
+			<td>
+			<a href="/trade/index">Welcome</a>
+			</td>
+			<td>
+			<a href="/trade/home">Home</a>
+			</td>
+			<td>
+			<a href="/trade/account">Account</a>
+			</td>
+			<td>
+			<a href="/trade/portfolio">Portfolio</a>
+			</td>
+			<td>
+			<a href="/trade/quotes">Quotes/Trade</a>
+			</td>
+			<td>
+			<a href="/trade/glossary">Glossary</a>
+			</td>
+			<td>
+			<a href="/trade/config">Config</a>
+			</td>
+			<td>
+			<a href="/trade/login">Login/Logout</a>
+			</td>
+			</tr>
+		</table>
+		</div>
+
+		<%= @content_for_layout %>
+		
+			<div id="footer">
+				<div style="float:left;">Copyright 2008, WSO2 Inc.</div>
+				<div style="margin-left:432px;float:left;">Powered by 
+				<img align="top" src="/images/powered-by-logo.gif" style="margin-top:-3px; margin-left: 0px;"/></div>
+			</div>
+		</div>
+	
+	</body>
+</html>
+

Added: incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/account.html.erb
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/account.html.erb?rev=744093&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/account.html.erb (added)
+++ incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/account.html.erb Fri Feb 13 12:04:55 2009
@@ -0,0 +1,232 @@
+<div id="middle">
+              
+        <%
+				# Checking whether there is new status change happened in the 
+				# related to a particular order.
+				if (@closedOrders != nil)
+				%>
+					<p style="color: red" align="center">Trade Alert: 
+						The following orders have completed.</p>
+					<table class="table-outer" 
+						cellspacing="0" align="center"><thead>
+						<tr><th>Order ID</th><th>Order Status</th>
+						<th>Creation Date</th><th>Completion Date</th>
+						<th>Txn Fee</th><th>Type</th><th>Symbol</th>
+						<th>Quantity</th></tr></thead><tbody>
+          
+          <%
+					index = 0
+          if(@closedOrders["OrderDataBean"].class.to_s == "Array")
+            while ((order = @closedOrders["OrderDataBean"][index]) != nil)
+              openDate = convert_date(order["openDate"])
+              completionDate = convert_date(order["completionDate"])
+              %>
+              <tr>
+                <td><%=order["orderID"]%></td>
+                <td><%=order["orderStatus"]%></td>
+                <td><%=openDate%></td>
+                <td><%=completionDate%></td>
+                <td>$<%=order["orderFee"]%></td>
+                <td><%=order["orderType"]%></td>
+                <td><%=order["symbol"]%></td>
+                <td><%=order["quantity"]%></td>
+              </tr>
+              <%
+              index = index + 1
+            end
+          else
+            order = @closedOrders["OrderDataBean"]
+            openDate = convert_date(order["openDate"])
+            completionDate = convert_date(order["completionDate"])
+            %>
+            <tr>
+              <td><%=order["orderID"]%></td>
+              <td><%=order["orderStatus"]%></td>
+              <td><%=openDate%></td>
+              <td><%=completionDate%></td>
+              <td>$<%=order["orderFee"]%></td>
+              <td><%=order["orderType"]%></td>
+              <td><%=order["symbol"]%></td>
+              <td><%=order["quantity"]%></td>
+            </tr>
+          <%
+          end
+          %>
+					</tbody></table><br/><br/>
+        <%
+        end
+				%>
+
+
+        <%
+				# Display the account summary information of a particular user.
+				if (@accountSummary != nil)
+        %>
+					<div class="main-title"><h1>Account Information
+						</h1><script type="text/javascript">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script></div>
+
+					<table class="table-outer" cellspacing="0" align="center">
+						<thead><tr><th>Subtotal Buys</th><th>Subtotal Sells</th><th>Subtotal Fees
+						</th><th>Net Impact Cash Balance</th></tr></thead><tbody><tr>
+
+					<td class="currency"><%=@accountSummary["totalBuys"] %></td> 
+					<td class="currency"><%=@accountSummary["totalSells"] %></td> 
+					<td class="currency"><%=@accountSummary["totalTax"] %></td> 
+					<td class="currency">
+          
+          <%
+					if (@accountSummary["totalImpact"].to_i > 0)
+          %>
+						<span class="price-loss"><%=@accountSummary["totalImpact"]%></span> 
+          <%
+					elsif (@accountSummary["totalImpact"].to_i < 0)
+          %>
+						<span class="price-gain"><%=@accountSummary["totalImpact"]%></span> 
+          <%
+					else
+          %>
+						<span><%=@accountSummary["totalImpact"]%></span> 
+          <%
+          end
+          %>
+					</td></tr></tbody></table>
+        <%
+				end
+        %>
+
+        <%
+				# Display the orders a particular user is associated with
+				if (@ordersReturn != nil)
+        %>
+					<div><p><b>Total Orders Shown</b></p></div>
+					<table class="table-outer" cellspacing="0" align="center"><thead><tr>
+					<th>Order ID</th><th>Order Status</th><th>Creation Date</th><th>Completion Date
+						</th><th>Txn Fee</th><th>Type</th><th>Symbol</th><th>Quantity</th><th>Price
+						</th><th>Total</th></tr></thead><tbody>
+				<%	
+					index = 0
+          if(@ordersReturn["OrderDataBean"].class.to_s == "Array")
+            while((order = @ordersReturn["OrderDataBean"][index]) != nil)
+              openDate = convert_date(order["openDate"])
+              completionDate = convert_date(order["completionDate"])
+              %>
+                <tr><td><%=order["orderID"]%></td>
+                <td><%=order["orderStatus"]%></td>
+                <td><%=openDate%></td>
+                <td><%=completionDate%></td>
+                <td class="currency"><%=order["orderFee"]%></td>
+                <td><%=order["orderType"]%></td>
+                
+                <td><form action = "/trade/quotes" method = "post">
+                <input type="hidden" name="SYMBOLS" value="<%=order["symbol"]%>"/>
+                <input type="submit" name="GETQUOTE" value="<%=order["symbol"]%>"/></form></td>
+
+                <td class="currency"><%=order["quantity"]%></td>
+                <td class="currency">$<%=order["price"]%></td>
+                <td class="currency">$<%="%.2f" % ((order["price"].to_f * order["quantity"].to_i) + order["orderFee"].to_f)%></td></tr>
+
+            <%
+              index = index +1
+            end
+          else
+            order = @ordersReturn["OrderDataBean"]
+            openDate = converte_date(order["openDate"])
+            completionDate = convert_date(order["completionDate"])
+            %>
+              <tr><td><%=order["orderID"]%></td>
+              <td><%=order["orderStatus"]%></td>
+              <td><%=openDate%></td>
+              <td><%=completionDate%></td>
+              <td class="currency"><%=order["orderFee"]%></td>
+              <td><%=order["orderType"]%></td>
+              
+              <td><form action = "/trade/quotes" method = "post">
+              <input type="hidden" name="SYMBOLS" value="<%=order["symbol"]%>"/>
+              <input type="submit" name="GETQUOTE" value="<%=order["symbol"]%>"/></form></td>
+
+              <td class="currency"><%=order["quantity"]%></td>
+              <td class="currency"><%=order["price"]%></td>
+              <td class="currency"><%="%.2f" % ((order["price"].to_f * order["quantity"].to_i) + order["orderFee"].to_f)%></td></tr>
+
+          <%
+          end
+          %>
+					</tbody></table>
+				<%
+        end
+        %>
+
+        <%	
+				# Display the account profile information associted to a
+				# the user.
+				if (@userAccountProfileDataReturn)
+        %>
+					<form action = "/trade/account"  method ="post">
+						<table class="profile" cellspacing="0" width="100%"><thead><tr>
+						<th>Update Account Profile:<%=@userId%></th></tr></thead><tbody><tr><td>
+					<table cellspacing="0" align="center">
+					<tr><td>Full Name:</td><td><input name="FULLNAME" type="text" value="<%=@userAccountProfileDataReturn["fullName"]%>" id="" size="25"/>
+						</td><td>Email Address:</td><td><input name="EMAIL" type="text" value="<%=@userAccountProfileDataReturn["email"]%>" id="" size="25"/></td></tr>
+					<tr><td>Address:</td><td><input name="ADDRESS" type="text" value="<%=@userAccountProfileDataReturn["address"]%>" id="" size="25"/></td>
+						<td>Password:</td><td><input type="password" name="PASSWORD" type="text" value="<%=@userAccountProfileDataReturn["password"]%>" id="" size="25"/></td></tr>
+					<tr><td>Credit Card:</td><td><input name="CREDITCARD" type="text" value="<%=@userAccountProfileDataReturn["creditCard"]%>" id="" size="25"/></td>
+						<td>Confirm Password:</td><td><input type="password" name="PASSWORD" type="text" value="<%=@userAccountProfileDataReturn["password"]%>" id="" size="25"/></td></tr>
+					<tr><td colspan="4" class="button"><input type="submit" 
+						name="UPDATEUSERPROFILE"value="Update" class="button"/></td></tr>
+					</table>
+          </form>
+
+          <%
+					# Display the account information of a the user
+					if (@userAccountDataReturn)	
+					
+						creationDate = convert_date(@userAccountDataReturn["creationDate"])
+						lastLogin = convert_date(@userAccountDataReturn["lastLogin"])
+          %>
+						<table align="center" class="profile-content" cellspacing="0"><tbody>
+						<tr><td class="left">Account ID:</td>
+							<td><%=@userAccountDataReturn["accountID"]%></td><td class="left">
+							Account Created</td><td><%=creationDate%></td></tr>
+						<tr><td class="left">User ID:</td>
+							<td><%=@userAccountDataReturn["profileID"]%></td><td class="left">
+							Last Login:</td><td><%=lastLogin%></td></tr>
+						<tr><td class="left">Opening Balance:</td>
+							<td>$<%=@userAccountDataReturn["openBalance"]%></td>
+							<td class="left">Total Logins:</td>
+							<td><%=@userAccountDataReturn["loginCount"]%></td></tr>
+						<tr><td class="left">Cash Balance:</td>
+						
+            <%	
+						if (@userAccountDataReturn["balance"].to_f > 0)
+            %>
+							<td><span class="price-gain">$<%="%.2f" % @userAccountDataReturn["balance"]%></span></td>
+						<%
+						elsif(@userAccountDataReturn["balance"].to_f < 0)
+            %>
+							<td><span class="price-loss">$<%="%.2f" % ((-1) * @userAccountDataReturn["balance"].to_f)%></span></td>
+						<%
+						else
+						%>
+							<td>$<%=@userAccountDataReturn["balance"]%></td>
+            <%
+						end
+            %>
+            <td class="left">Total Logouts:</td>
+            <td><%=@userAccountDataReturn["logoutCount"]%></td></tr>
+            </tbody></table>
+          <%
+					end
+          %>
+					</td></tr></tbody></table>
+				<%
+        end
+		    %>
+
+			<div class="bottom">
+			<form method = "post"  action = "/trade/quotes">
+			<input type="text" value="<%=%>" name="SYMBOLS" size="25"/>
+			<input type="submit" value="Get Quote" name="GETQUOTE" class="button"/>
+			</form>
+			</div>
+</div>

Added: incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/config.html.erb
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/config.html.erb?rev=744093&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/config.html.erb (added)
+++ incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/config.html.erb Fri Feb 13 12:04:55 2009
@@ -0,0 +1,26 @@
+<div id="middle">
+
+    <%= @message %>
+		<div class="main-title">
+		<h1>Config</h1>
+		<script type=\"text/javascript\">
+			var thisdate = new Date();
+			document.writeln(thisdate.toLocaleString());
+		</script>
+		</div>
+
+		<div class="login">
+    <form method="post"  action="/trade/config">
+      <table>
+      <tr>
+      <td>Remote Host</td>
+      <td><input type="text" name = "ENDPOINT" value = <% if (GetEndpoint() == nil || GetEndpoint() == "") %>"http://localhost:80/TradeServiceWcf/TradeServiceWcf.svc"<% else %>"<%=GetEndpoint()%>" <%end%> size = "75"/></td>
+      </tr>
+      <tr>
+      <td></td>
+      <td><input type = "submit" name = "SETENDPOINT" value = "Set" class="button"/></td>
+      </tr>
+      </table>
+    </form>
+		</div>
+</div>

Added: incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/confirmation.html.erb
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/confirmation.html.erb?rev=744093&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/confirmation.html.erb (added)
+++ incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/confirmation.html.erb Fri Feb 13 12:04:55 2009
@@ -0,0 +1,50 @@
+<div id="middle">
+				<div class="main-title">
+					<h1>Trade</h1>
+					<script type=\"text/javascript\">
+						var thisdate = new Date();
+						document.writeln(thisdate.toLocaleString());
+					</script>
+				</div>
+				
+				<div id="confirm">
+				<h2>Trade Confirmation</h2>
+				<div class="confirm-content">
+					<form action="/trade/quotes" method="post">
+
+            <%
+						if (@isSell)
+						%>
+							<p>You have requested to sell all or part of your holding <%=@holdingID%> 
+									This holding has a total of <%=@quantity%> shares of stock <%=@symbol%>
+									Please indicate how many share to sell.</p>
+
+							<nobr>Number of Shares: <input type="text" name="QUANTITY" value="100" id="" size="10"/>
+							<input type="hidden" name="HOLDINGID" value="<%=@holdingID%>"></input>
+							<input type="submit" name="SELL" value="Sell" class="button"/>
+            <%
+						elsif (@isBuy)
+						%>
+							<nobr>Number of Shares: <input type="text" name="QUANTITY" value="100" id="" size="10"/>
+							<p>You have requested to buy shares of <%=@symbol%> which is currently trading at $".$price.".</p>
+							<input type="hidden" name="SYMBOL" value="<%=@symbol%>"></input>
+							<input type="submit" name="BUY" value="Buy" class="button"/>
+						<%
+						else
+						%>
+              <%=@messsage%>
+						<%
+            end
+            %>
+            <input type="submit" name = "CANCEL" value="Cancel" class="button"/></nobr>
+					</form>
+				</div>
+				</div>
+				
+			<div class="bottom">
+			<form method = "post"  action = "quotes.php">
+			<input type="text" value="<%=@symbol%>" name="SYMBOLS" size="25"/>
+			<input type="submit" value="Get Quote" name="GETQUOTE" class="button"/>
+			</form>
+			</div>
+</div>

Added: incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/glossary.html.erb
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/glossary.html.erb?rev=744093&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/glossary.html.erb (added)
+++ incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/glossary.html.erb Fri Feb 13 12:04:55 2009
@@ -0,0 +1,151 @@
+			<div id="middle">
+				<div class="main-title">
+					<h1>Glossary</h1>
+					<script type="text/javascript">
+						var thisdate = new Date();
+						document.writeln(thisdate.toLocaleString());
+					</script>
+				</div>
+				<table align="center" class="glossary" >
+					<thead>
+						<tr>
+							<th>Term</th>
+							<th>Description</th>
+						</tr>
+					</thead>
+					<tbody>
+						<tr>
+							<td class="left">Account ID</td>
+							<td>A unique Integer based key. Each user is assigned an account ID at account creation time.</td>
+						</tr>
+						<tr>
+							<td class="left">Account Created</td>
+							<td>The time and date the users account was first created.</td>
+						</tr>
+						<tr>
+							<td class="left">Cash Balance</td>
+							<td>The current cash balance in the users account. This does not include current stock holdings.</td>
+						</tr>
+							<td class="left">Company</td>
+							<td>The full company name for an individual stock.</td>
+						</tr>
+							<td class="left">Current Gain/Loss</td>
+							<td>The total gain or loss of this account, computed by substracting the current sum of cash/holdings minus the opening account balance.</td>
+						</tr>
+							<td class="left">Current Price</td>
+							<td>The current trading price for a given stock symbol.</td>
+						</tr>
+							<td class="left">Gain/Loss</td>
+							<td>The current gain or loss of an individual stock holding, computed as (current market value - holding basis).</td>
+						</tr>
+						</tr>
+							<td class="left">Last Login</td>
+							<td>The date and time this user last logged in to Trade.</td>
+						</tr>
+						</tr>
+							<td class="left">Market Value</td>
+							<td>The current total value of a stock holding, computed as (quantity * current price).</td>
+						</tr>
+						</tr>
+							<td class="left">Number of Holdings</td>
+							<td>The total number of stocks currently owned by this account.</td>
+						</tr>
+						</tr>
+							<td class="left">Open Price</td>
+							<td>The price of a given stock at the open of the trading session.</td>
+						</tr>
+						</tr>
+							<td class="left">Order ID</td>
+							<td>A unique Integer based key. Each order is assigned an order ID at order creation time.</td>
+						</tr>
+						</tr>
+							<td class="left">Opening Balance</td>
+							<td>The initial cash balance in this account when it was opened.</td>
+						</tr>
+						</tr>
+							<td class="left">Order Status</td>
+							<td>orders are opened, processed, closed and completed. Order status shows the current stat for this order.</td>
+						</tr>
+						</tr>
+							<td class="left">Price Range</td>
+							<td>The low and high prices for this stock during the current trading session</td>
+						</tr>
+						</tr>
+							<td class="left">Purchase Date</td>
+							<td>The date and time the a stock was purchased.</td>
+						</tr>
+						</tr>
+							<td class="left">Purchase Price</td>
+							<td>The price used when purchasing the stock.</td>
+						</tr>
+						</tr>
+							<td class="left">Purchase Basis</td>
+							<td>The total cost to purchase this holding. This is computed as (quantity * purchase price).</td>
+						</tr>
+						</tr>
+							<td class="left">Quantity</td>
+							<td>The number of stock shares in the order or user holding.</td>
+						</tr>
+						</tr>
+							<td class="left">Session Created</td>
+							<td>An HTTP session is created for each user at during login. Session created shows the time and day when the session was created.</td>
+						</tr>
+						</tr>
+							<td class="left">Sum of Cash/Holdings</td>
+							<td>The total current value of this account. This is the sum of the cash balance along with the value of current stock holdings.</td>
+						</tr>
+						</tr>
+							<td class="left">Symbol</td>
+							<td>The symbol for a Trade stock.</td>
+						</tr>
+						</tr>
+							<td class="left">Total Logins</td>
+							<td>The total number of logins performed by this user.</td>
+						</tr>
+						</tr>
+							<td class="left">Total Logouts</td>
+							<td>The total number of logouts performed by this user.</td>
+						</tr>
+						</tr>
+							<td class="left">Total of Holdings</td>
+							<td>The current total value of all stock holdings in this account given the current valuation of each stock held.</td>
+						</tr>
+						</tr>
+							<td class="left">Top gainers</td>
+							<td>The list of stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) gaining the most in price during the current trading session.</td>
+						</tr>
+						</tr>
+							<td class="left">Top Losers</td>
+							<td>The list of stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) falling the most in price during the current trading session.</td>
+						</tr>
+						</tr>
+							<td class="left">Trader Stock Index (TSIA)</td>
+							<td>A computed index of the top 20 stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) in Trade.</td>
+						</tr>
+						</tr>
+							<td class="left">Trading Volume</td>
+							<td>The total number of shares traded for stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) during this trading session.</td>
+						</tr>
+						</tr>
+							<td class="left">Txn Fee</td>
+							<td>The fee charged by the brokerage to process this order.</td>
+						</tr>
+						</tr>
+							<td class="left">Type</td>
+							<td>The order type (buy or sell).</td>
+						</tr>
+						</tr>
+							<td class="left">User ID</td>
+							<td>The unique user ID for the account chosen by the user at account registration.</td>
+						</tr>
+						</tr>
+							<td class="left">Volume</td>
+							<td>The total number of shares traded for this stock.</td>
+						</tr>
+					</tbody>
+				</table>
+								
+				
+				
+			
+			</div>

Added: incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/home.html.erb
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/home.html.erb?rev=744093&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/home.html.erb (added)
+++ incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/home.html.erb Fri Feb 13 12:04:55 2009
@@ -0,0 +1,231 @@
+<div id="middle">
+				<div class="main-title"><h1>Home</h1><script type="text/javascript">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script></div>
+				<h3>Welcome <%=@userId%></h3>
+
+				<table>
+				<tr>
+				<td>
+				<div class="left">
+					<table class="normal">
+						<thead><tr><th colspan="2">User Statistics</th></tr></thead>
+
+						  <%
+							if(@accountDataReturn)
+								creationDate = convert_date(@accountDataReturn["creationDate"])
+								lastLogin = convert_date(@accountDataReturn["lastLogin"])
+							%>
+								<tbody>
+								<tr><td class="left">Account ID:</td>
+									<td><%=@accountDataReturn["accountID"]%></td></tr>
+								<tr><td class="left">Account Created:</td>
+									<td><%=creationDate%></td></tr>
+								<tr><td class="left">Total Logins:</td>
+									<td><%=@accountDataReturn["loginCount"]%></td></tr>
+								<tr><td class="left">Session Created:</td>
+									<td><%=lastLogin%></td></tr>
+								</tbody>
+							<%
+              end
+						  %>
+
+
+						<thead><tr><th colspan="2">Summary</th></tr></thead>
+						<%
+							if (!(@holdingInfo == nil) || (@accountDataReturn == nil))
+							%>
+								<tbody>
+								<tr><td class="left">Cash Balance:</td>
+									<td><%=@accountDataReturn["balance"]%></td></tr>
+
+								<tr><td class="left">Number of Holdings:</td>
+									<td><%=@noOfHoldings%></td></tr>
+								
+								<tr><td class="left">Total of Holdings:</td><td>
+								<%=@totalHoldings%>
+								</td></tr>
+
+								<tr><td class="left">Sum of Cash and Holdings:</td><td>
+								$<%=@totalHoldings.to_f + (@accountDataReturn["balance"].to_f)%>
+								</td></tr>
+
+								<tr><td class="left">Opening Balance:</td><td>
+								$ <%=@accountDataReturn["openBalance"]%>
+								</td></tr>
+
+								<tr><td class="left">Current Gain/(Loss):</td>
+									<td><span class="price">
+								<% gain =  ((@totalHoldings.to_f + (@accountDataReturn["balance"].to_f)) - @accountDataReturn["openBalance"].to_f)%>
+                <%
+								if (gain < 0)
+								%>
+									<%=(-1) * gain%>
+								<%
+								elsif (gain >= 0)
+								%>
+									<%=gain%>
+								<%
+                end
+								gainPercent = (gain/@accountDataReturn["openBalance"].to_f) * 100
+                %>
+								</span></td></tr>
+
+
+								<tr><td class="left">%Gain/(Loss):</td><td>
+        
+                <%
+								if (gainPercent > 0)
+								%>
+									<span class="price-gain"><%=gainPercent%>%</span>
+								<%
+								elsif (gainPercent < 0)
+								%>
+									<span class="price-loss"><%=gainPercent%></span>
+								<%
+								else
+								%>
+									<span><%=gainPercent%>%</span>
+								<%
+                end
+								%>
+								</td></tr>
+								</tbody>
+							<%
+              end
+              %>
+							</table>
+						</td>
+
+						<td>
+						<div class="right">
+						<h3>Market Summary</h3>
+							<p><?php print(date("D, F j, Y, g:i a")); ?></p>
+
+							<table class="table-outer" cellspacing="0">
+              <%
+							if ((@holdingInfo != nil) && (@accountDataReturn != nil))
+							%>
+								<tr><td class="special">Trade Stock Index (TSIA)</td><td>
+								<%="%.2f" % @tsia%>
+                <%
+								if (@gain > 0)
+								%>
+                  <span class="price-gain">$
+								<%
+								elsif (@gain < 0)
+								%>
+                  <span class="price-loss">$
+								<%
+								else
+                %>
+									<span>$
+								<%
+								end
+                %>
+								<%="%.2f" % (@gain.to_f)%></span>
+								</td></tr>
+
+								<tr><td class="special">Trading Volume</td><td>
+
+								<%=@volume%>
+								</td></tr>
+
+								<tr><td class="special">Top Gainers</td><td>
+								<table class="table-inner" cellspacing="0">
+								<thead><tr><th>Symbol</th><th>Price</th><th>Change</th></tr></thead>
+								<tbody>
+
+                <%
+								index = 0
+								gainer = @topGainers[index]
+								while(gainer != nil)
+                %>
+									<tr><td><form action = "/trade/quotes" method = "post">
+										<input type="hidden" name="SYMBOLS" value="<%=gainer["symbol"]%>"/>
+										<input type="submit" name="GETQUOTE" value="<%=gainer["symbol"]%>"></input></form></td>
+
+									<td>$<%=gainer["price"]%></td>
+									<td>
+                  <%
+									if ((gainer["change"].to_f) > 0)
+									%>
+										<span class="price-gain">$
+									<%
+									elsif ((gainer["change"].to_f) < 0)
+									%>
+										<span class="price-loss">$
+									<%
+									else
+									%>
+										<span>$
+									<%
+                  end
+                  %>
+
+									<%=gainer["change"]%>
+									</span></td>
+									</form></tr>
+                  
+                  <%
+									index = index + 1
+									gainer = @topGainers[index]
+							  end
+                %>
+
+								</tbody></table></td></tr>
+
+								<tr><td class="special">Top Losers</td><td>
+									<table class="table-inner" cellspacing="0"><thead>
+									<tr><th>Symbol</th><th>Price</th><th>Change</th></tr></thead><tbody>
+
+                <%
+								index = 0
+								loser = @topLosers[index]
+								while(loser)
+								%>
+									<tr><td><form action = "quotes.php" method = "post">
+										<input type="submit" name="SYMBOLS" value="<%=loser["symbol"]%>"></input></form></td>
+
+									<td>$<%=loser["price"]%></td>
+									<td>
+                  
+                  <%
+									if ((loser["change"].to_f) > 0)
+									%>
+										<span class="price-gain">$
+									<%
+									elsif ((loser["change"].to_f) < 0)
+									%>
+										<span class="price-loss">$
+									<%
+									else
+									%>
+										<span>$
+									<%
+									end
+									%>
+									<%=loser["change"]%>
+									</span></td>	
+									</tr>
+                  
+                  <%
+									index = index + 1
+									loser = @topLosers[index]
+                end
+								%>
+								</tbody></table>
+								</td></tr></table>
+								</div>
+								</td></tr></table>
+							<%
+              end
+              %>
+
+
+			<div class="bottom">
+			<form method = "post"  action = "/trade/quotes">
+			<input type="text" value="<%=%>" name="SYMBOLS" size="25"/>
+			<input type="submit" value="Get Quote" name="GETQUOTE" class="button"/>
+			</form>
+			</div>
+</div>

Added: incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/index.html.erb
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/index.html.erb?rev=744093&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/index.html.erb (added)
+++ incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/index.html.erb Fri Feb 13 12:04:55 2009
@@ -0,0 +1,42 @@
+        <div id="middle">
+                <div class="main-title">
+        <h1>Welcome!</h1>
+        <script type=\"text/javascript\">
+            var thisdate = new Date();
+            document.writeln(thisdate.toLocaleString());
+        </script>
+        </div>
+        <table>
+        <tr>
+        <td>
+        <div class="left">
+                <p> The design of WSO2 StockTrader sample application is based on an online stock trading scenario with the functionality of the application equivalent to the  <a href="http://msdn.microsoft.com/stocktrader">Microsoft .NET Stock Trader </a> sample benchmark application and <a href="https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=trade6">IBM WebSphere's Trade 6.1 </a> sample application. WSO2 StockTrader sample application is powered by <a href="http://wso2.org/projects/wsf/php">WSO2 WSF/PHP</a> and <a href="http://wso2.org/projects/wsas/java">WSO2 WSAS</a>. It serves to illustrate interoperability between PHP Java and .NET in deploying high-performance, scalable service oriented applications. </p>
+
+<p>For more details, check <a href="http://wso2.org/interop/stocktrader">WSO2 Stock Trader home page</a>. </p>
+
+        </div>
+        </td>
+        <td>    
+        <div class="right">
+                        <h3>Sample of Technologies Demonstrated</h3>
+                        <table>
+                            <tbody>
+                                <tr>
+                                    <td>
+                                        <ul>
+                                            <li>Service-oriented, n-tier design with PHP, Java and .NET</li>
+                                            <li>Clean separation of UI, business services and DB access</li>
+                                            <li>WSO2 Web Services Framework For PHP</li>
+                                            <li>WSO2 Web Services Application Server</li>
+                                            <li>Interoperability with .NET</li>
+                                            <li>Loosely-coupled, message-oriented design</li>
+                                        </ul>
+                                    </td>
+                                </tr>
+                            </tbody>
+                        </table>
+                    </div>
+                </tr>   
+            </table>
+        </div>
+

Added: incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/login.html.erb
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/login.html.erb?rev=744093&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/login.html.erb (added)
+++ incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/login.html.erb Fri Feb 13 12:04:55 2009
@@ -0,0 +1,36 @@
+<div id="middle">
+
+    <div class="main-title">
+	 <h1>Login</h1>
+	 <b><%= @message %>  </b>
+       <script type="text/javascript">
+            var thisdate = new Date();
+            document.writeln(thisdate.toLocaleString());
+        </script>
+    </div>
+
+    <div class="login">
+        <form method="post"  action="/trade/login">
+            <table>
+                <tr>
+                    <td>Username</td>
+                    <td><input name="USERNAME" size="25"/></td>
+                </tr>
+                <tr>
+                    <td>Password</td>
+                    <td><input type="password" name="PASSWORD" size="25"/></td>
+                </tr>
+                <tr>
+                    <td></td>
+                    <td><input type="submit" name="LOGINREQUEST" value="Login" class="button"/></td>
+                </tr>
+            </table>
+        </form>
+
+        <p>Try password "xxx" for user "uid:0" to access the stock trader web application.</p>
+        <p class="new-user">
+            <a href="/trade/register">First time user?</a>
+        </p>
+</div>	
+</div>	
+

Added: incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/portfolio.html.erb
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/portfolio.html.erb?rev=744093&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/portfolio.html.erb (added)
+++ incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/portfolio.html.erb Fri Feb 13 12:04:55 2009
@@ -0,0 +1,153 @@
+        <%
+				# Checking whether there is new status change happened in the 
+				# related to a particular order.
+				if (@closedOrders != nil)
+				%>
+					<p style="color: red" align="center">Trade Alert: 
+						The following orders have completed.</p>
+					<table class="table-outer" 
+						cellspacing="0" align="center"><thead>
+						<tr><th>Order ID</th><th>Order Status</th>
+						<th>Creation Date</th><th>Completion Date</th>
+						<th>Txn Fee</th><th>Type</th><th>Symbol</th>
+						<th>Quantity</th></tr></thead><tbody>
+          
+          <%
+					index = 0
+          if(@closedOrders["OrderDataBean"].class.to_s == "Array")
+            while ((order = @closedOrders["OrderDataBean"][index]) != nil)
+              openDate = convert_date(order["openDate"])
+              completionDate = convert_date(order["completionDate"])
+              %>
+              <tr>
+                <td><%=order["orderID"]%></td>
+                <td><%=order["orderStatus"]%></td>
+                <td><%=openDate%></td>
+                <td><%=completionDate%></td>
+                <td>$<%=order["orderFee"]%></td>
+                <td><%=order["orderType"]%></td>
+                <td><%=order["symbol"]%></td>
+                <td><%=order["quantity"]%></td>
+              </tr>
+              <%
+              index = index + 1
+            end
+          else
+            order = @closedOrders["OrderDataBean"]
+            openDate = convert_date(order["openDate"])
+            completionDate = convert_date(order["completionDate"])
+            %>
+            <tr>
+              <td><%=order["orderID"]%></td>
+              <td><%=order["orderStatus"]%></td>
+              <td><%=openDate%></td>
+              <td><%=completionDate%></td>
+              <td>$<%=order["orderFee"]%></td>
+              <td><%=order["orderType"]%></td>
+              <td><%=order["symbol"]%></td>
+              <td><%=order["quantity"]%></td>
+            </tr>
+          <%
+          end
+          %>
+					</tbody></table><br/><br/>
+        <%
+        end
+				%>
+
+        <%
+				if (@holdingsReturn)
+          %>
+					<div class="main-title">
+						<h1>Portfolio Information</h1><script type="text/javascript">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script></div>
+
+					<table class="table-outer" cellspacing="0" align="center">
+						<thead><tr><th>Holding ID</th><th>Purchase Date</th><th>Symbol</th>
+						<th>Quantity</th><th>Purchase Price</th><th>Current Price</th>
+						<th>Purchase Basis</th><th>Market Value</th><th>Gain(Loss)</th>
+						<th>Trade</th></tr></thead><tbody>
+          <%
+					index = 0;
+					purchaseBasis = 0;
+					marketValue = 0;
+					gain = 0;
+
+					while ((bean=@holdingsReturn["HoldingDataBean"][index]) != nil)
+            
+            quoteID = bean["quoteID"]
+						purchaseBasis = purchaseBasis + bean["purchasePrice"].to_f * (bean["quantity"].to_i)
+						marketValue = marketValue + (@quoteInfo[quoteID].to_i) * (bean["quantity"].to_i)
+						gain = (@quoteInfo[quoteID].to_f - bean["purchasePrice"].to_f) * (bean["quantity"].to_i)
+
+						dateTime = convert_date(bean["purchaseDate"])
+						%>
+            
+            <tr>
+              <td><%=bean["holdingID"]%></td>
+              <td><nobr><%=dateTime%></nobr></td>
+              <td>
+							<form action="/trade/quotes" method="post">
+							<input type="hidden" name="SYMBOLS" value="<%=bean["quoteID"]%>"/>	
+							<input type="submit" name="GETQUOTE" value="<%=bean["quoteID"]%>"></input>
+							</form></td>
+							<td class="currency"><%=bean["quantity"]%></td>
+              <td class="currency">$<%=bean["purchasePrice"]%></td>
+              <td class="currency">$<%=@quoteInfo[quoteID]%></td>
+              <td class="currency">$<%="%.2f" % ((bean["purchasePrice"].to_f) * (bean["quantity"].to_i))%></td>
+              <td class="currency">$<%="%.2f" % (@quoteInfo[quoteID].to_f * bean["quantity"].to_i)%></td>
+              <td class="currency">
+            <%
+						if (gain > 0)
+						%>
+							<span class="price-gain">$<%="%.2f" % gain%></span>
+						<%
+						elsif (gain < 0)
+              gain = gain * -1
+						%>
+							<span class="price-loss">$<%="%.2f" % gain%></span>
+						<%
+						else
+						%>
+							<span>$<%="%.2f" % gain%></span>
+						<%
+            end
+            %>
+						</td><td class="currency">
+						<form action = "/trade/confirmation" method = "post">
+						<input type="hidden" name="HOLDINGID" value="<%=bean["holdingID"]%>"></input>
+						<input type="hidden" name="QUANTITY" value="<%=bean["quantity"]%>"></input>
+						<input type="hidden" name="SYMBOL" value="<%=bean["quoteID"]%>"></input>
+						<input type="submit" value = "Sell" name="SELL">
+						</input></td></tr></form>
+
+					  <%
+						index = index + 1
+          end
+          %>
+					<tr class="total"><td colspan="6">Totals</td><td class="currency">$<%=purchaseBasis%></td>
+          <td class="currency">$<%=marketValue%></td><td>
+
+          <%
+					gain = marketValue - purchaseBasis
+					if (gain < 0)
+					%>
+						<span class=\"price-loss\">$<%=gain%></span></td><td></td></tr>
+					<%
+					elsif (gain > 0)
+					%>
+						<span class=\"price-gain\">$<%=gain%></span></td><td></td></tr>
+					<%
+					else
+					%>
+						<span>$<%=gain%></span></td><td></td></tr>
+					<%
+					end
+					%>
+					
+					</tbody></table>
+				<%
+        end
+        %>
+
+

Added: incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/quotes.html.erb
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/quotes.html.erb?rev=744093&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/quotes.html.erb (added)
+++ incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/quotes.html.erb Fri Feb 13 12:04:55 2009
@@ -0,0 +1,231 @@
+<div id="middle">
+        
+        <%
+				# Checking whether there is new status change happened in the 
+				# related to a particular order.
+				if (@closedOrders != nil)
+				%>
+					<p style="color: red" align="center">Trade Alert: 
+						The following orders have completed.</p>
+					<table class="table-outer" 
+						cellspacing="0" align="center"><thead>
+						<tr><th>Order ID</th><th>Order Status</th>
+						<th>Creation Date</th><th>Completion Date</th>
+						<th>Txn Fee</th><th>Type</th><th>Symbol</th>
+						<th>Quantity</th></tr></thead><tbody>
+          
+          <%
+					index = 0
+          if(@closedOrders["OrderDataBean"].class.to_s == "Array")
+            while ((order = @closedOrders["OrderDataBean"][index]) != nil)
+              openDate = convert_date(order["openDate"])
+              completionDate = convert_date(order["completionDate"])
+              %>
+              <tr>
+                <td><%=order["orderID"]%></td>
+                <td><%=order["orderStatus"]%></td>
+                <td><%=openDate%></td>
+                <td><%=completionDate%></td>
+                <td>$<%=order["orderFee"]%></td>
+                <td><%=order["orderType"]%></td>
+                <td><%=order["symbol"]%></td>
+                <td><%=order["quantity"]%></td>
+              </tr>
+              <%
+              index = index + 1
+            end
+          else
+            order = @closedOrders["OrderDataBean"]
+            openDate = convert_date(order["openDate"])
+            completionDate = convert_date(order["completionDate"])
+            %>
+            <tr>
+              <td><%=order["orderID"]%></td>
+              <td><%=order["orderStatus"]%></td>
+              <td><%=openDate%></td>
+              <td><%=completionDate%></td>
+              <td>$<%=order["orderFee"]%></td>
+              <td><%=order["orderType"]%></td>
+              <td><%=order["symbol"]%></td>
+              <td><%=order["quantity"]%></td>
+            </tr>
+          <%
+          end
+          %>
+					</tbody></table><br/><br/>
+        <%
+        end
+				%>
+
+        <%
+				if (@isReply)
+					# Check whether the user has requested to buy or sell some quote.
+				%>
+					<div class="main-title"><h1>New Order</h1>
+						<script type="text/javascript">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script></div>
+					<p align="center">Order 
+						<%= (@buyReturn && @buyReturn["orderID"] != nil) ?  @buyReturn["orderID"]: @sellEnhancedReturn["orderID"] %>
+            to 
+						<%= (@buyReturn && @buyReturn["quantity"] != nil) ? "buy " + @buyReturn["quantity"]: "sell " + @sellEnhancedReturn["quantity"] %>
+            shares of s:0 has been submitted for processing.</p>
+					<p align="center">Order Details:</p>
+					<table class="table-outer" cellspacing="0" align="center"><thead><tr>
+						<th>Order ID</th><th>Order Status</th><th>Creation Date</th>
+						<th>Completion Date</th><th>Txn Fee</th><th>Type</th><th>Symbol</th>
+							<th>Quantity</th></tr></thead>
+							<tbody>
+          <%
+					if(@isBuy)
+						dateTime = convert_date(@buyReturn["openDate"])
+            %>
+						<tr>
+              <td><%=@buyReturn["orderID"]%></td>
+              <td><%=@buyReturn["orderStatus"]%></td>
+							<td><%=dateTime%></td>
+              <td>Pending </td>
+              <td>$<%=@buyReturn["orderFee"]%></td>
+              <td><%=@buyReturn["orderType"]%></td>
+              <td><%=@buyReturn["symbol"]%></td>
+              <td><%=@buyReturn["quantity"]%></td>
+            </tr>
+          <%
+					elsif (@isSell)
+						dateTime = convert_date(@sellEnhancedReturn["openDate"])
+            %>
+						<tr>
+              <td><%=@sellEnhancedReturn["orderID"]%></td>
+              <td><%=@sellEnhancedReturn["orderStatus"]%></td>
+              <td><%=dateTime%></td>
+              <td>Pending</td>
+              <td>$<%=@sellEnhancedReturn["orderFee"]%></td>
+              <td><%=@sellEnhancedReturn["orderType"]%></td>
+              <td><%=@sellEnhancedReturn["symbol"]%></td>
+              <td><%=@sellEnhancedReturn["quantity"]%></td>
+            </tr>
+          <%
+					end
+          %>
+					</tbody></table>
+        <%
+				elsif(@quotesReturn != nil) #else to isreply
+        %>
+					<div class=\"main-title\"><h1>Stock Quotes</h1>
+					<script type=\"text/javascript\">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script>
+					</div>
+					<table class="table-outer" cellspacing="0" align="center"><thead>
+						<tr><th>Symbol</th><th>Company</th><th>Volume</th><th>Price Range</th>
+						<th>Open Price</th><th>Current Price</th><th>Gain(Loss)</th><th>Trade</th></tr></thead><tbody>
+
+          <%
+					if(@quotesReturn["symbol"] != nil)
+					%>
+					  <tr>
+              <td><%=@quotesReturn["symbol"]%></td>
+              <td><%=@quotesReturn["companyName"]%></td>
+              <td><%=@quotesReturn["volume"]%></td>
+              <td>$<%=@quotesReturn["low"]%>-$<%=@quotesReturn["high"]%></td>
+              <td>$<%=@quotesReturn["open"]%></td>
+							<td>$<%=@quotesReturn["price"]%></td>
+            <td> 
+            <%
+						if (@quotesReturn["change"].to_f > 0)
+            %>
+							<span class="price-gain">$<%="%.2f" % @quotesReturn["change"]%></span>
+						<%
+						elsif (@quotesReturn["change"].to_f < 0)
+              abs_change = -1 * @quotesReturn["change"].to_f 
+						%>
+							<span class="price-loss">$<%="%.2f" % (abs_change)%></span>
+						<%
+						else
+						%>
+							<span>$<%=@quotesReturn["change"]%></span>
+            <%
+						end
+            %>
+						</td><td><form action="/trade/confirmation" method="post">
+							<input type="hidden" name="QUANTITY" value="<%=@quotesReturn["volume"]%>"/>
+							<input type="hidden" name="SYMBOL" value="<%=@quotesReturn["symbol"]%>"/>
+							<input type="hidden" name="PRICE" value="<%=@quotesReturn["price"]%>"/>
+							<input type="submit" name="BUY" value="Buy"></input>
+            </form></td></tr>
+          <%
+					end
+          %>
+					</tbody></table>
+        <%
+				elsif(@quotesInitialPage) # else for isreply
+				%>
+					<div class="main-title"><h1>Stock Quotes</h1>
+					<script type="text/javascript">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script>
+					</div>
+					<table class="table-outer" cellspacing="0" align="center"><thead>
+						<tr><th>Symbol</th><th>Company</th><th>Volume</th><th>Price Range</th>
+						<th>Open Price</th><th>Current Price</th><th>Gain(Loss)</th><th>Trade</th></tr></thead><tbody>
+
+          <%
+					symbolCount = 0;
+					while(symbolCount < 5)
+						quotesReturn = GetQuote("s:" + symbolCount.to_s)
+
+						if (quotesReturn)
+							if (quotesReturn["symbol"])
+                %>
+								<tr>
+                  <td><%=quotesReturn["symbol"]%></td>
+                  <td><%=quotesReturn["companyName"]%></td>
+                  <td><%=quotesReturn["volume"]%></td>
+                  <td>$<%=quotesReturn["low"]%>-$<%=quotesReturn[">high"]%></td>
+                  <td>$<%=quotesReturn["open"]%></td>
+									<td>$<%=quotesReturn["price"]%></td>
+                <td>
+                <%
+								if (quotesReturn["change"].to_f> 0)
+								%>
+									<span class="price-gain">$<%="%.2f" % quotesReturn["change"]%></span>
+								<%
+								elsif (quotesReturn["change"].to_f< 0)
+                  abs_ret = -1 *quotesReturn["change"].to_f
+								%>
+									<span class="price-loss">$<%="%.2f" % (abs_ret)%></span>
+								<%
+								else
+								%>
+									<span>$<%=quotesReturn["change"]%></span>
+								<%
+                end
+                %>
+								</td>
+                <td><form action="/trade/confirmation" method="post">
+									<input type="hidden" name="QUANTITY" value="<%=quotesReturn["volume"]%>"/>
+									<input type="hidden" name="SYMBOL" value="<%=quotesReturn["symbol"]%>"/>
+									<input type="hidden" name="PRICE" value="<%=quotesReturn["price"]%>"/>
+									<input type="submit" name="BUY" value="Buy"></input></form></td></tr>
+							<%
+              end
+              %>
+						<%
+            end
+						symbolCount = symbolCount + 1
+            %>
+					<%
+          end
+          %>
+					</tbody></table>
+
+				<%
+        else
+        %>
+					<div class="main-title"><h1>Stock Quotes</h1>
+					<script type="text/javascript">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script>
+					</div>
+        <%
+        end
+        %>
+
+        
+</div>

Added: incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/register.html.erb
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/register.html.erb?rev=744093&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/register.html.erb (added)
+++ incubator/stonehenge/trunk/stocktrader/ruby/trader_client/views/trade/register.html.erb Fri Feb 13 12:04:55 2009
@@ -0,0 +1,81 @@
+<%=@message%>
+<div id="middle">
+				<div class="main-title">
+					<h1>Register</h1>
+					<script type="text/javascript">
+						var thisdate = new Date();
+						document.writeln(thisdate.toLocaleString());
+					</script>
+				</div>
+        
+        <%
+				if (@successfulRegistration)
+				%>
+					<p style="color: red" align="center">
+						Registration was successful, please <a href ="/trade/login">login</a>.</p>
+				<%
+        else
+					if (@invalidInformation)
+				  %>
+						<p style="color: red" align="center">Please enter valid information.</p>
+					<%
+          end
+          %>
+					<table class="profile" cellspacing="0" width="100%">
+					<thead>
+					<tr>
+					<th>
+					Create Account Profile:
+					</th>
+					</tr>
+					</thead>
+					<tbody>
+					<tr>
+						<td>
+							<form action="/trade/register" method="post">
+							<table cellspacing="0" align="center">
+								<tr>
+									<td colspan="4" >
+										&nbsp;
+									</td>
+								</tr>
+								<tr>
+									<td>Requested ID:</td>
+									<td><input name="REQUESTEDID" type="text" id="" size="25"/></td>
+									<td>Opening Balance:</td>
+									<td><input type="text" name="OPENBALANCE" value="100000" id="" size="25"/></td>
+								</tr>
+								<tr>
+									<td>Full Name:</td>
+									<td><input type="text" name="FULLNAME" id="" size="25"/></td>
+									<td>Email Address:</td>
+									<td><input type="text" name="EMAIL" id="" size="25"/></td>
+								</tr>
+								<tr>
+									<td>Address:</td>
+									<td><input name="ADDRESS" type="text" id="" size="25"/></td>
+									<td>Password:</td>
+									<td><input name="PASSWORD" type="password" id="" size="25"/></td>
+								</tr>
+								<tr>
+									<td>Credit Card:</td>
+									<td><input name="CREDITCARD" type="text" id="" size="25"/></td>
+									<td>Confirm Password:</td>
+									<td><input name="CONFIRMATIONPASSWORD" type="password" id="" size="25"/></td>
+								</tr>
+								<tr>
+									<td colspan="4" class="button">
+										<input type="submit" name="REGISTERUSER" value="Register" class="button"/>
+									</td>
+								</tr>
+							</table>
+							</form>	
+						</td>
+					</tr>
+					</tbody>
+					</table>
+				<%
+        end
+        %>
+</div>
+



Mime
View raw message