<% @Language="VBScript" %> <% CONST INVALID_CODE = "invalid.gif" CONST VALID_CODE = "attendant.gif" CONST POWERED_BY_IPOOL = "pwrd_by_ipool.gif" CONST POWERED_BY_PC24 = "pwrd_by_pc24.gif" CONST GOLD = "gold.gif" CONST SILVER = "silver.gif" CONST BRONZE = "bronze.gif" '================================== ' G E T B I N A R Y F I L E '================================== Function getBinaryFile(strFilePath) Dim TypeBinary, oStream TypeBinary = 1 ' Indicates a binary file ' Create the object Set oStream = Server.CreateObject("ADODB.Stream") oStream.Open oStream.Type = TypeBinary oStream.LoadFromFile strFilePath getBinaryFile = oStream.read Set oStream = Nothing End Function '============================= ' S E N D G I F '============================= Function sendGif(gifName) Dim binData binData = getBinaryFile(Server.MapPath("./pix/" & gifName)) Response.ContentType = "image/gif" Response.BinaryWrite binData Response.Flush Response.End End Function '============================= ' S C R I P T B O D Y '============================= If Request("sp") <> "" Then Set rs = con.execute("select * from crosslinx where page='" & Request.ServerVariables("HTTP_REFERER") & "'") If rs.EOF And rs.BOF Then con.execute("insert into crosslinx (page) values ('" & Request.ServerVariables("HTTP_REFERER") & "')") End If Select Case Request("sp") Case "pc24" sendGif(POWERED_BY_PC24) Case "ipool" sendGif(POWERED_BY_IPOOL) End Select ElseIf Request("aid") <> "" Then ''' Dim objAttendant ''' Set objAttendant = New Attendant ''' objAttendant.AttendantId = Int(Request("aid")) - ADD_TO_ATTENDANT_ID ''' objAttendant.Load() Set rs = con.execute("select * from awardwinner where attendantId=" & Int(Request("aid")) - ADD_TO_ATTENDANT_ID & " and winningDate < NOW()) If rs.EOF And rs.BOF Then sendGif(VALID_CODE) Else Select Case rs("winsWhat") Case "G" sendGif(GOLD) Case "S" sendGif(SILVER) Case "B" sendGif(BRONZE) End Select End If rs.Close() Else sendGif(INVALID_CODE) End If %>