<%@ Language="Jscript" %> <% sql = "update game set gamestatusid = 3, completetime = '" + getDate() + "' where id = " + Request.QueryString("gameid"); conn.Execute(sql); var touserid = ""; var toaddress = ""; var toname = ""; var rs = Server.Createobject("adodb.recordset"); var sql = "select * from game where id = " + Request.QueryString("gameid"); rs.open(sql, conn); var user1id = String(rs("user1id")); var user2id = String(rs("user2id")); rs.Close; //send email to user if (Session("userid") == user1id) touserid = user2id; else touserid = user1id; sql = "select email, username from [user] where id = " + touserid; rs.Open(sql); toaddress = String(rs("email")); toname = String(rs("username")); var title = ""; var body = ""; title = "Game result reported!"; body = "Hi " + toname + "\n\n"; body += "Your opponent has reported the result of a game you were playing.\n"; body += "Please review the result at the Empire Deluxe Ladder in order to give your accept.\n"; body += "\nThe Empire Deluxe Ladder\n"; body += "www.givoni.com/empire/"; sendEmail(toaddress, title, body); Response.Redirect("../change_game_details.asp?gameid=" + Request.QueryString("gameid")); %>