<% Sub logTransaction (rstat, pstat, txID, txtype, payment, email, userID, iname, note, fname, lname, IP, merchant, isPosted, isPackage, packID, pexp) On Error Resume Next setLocale server_locale sdd = dd(objConn) txID = CryptText(txID, adminkey, False) email = CryptText(email, adminkey, False) userID = CLng(userID) strLogSQL = "INSERT INTO " & tablPfx & "Plog(pdate,rstat,pstat,txID,txtype,payment,email,userID,iname,fname,lname,IP,merchant,inote) " strLogSQL = strLogSQL & " VALUES (" & sdd & ConvDate(Now) & sdd & ",'" & sq(rstat) & "','" & sq(pstat) & "','" & sq(txID) & "','" & sq(txtype) & "','" & payment strLogSQL = strLogSQL & "','" & sq(email) & "'," & userID & ",'" & sq(iname) & "','" & sq(fname) & "','" & sq(lname) & "','" strLogSQL = strLogSQL & IP & "','" & sq(merchant) & "','" & sq(note) & "');" objConn.Execute(strLogSQL) If isPosted then Select Case isPackage Case False '*** Credits Mode strUser = "SELECT nick,email,credits FROM " & tablUPfx & "User WHERE userID = " & userID & ";" set rsUser = objConn.Execute(strUser) If Not rsUser.EOF then uNick = rsUser(0) uEmail = CryptText(rsUser(1), key, True) credits = CCur(rsUser(2)) Else: Exit Sub End If rsUser.close Set rsUser = Nothing Select Case txtype Case "reversal": template = getTemplate("Credits_Remove", uEmail, Empty, uNick, Empty, Empty) Case Else: template = getTemplate("Credits_Add", uEmail, Empty, uNick, Empty, Empty) End Select TemplateArray = Split(template, s) uSubject = TemplateArray(0) uBody = TemplateArray(1) uBody = Replace(uBody, ":adCred:", payment) Call sendEmail(uEmail, notify_email, uSubject, uBody) payment = CCur(payment) creditsUpdate = FormatNumber(credits + payment, 2) objConn.Execute("UPDATE " & tablUPfx & "User SET credits = '" & creditsUpdate & "' WHERE userID = " & userID & ";") Case True '*** Package Mode strUser = "SELECT nick,email FROM " & tablUPfx & "User WHERE userID = " & userID & ";" set rsUser = objConn.Execute(strUser) If Not rsUser.EOF then uNick = rsUser(0) uEmail = CryptText(rsUser(1), key, True) Else: Exit Sub End If rsUser.close Set rsUser = Nothing Select Case txtype Case "reversal": template = getTemplate("Package_Remove", uEmail, Empty, uNick, Empty, Empty) Case Else: template = getTemplate("Package_Add", uEmail, Empty, uNick, Empty, Empty) End Select TemplateArray = Split(template, s) uSubject = TemplateArray(0) uBody = TemplateArray(1) uBody = Replace(uBody, ":adCred:", iname) Call sendEmail(uEmail, notify_email, uSubject, uBody) packID = CLng(PackID) expdate = ConvDate(pexp) objConn.Execute("UPDATE " & tablUPfx & "User SET paypack = " & packID & ", pexpire = " & sdd & expdate & sdd & " WHERE userID = " & userID & ";") End Select End If End Sub %>