<%@ Language=VBScript %> <% Response.Expires=-1 'Response.write Session("ValidUser") If Session("ValidUser") <> 1 then Response.Redirect "login.asp" Else Session("LastPage") = Session("CurrentPage") Session("CurrentPage") = "ClientFigures.asp" End if '///////////////////////////////////////////////////////////////////////////////////// '/ '/ Functions '/ '///////////////////////////////////////////////////////////////////////////////////// public function dateout(var) dim formed_year : formed_year = right(datepart("yyyy",var),4) dim formed_month : formed_month = right("0" & datepart("m",var),2) dim formed_day : formed_day = right("0" & datepart("d",var),2) dim formed_hour : formed_hour = right("0" & datepart("h",var),2) dim formed_minute : formed_minute = right("0" & datepart("n",var),2) dim formed_second : formed_second = right("0" & datepart("s",var),2) dim return : return = formed_month & "/" & _ formed_day & "/" & _ formed_year dateout = return end function Function GetPendingWagers() strConn = ";DRIVER={SQL Server};UID=BetUser;PWD=12NewYorkcitY2006;DATABASE=Betrci;SERVER=localhost;" Set oConn = server.CreateObject("adodb.connection") oConn.Open strConn sSql = "Select * from vwBetsWebView where upper(userid) = '" & ucase(Session("Usercode")) & "' AND (BetResult = 'Pending')" Set RS = Server.CreateObject("ADODB.Recordset") RS.CursorType = 3 RS.CursorLocation = 3 RS.ActiveConnection = oConn RS.Open sSql Set GetPendingWagers= RS End Function Function GetCurrentActivity(sType) strConn = ";DRIVER={SQL Server};UID=BetUser;PWD=12NewYorkcitY2006;DATABASE=Betrci;SERVER=localhost;" Set oConn = server.CreateObject("adodb.connection") oConn.Open strConn if ucase(sType) <> "FIGURES" then sStartDate = now() - (weekday(now(), vbMonday) - 1) sEndDate = now + 7 - weekday(now(), vbMonday) Else sStartDate = now() - 55 sEndDate = now() end if Response.write "Start Date:" & sStartDate & "
" Response.write "Stop Date:" & sEndDate & "
" sSql = "Select * from vwBetsWebView where upper(userid) = '" & _ ucase(Session("Usercode")) & "' AND (BetResult <> 'Pending') " & _ "And [Timestamp] between '" & sStartDate & "' and '" & sEndDate & "'" Set RS = Server.CreateObject("ADODB.Recordset") RS.CursorType = 3 RS.CursorLocation = 3 RS.ActiveConnection = oConn RS.Open sSql Set GetCurrentActivity = RS End Function '///////////////////////////////////////////////////////////////////////////////////// '/ '/ Main Section '/ '///////////////////////////////////////////////////////////////////////////////////// Dim oRS Dim iResult Dim strConn Dim oConn Dim sSQL Dim iColor iColor=0 strConn = ";DRIVER={SQL Server};UID=BetUser;PWD=12NewYorkcitY2006;DATABASE=Betrci;SERVER=localhost;" Set oConn = server.CreateObject("adodb.connection") oConn.Open strConn %> Sure Bet <% Select case ucase(Request.QueryString("Type")) case "FIGURES" sHeading = "Daily Figures for Client: " & Session("Usercode") Set oRS = GetCurrentActivity("Figures") Response.write "Recordcount is: " & oRS.recordcount & "
" case "ACTIVITY" sHeading = "Activity for Client: " & Session("Usercode") Set oRS = GetCurrentActivity("Activity") Response.write "Recordcount is: " & oRS.recordcount & "
" case else sHeading = "Daily Figures for Client: " & Session("Usercode") Set oRS = GetCurrentActivity("Activity") Response.write "Recordcount is: " & oRS.recordcount & "
" End Select Response.write("Page Type: " & "" & Request.QueryString("Type")) & "

" %> <% If Session("ValidUser") <> 1 then Response.write "" Else Response.write "" End if %>
 
 

<%= sHeading %>

 

<% Do While Not oRS.EOF %> <% oRS.Movenext Loop %>
Date / Time
Wager Confirmation #
Wager Type
Wager
Result
Total
Balance
  <%= oRS.Fields("Timestamp").value %>
 <%= oRS.Fields("BetType").value %>
 <%= FormatCurrency(oRS.Fields("BetAmount").value, 2) %>
 <%= oRS.Fields("BetResult").value %>
  <% if oRS.Fields("BetResult").value = "Lost" then Response.write "" Response.write FormatCurrency(oRS.Fields("BetAmount").value * -1, 2) dBalance = dBalance + oRS.Fields("BetAmount").value * -1 else Response.write "" Response.write FormatCurrency(oRS.Fields("PayAmount").value, 2) dBalance = dBalance + oRS.Fields("BetAmount").value end if %> <% if dBalance < 0 then Response.write " " Response.write FormatCurrency(dBalance , 2) else Response.write " " Response.write FormatCurrency(dBalance , 2) end if %>