<% # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. %>

Home

Welcome <%=@userId%>

<% if(@accountDataReturn) creationDate = convert_date(@accountDataReturn["creationDate"]) lastLogin = convert_date(@accountDataReturn["lastLogin"]) %> <% end %> <% if (!(@holdingInfo == nil) || (@accountDataReturn == nil)) %> <% end %>
User Statistics
Account ID: <%=@accountDataReturn["accountID"]%>
Account Created: <%=creationDate%>
Total Logins: <%=@accountDataReturn["loginCount"]%>
Session Created: <%=lastLogin%>
Summary
Cash Balance: <%=@accountDataReturn["balance"]%>
Number of Holdings: <%=@noOfHoldings%>
Total of Holdings: <%=@totalHoldings%>
Sum of Cash and Holdings: $<%=@totalHoldings.to_f + (@accountDataReturn["balance"].to_f)%>
Opening Balance: $ <%=@accountDataReturn["openBalance"]%>
Current Gain/(Loss): <% 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 %>
%Gain/(Loss): <% if (gainPercent > 0) %> <%=gainPercent%>% <% elsif (gainPercent < 0) %> <%=gainPercent%> <% else %> <%=gainPercent%>% <% end %>

Market Summary

<% if ((@holdingInfo != nil) && (@accountDataReturn != nil)) %>
Trade Stock Index (TSIA) <%="%.2f" % @tsia%> <% if (@gain > 0) %> $ <% elsif (@gain < 0) %> $ <% else %> $ <% end %> <%="%.2f" % (@gain.to_f)%>
Trading Volume <%=@volume%>
Top Gainers <% index = 0 gainer = @topGainers[index] while(gainer != nil) %> <% index = index + 1 gainer = @topGainers[index] end %>
SymbolPriceChange
"/> ">
$<%=gainer["price"]%> <% if ((gainer["change"].to_f) > 0) %> $ <% elsif ((gainer["change"].to_f) < 0) %> $ <% else %> $ <% end %> <%=gainer["change"]%>
Top Losers <% index = 0 loser = @topLosers[index] while(loser) %> <% index = index + 1 loser = @topLosers[index] end %>
SymbolPriceChange
">
$<%=loser["price"]%> <% if ((loser["change"].to_f) > 0) %> $ <% elsif ((loser["change"].to_f) < 0) %> $ <% else %> $ <% end %> <%=loser["change"]%>
<% end %>