<%if session("username") = "" then response.Redirect("login.asp") End if set r=Server.CreateObject("ADODB.RECORDSET") r.open "select * from stock where ipo=true",conn,3,2 while not r.eof set rr = Server.CreateObject("adodb.recordset") rr.open "select sum(purchaseprice) as sumofpurchase,sum(totalshares) as totalshare,count(purchaseprice) as countofpurchase from sharestable where stockid="&r("stockid"),conn av = cdbl(rr("sumofpurchase")) / cdbl(rr("totalshare")) r("currentprice") = av r.update r.movenext wend %> Buy Order
 
<% set rsb = Server.CreateObject("ADODB.RECORDSET") rsb.open "SELECT Buyorder.*, UserPetTable.userpetName FROM UserPetTable INNER JOIN Buyorder ON UserPetTable.userPetId = Buyorder.userpetid WHERE (((Buyorder.stockid)="&request("ipo")&"));",conn,3,2 if Request("cnt1") = "" then cnt1 = 0 else cnt1 = cint(request("cnt1")) if cnt1 < 0 then cnt1 = 0 end if end if %> <%if rsb.eof then Response.Write("No Items Available in Buyer Order") else rsb.move cnt1+0,1 %> <% counter = cnt1 for i=1 to 10 if not rsb.eof then %> <% counter = counter + 1 rsb.movenext end if next%>
  Buy Orders
Buyer Name Price Per Share Shares Wanted Total Value of Shares Wanted Date Posted
"><%=rsb("userpetname")%> <%=rsb("pricepershare")%> <%=rsb("shareswanted")%> <%=rsb("shareswanted")*rsb("pricepershare")%> <%=rsb("dateposted")%>
<%if counter > 10 then%> <   <%else%> < <%end if%> <%if not rsb.eof then%> > <%else%> > <%end if %>
<%end if%>
<% if not session("petitemid")="" then set rsp =Server.CreateObject("adodb.recordset") rsp.open "SELECT UserPetTable.userpetName, PetTable.petName, UserPetTable.energylevel, PetTable.smallimg FROM PetTable INNER JOIN UserPetTable ON PetTable.petId = UserPetTable.petId WHERE (((UserPetTable.userPetId)=" & session("petitemid") & "));",conn if not rsp.eof then %>
" width="34" height="34">
Pet Name <%=rsp("userpetname")%>
Pet Type <%=rsp("petname")%>
Energy Level <%=rsp("energylevel")%>
 
<%end if end if %>
<%set rsi = Server.CreateObject("adodb.recordset") rsi.open "SELECT sharestable.*, UserPetTable.Companyname FROM UserPetTable INNER JOIN sharestable ON UserPetTable.userPetId = sharestable.userpetid WHERE (((UserPetTable.userpetid)=" & session("petitemid")&"));",conn ,adOpenStatic, adLockReadOnly if not rsi.eof then rsi.move clng(request("total"))+0,1 %> 0 <%else%> <%=request("total")%> <%end if%> " > <%for i=0 to 4 if not rsi.eof then %> <% rsi.movenext end if next%>
Company Name Shares qty
<% set rsstockcompany = Server.CreateObject("ADODB.RECORDSET") rsstockcompany.open "SELECT UserPetTable.Companyname FROM UserPetTable INNER JOIN stock ON UserPetTable.userPetId = stock.userpetid WHERE (((stock.Stockid)="&rsi("stockid")&"));",conn if not rsstockcompany.eof then Response.Write(rsstockcompany("Companyname")) end if %> <%=rsi("totalshares")%>
<%=total %>
<%if rsi.recordcount > 5 then%> Back Next <%end if%> <%end if%>