<% 'This code is copyright (c) Internet Business Solutions SL, all rights reserved. 'The contents of this file are protect under law as the intellectual property 'of Internet Business Solutions SL. Any use, reproduction, disclosure or copying 'of any kind without the express and written permission of Internet Business 'Solutions SL is forbidden. 'Author: Vince Reid, vince@virtualred.net if storesessionvalue="" then storesessionvalue="virtualstore" if Session("loggedon") <> storesessionvalue OR disallowlogin=TRUE then response.end Dim sSQL,rs,cnn,success,showaccount,addsuccess,alldata,index,allcountries,rowcounter,sd,ed,errmsg Dim affilName,affilPW,affilAddress,affilCity,affilState,affilZip,affilCountry,affilEmail,affilInform,smonth addsuccess = true success = true showaccount = true if dateadjust="" then dateadjust=0 thedate = DateAdd("h",dateadjust,Now()) thedate = DateSerial(year(thedate),month(thedate),day(thedate)) Set rs = Server.CreateObject("ADODB.RecordSet") Set cnn=Server.CreateObject("ADODB.Connection") cnn.open sDSN alreadygotadmin = getadminsettings() if request.form("editaction")="modify" then sSQL = "UPDATE affiliates SET affilPW='"&replace(trim(request.form("affilPW")),"'","''") & "'," & _ "affilEmail='"&replace(trim(request.form("Email")),"'","''") & "'," & _ "affilName='"&replace(trim(request.form("Name")),"'","''") & "'," & _ "affilAddress='"&replace(trim(request.form("Address")),"'","''") & "'," & _ "affilCity='"&replace(trim(request.form("City")),"'","''") & "'," & _ "affilState='"&replace(trim(request.form("State")),"'","''") & "'," & _ "affilCountry='"&replace(trim(request.form("Country")),"'","''") & "'," & _ "affilZip='"&replace(trim(request.form("Zip")),"'","''") & "'," if trim(request.form("affilCommision"))="" then sSQL = sSQL & "affilCommision=0," else sSQL = sSQL & "affilCommision="&trim(request.form("affilCommision"))&"," end if if trim(request.form("Inform"))="ON" then sSQL = sSQL & "affilInform=1 " else sSQL = sSQL & "affilInform=0 " end if sSQL = sSQL & "WHERE affilID='" & replace(trim(request.form("affilID")),"'","''") & "'" cnn.Execute(sSQL) elseif request.form("editaction")="delete" then sSQL = "DELETE FROM affiliates WHERE affilID='" & replace(trim(request.form("affilID")),"'","''") & "'" cnn.Execute(sSQL) end if if Trim(request.querystring("id"))<>"" then sSQL = "SELECT affilName,affilPW,affilAddress,affilCity,affilState,affilZip,affilCountry,affilEmail,affilInform,affilCommision FROM affiliates WHERE affilID='"&Trim(request.querystring("id"))&"'" rs.Open sSQL,cnn,0,1 if NOT rs.EOF then affilName = rs("affilName") affilPW = rs("affilPW") affilAddress = rs("affilAddress") affilCity = rs("affilCity") affilState = rs("affilState") affilZip = rs("affilZip") affilCountry = rs("affilCountry") affilEmail = rs("affilEmail") affilInform = Int(rs("affilInform"))=1 affilCommision = rs("affilCommision") end if rs.Close %>
<% if NOT addsuccess then %> <% end if %> <% session.LCID = 1033 %> <% session.LCID = saveLCID %>
<%=yyAffAdm%>
<%=yyAffDup%>
*<%=yyAffId%>: <%=Trim(request.querystring("id"))%> " /> *<%=yyPass%>:
*<%=yyName%>: *<%=yyEmail%>:
*<%=yyAddress%>: *<%=yyCity%>:
*<%=yyState%>: *<%=yyCountry%>:
*<%=yyZip%>: Inform me: />
<%=yyCommis%>:%
  • <%=yyAffInf%>
<% else if Request("sd") = "" then sd=DateSerial(DatePart("yyyy",thedate),DatePart("m",thedate),1) else sd=Request("sd") end if if Request("ed") = "" then ed=thedate else ed=Request("ed") end if on error resume next sd = DateValue(sd) ed = Datevalue(ed) if err.number <> 0 then sd = DateSerial(DatePart("yyyy",thedate),DatePart("m",thedate),1) ed = thedate success=false errmsg=yyDatInv end if on error goto 0 tdt = DateValue(sd) tdt2 = DateValue(ed)+1 if mysqlserver=true then sSQL = "SELECT affilID,affilName,affilPW,affilEmail,affilCommision,SUM(ordTotal-ordDiscount) FROM affiliates LEFT JOIN orders ON affiliates.affilID=orders.ordAffiliate WHERE ordStatus>=3 AND ordDate BETWEEN "&datedelim&VSUSDate(tdt)&datedelim&" AND "&datedelim&VSUSDate(tdt2)&datedelim&" OR orders.ordAffiliate IS NULL GROUP BY affilID ORDER BY affilID" else sSQL = "SELECT affilID,affilName,affilPW,affilEmail,affilCommision,(SELECT Sum(ordTotal-ordDiscount) FROM orders WHERE ordStatus>=3 AND ordAffiliate=affilID AND ordDate BETWEEN "&datedelim&VSUSDate(tdt)&datedelim&" AND "&datedelim&VSUSDate(tdt2)&datedelim&") FROM affiliates ORDER BY affilID" end if rs.Open sSQL,cnn,0,1 if NOT rs.EOF then alldata=rs.GetRows() rs.Close %>
<% if NOT IsArray(alldata) then %> <% else for index=0 to UBOUND(alldata,2) %> <% next %> <% end if %>
<%=yyAffAdm%>
 
<% if NOT success then response.write "

"&errmsg&"

" %>
<%=yyAffBet%>: <%=yyAnd%>:
 

<%=yyAffFrm%>: <%=yyTo%>:
 

<%=yyAffId%> <%=yyName%> <%=yyEmail%> <%=yyTotSal%> <%=yyCommis%> <%=yyDelete%>

 
<%=yyNoAff%>
 
<%=alldata(0,index)%> <%=alldata(1,index)%> <%=alldata(3,index)%> <%if NOT IsNumeric(alldata(5,index)) then response.write "-" else response.write FormatEuroCurrency(alldata(5,index))%> <%if NOT IsNumeric(alldata(5,index)) OR alldata(4,index)=0 then response.write "-" else response.write FormatEuroCurrency((alldata(4,index)*alldata(5,index)) / 100.0)%> ')" />
<% end if cnn.Close set rs = nothing set cnn = nothing %>