<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import="Juno2.PositionVO" %>
<%@ page import="Juno2.EquityVO" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.HashMap" %>
<html>
<HEAD>
<META name="GENERATOR" content="IBM WebSphere Studio">
</HEAD>
<%@ include file="JTSheader.html" %>
<% 
String firstName = (String) session.getAttribute("firstName");
String lastName = (String) session.getAttribute("lastName");
String userID = (String) session.getAttribute("userId");
String userPassword = (String) session.getAttribute("userPassword");
%>

<center>
<title>Position Summary</title>
<h1>Summary of Positions for 
<%= firstName  %> 
<%= lastName %> </h1>


<input type="hidden" name="username" value="<%=userID%>">
<input type="hidden" name="password" value="<%=userPassword%>">

<%
  HashMap h = (HashMap) session.getAttribute("PositionList");
  HashMap e = (HashMap) session.getAttribute("EquityList");  
  if (h != null) {
%>
    <table cellpadding=10 border=1>
    <tr> 
    <th>Account ID</th>
    <th>Number of Shares</th>
    <th>CostBasis</th>
    <th>Equity Price</th>
    <tr>

<%
    Iterator positions = h.keySet().iterator();
    while (positions.hasNext()) {
      String symbol = (String) positions.next();
      PositionVO pos = (PositionVO) h.get(symbol);
      EquityVO eq = (EquityVO) e.get(symbol);
%>
      <tr align="center">
      <td><%= pos.getSymbol() %></td>
      <td><%= pos.getNumberOfShares() %></td>
      <td>$<%= pos.getCostBasis() %></td>
      <td>$<%= eq.getPrice() %></td>
      <td>
<% 
  if (!symbol.equals("CASH")) {
%>
        <a href="sell.do?cmd=sell&acct=<%=pos.getAccountId()%>&sym=<%=pos.getSymbol()%>">Sell</a>
<%
}
%>
      </td>
      </tr>
<%
    }
  }
%>
    </table>
</center>
<%@ include file="JTSfooter.html" %>

</html>
