 |
<%
Dim allowed
allowed = "23456789TJQKA"
Dim pass1, pass2, handname, handnamefull, handnamesimple, suit, wherec, wherec2, display, temp
pass1 = Request("first")
pass2 = Request("second")
suit = Request("suited")
if suit = "" then
suit = "N"
end if
display = 0
if pass1 = "" Or pass2 = "" then
display = 1
end if
if InStr(allowed, pass1) <= 0 then
display = 2
end if
if InStr(allowed, pass2) <= 0 then
display = 2
end if
if InStr(allowed, pass1) < InStr(allowed, pass2) then
temp = pass1
pass1 = pass2
pass2 = temp
end if
if display = 0 then
%>
<%
if pass1 = pass2 then
suit="N"
handname = "Pocket " & CardName(pass1) & "s"
handnamesimple = pass1 & " " & pass2
handnamefull = pass1 & " " & pass2 & " (Pocket " & CardName(pass1) & "s)"
elseif suit = "Y" then
handname = pass1 & " " & pass2 & " Suited"
handnamesimple = pass1 & " " & pass2
handnamefull = handname
else
handname = pass1 & " " & pass2
handnamesimple = pass1 & " " & pass2
handnamefull = handname
end if
if InStr(allowed, pass1) > InStr(allowed, pass2) then
wherec = "first_card = '" & pass1 & "' and second_card = '" & pass2 & "' and suited = '"&suit&"' "
wherec2 = "first_card = '" & pass1 & "' and second_card = '" & pass2 & "' "
else
wherec = "first_card = '" & pass1 & "' and second_card = '" & pass2 & "' and suited = '"&suit&"' "
wherec2 = "first_card = '" & pass1 & "' and second_card = '" & pass2 & "' "
end if
Response.Write "What to do with " & handnamefull & "?"
Dim sConnection, objConn , objRS
sConnection = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=mysql107.secureserver.net;PORT=3306;DATABASE=myoutsdb;USER=myoutsdb;PASSWORD=power22ME;OPTION=0;"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(sConnection)
Dim mySQL
if (suit = "Y") then
mySQL = "INSERT INTO CheckHand_Log (datestamp, ipaddr, searchon) VALUES (CURRENT_TIMESTAMP(),'" & Request.ServerVariables("remote_addr") & "','" & handnamesimple & " suited') "
else
mySQL = "INSERT INTO CheckHand_Log (datestamp, ipaddr, searchon) VALUES (CURRENT_TIMESTAMP(),'" & Request.ServerVariables("remote_addr") & "','" & handnamesimple & " offsuit') "
end if
objConn.Execute(mySQL)
Set objRS = objConn.Execute("SELECT first_card, second_card, suited, early_pos, mid_pos, late_pos FROM GoodHand WHERE " & wherec)
if objRS.EOF then
Response.Write " "
Response.Write " "
Response.Write " "
Response.Write " "
else
Response.Write " "
if (objRS.Fields("early_pos") = "F") then
Response.Write " "
elseif (objRS.Fields("early_pos") = "C") then
Response.Write " "
elseif (objRS.Fields("early_pos") = "R") then
Response.Write " "
end if
if (objRS.Fields("mid_pos") = "F") then
Response.Write " "
elseif (objRS.Fields("mid_pos") = "C") then
Response.Write " "
elseif (objRS.Fields("mid_pos") = "R") then
Response.Write " "
end if
if (objRS.Fields("late_pos") = "F") then
Response.Write " "
elseif (objRS.Fields("late_pos") = "C") then
Response.Write " "
elseif (objRS.Fields("late_pos") = "R") then
Response.Write " "
end if
' Response.Write "In Early Position (You are the blinds or were just the blinds) : " & CRF(objRS.Fields("early_pos")) & "
"
' Response.Write "In Middle Position (Not early or late) : " & CRF(objRS.Fields("mid_pos")) & "
"
' Response.Write "In Late Position (On dealer button or will be next) : " & CRF(objRS.Fields("late_pos")) & "
Response.Write "
"
end if
objRS.Close
Set objRS = Nothing
Set objRS = objConn.Execute("SELECT first_card, second_card, suited, odds2, odds6 FROM OddsDB WHERE " & wherec)
if Not objRS.EOF then
Dim potodds2, potodds6
potodds2 = CInt(100 / 2)
potodds6 = Cint(100 / 6)
Response.Write "Odds"
Response.Write "Against Five Other Players : " & objRS.Fields("odds6") & "% (pot odds = " & potodds6 & "%) "
Response.Write "Heads Up Against Only One : " & objRS.Fields("odds2") & "% (pot odds = " & potodds2 & "%)
"
end if
objRS.Close
Set objRS = Nothing
Set objRS = objConn.Execute("SELECT first_card, second_card, nickname, nickname_history FROM HandHistory WHERE " & wherec2)
if Not objRS.EOF then
Response.Write "Did You Know?"
if objRS.Fields("nickname") <> "" then
Response.Write handnamesimple & " is sometimes known as : " & objRS.Fields("nickname") & " "
end if
if objRS.Fields("nickname_history") <> "" then
Response.Write "Why? " & objRS.Fields("nickname_history") & " "
end if
if objRS.Fields("nickname") <> "" then
Response.Write " "
end if
end if
objRS.Close
Set objRS = Nothing
Set objRS = objConn.Execute("SELECT first_card, second_card, Admins.name, comment FROM HandComments, Admins WHERE HandComments.admin_id = Admins.admin_id AND " & wherec2)
While Not objRS.EOF
if objRS.Fields("comment") <> "" then
Response.Write "" & objRS.Fields("name") & "'s Take on " & handname & " " & objRS.Fields("comment") & " "
end if
objRS.MoveNext
WEnd
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
elseif display = 1 then
%>
<%
elseif display = 2 then
%>
Error: Each card must be one of the following values:
2, 3, 4, 5, 6, 7, 8, 9, T, J, Q, K, A
<%
end if
Function CRF(instr)
If instr = "C" Then
CRF = "Check or Call the Big Blind"
ElseIf instr = "R" Then
CRF = "Raise or Call a Raise"
ElseIf instr = "F" Then
CRF = "Check or Fold"
End If
End Function
Function CardName(instr)
If instr = "A" Then
CardName = "Ace"
ElseIf instr = "K" Then
CardName = "King"
ElseIf instr = "Q" Then
CardName = "Queen"
ElseIf instr = "J" Then
CardName = "Jack"
ElseIf instr = "T" Then
CardName = "Ten"
Else
CardName = instr
End If
End Function
%>
|
|
 |
|
 |
 |