Corey Bryant
08-19-2003, 04:16 AM
Having some issues with a affiliate log. It does not seem to show the moneys owed. I think it is in the connection string:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="datafunc.asp"-->
<%
dim Sql
dim Sql2
dim SqlAff
dim dateRange
dim sUserName
dim oRsAff
dim oRsAffLog
Dim AffID
sUserName = Session("MM_Username")
dateRange = Request.Form("dateRange")
Call OpenDB()
SqlAff = "SELECT * FROM Affiliates WHERE Username = '" & sUserName & "'"
Set oRsAff = dbConn.Execute(SqlAff)
if not oRsAff.EOF Then
AffID = oRsAff("AffiliateID")
Else
End if
Select case dateRange
Case 13
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '01/01/2003' AND '12/31/2003')"
Case 1
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '01/01/2003' AND '01/31/2003')"
Case 2
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '02/01/2003' AND '02/29/2003')"
Case 3
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '03/01/2003' AND '03/31/2003')"
Case 4
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '04/01/2003' AND '04/31/2003')"
Case 5
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '05/01/2003' AND '05/31/2003')"
Case 6
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '06/01/2003' AND '06/31/2003')"
Case 7
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '07/01/2003' AND '07/31/2003')"
Case 8
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '08/01/2003' AND '08/31/2003')"
Case 9
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '09/01/2003' AND '09/31/2003')"
Case 10
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '10/01/2003' AND '10/31/2003')"
Case 11
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '11/01/2003' AND '11/31/2003')"
Case 12
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '12/01/2003' AND '12/31/2003')"
End Select
'Response.Write(dateRange)
'Response.End()
if dateRange <> "" Then
Set oRsAffLog = dbConn.Execute(Sql)
End if
%>
<HTML><!-- InstanceBegin template="/Templates/merchant_Temp.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META name="description" content="MerchantAccounts 4 Less is an industry leader in credit card processing for traditional and Internet businesses. Get A Merchant Account Today! 98% Merchant Application Approval!">
<META name="keywords" content="merchant account, Cardservice International, credit card, virtual terminal, online purchasing, credit card terminal, accept credit cards, visa, mastercard, american express, discover, e-commerce, payment solutions, online purchasing, credit card terminals, process credit cards, e-commerce, payment solutions">
<link rel="stylesheet" href="style.css" type="text/css">
<!-- InstanceBeginEditable name="doctitle" -->
<TITLE>Affordable Merchant Accounts 4 Less - Affiliates Sign Up</TITLE>
<!-- InstanceEndEditable --><style type="text/css">
.FormTextField
{
border:1px groove #3D5C85;
background-color: #D7DFE9;
font-family: arial;
font-size: 10pt;
color: #000000;
}
.button
{
border-style:solid;
border-width:1;
background-color: #D7DFE9;
color: #3D5C85;
font-family: Verdana;
font-weight:bold
}
</style>
<script src="pop-up.js">
</script>
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</HEAD>
<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<TABLE border=0 cellpadding=0 cellspacing=0>
<TR>
<TD rowspan=5>
<IMG src="credit_card_head.jpg" width="168" height="142"></TD>
<TD colspan=2 bgcolor=#3D5C85 class="topcell">
<IMG src="spacer.gif" width=612 height=32></TD>
</TR>
<TR>
<TD rowspan=3>
<IMG src="merchant_account_head2.jpg" width="155" height="66"></TD>
<TD>
<IMG src="credit_cards_head3.jpg" width="457" height="19"></TD>
</TR>
<TR>
<TD>
<IMG src="merchant_credit_cards.jpg" width="457" height="29"></TD>
</TR>
<TR>
<TD>
<IMG src="slogan.jpg" width="457" height="18"></TD>
</TR>
<TR>
<TD colspan=2>
<IMG src="process_credit_cards_head4.gif" width="612" height="44"></TD>
</TR>
</TABLE>
<table width="780" cellpadding="0" cellspacing="0">
<tr>
<td width="153" bgcolor="#375A83">
<script type='text/javascript'>
function Go(){return}
</script>
<script type='text/javascript' src='credit_card_menu.js'></script>
<script type='text/javascript' src='menu_com.js'></script>
</td>
<td width="627" background="bg1.gif">
<table width="627" cellpadding="10"><tr><td>
<!-- content -->
<!-- InstanceBeginEditable name="mainEditRegion" -->
<h3>Affiliates - Log</h3>
<p> </p>
<p align="center">
<img border="0" src="merchant_account.gif" width="493" height="10" alt="Affiliates"> </p>
<table width="493" border="0" align="center">
<tr>
<td colspan="2" bgcolor="#336699"><font color="#FFFFFF"> <strong>Affiliate <%=oRsAff("AffiliateID")%></strong></font></td>
</tr>
<tr>
<td width="213" valign="top"> Affiliate Name</td>
<td width="275"> <%=oRsAff("FNAme")%> <%=oRsAff("LName")%></td>
</tr>
<tr>
<td valign="top"> Affiliate Company</td>
<td> <%=oRsAff("Company")%></td>
</tr>
<tr>
<td height="26" valign="top"> Select Date Range</td>
<td align="right" valign="top">
<form name="AffLogForm" method="post" action="aff_log.asp">
<!--<form name="AffLogForm" method="post" action="debug.asp">-->
<select name="dateRange" class="FormTextField">
<option value="13">All</option>
<option value="1">January</option>
<option value="2">Febuary</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select> <input name="" type="submit" value="go" class="button">
</form>
</td>
</tr>
<tr>
<td colspan="2"> To update your information click <a href="aff_update.asp?number=<%=AffID%>">here</a></td>
</tr>
<tr>
<td colspan="2">
<table width="492" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#336699">
<td width="127"> <font color="#FFFFFF"><strong>Date</strong></font></td>
<td width="292"> <font color="#FFFFFF"><strong>Company</strong></font></td>
<td width="68"> <strong><font color="#FFFFFF">Amount</font></strong></td>
</tr>
<%
if dateRange <> "" Then
do while not oRsAffLog.eof%>
<tr>
<td> <%=oRsAffLog("signupDate")%></td>
<td> <%=oRsAffLog("Company")%></td>
<td> <%=FormatCurrency(oRsAffLog("amount"))%></td>
</tr>
<%
oRsAffLog.movenext
loop
else %>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<% end if%>
</table>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
Click
<a href="banner.asp">here</a> to add banners and/or co-branded
web pages
to your
website. In the meantime, if you have any questions please feel free to e-mail
us at <a href="mailto:affiliates@merchantaccounts4less.com">
affiliates@merchantaccounts4less.com</a>.
<!-- InstanceEndEditable -->
</td></tr></table>
</td>
</tr>
</table>
<!--#INCLUDE file="footer.asp" -->
</BODY>
<!-- InstanceEnd --></HTML>
<%
Call CloseDB()
%>
and in the datafunc.asp file:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
' functions to open and close the database connections
Dim rs, dbConn
Function OpenDB()
set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.Open "Provider=sqloledb;Data Source=64.26.22.77,1433;Network Library=DBMSSOCN;Initial Catalog=payit;User ID=payit;Password=crb_rg72;"
End Function
Function CloseDB()
' close cursor and database connection
Set rs = Nothing
' NOTICE! I used to have this as OBJECT, but
' found out later that it is now being returned as CONNECTION
' so update your code!
if ucase(TypeName(dbConn)) = "CONNECTION" then
dbConn.Close
Set dbConn = Nothing
end if
End Function
Function OpenRecordSet(recset, tablename)
Call OpenDB()
Set recset = Server.CreateObject("ADODB.Recordset")
recset.Open tablename, dbConn, 0, 1
End Function
Function CloseRecordSet(recset)
Set recset = Nothing
Call CloseDB()
End Function
</SCRIPT>
I had some work done on this, but the programmer is not around right now & I need to make sure this is working properly. Thanks!
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="datafunc.asp"-->
<%
dim Sql
dim Sql2
dim SqlAff
dim dateRange
dim sUserName
dim oRsAff
dim oRsAffLog
Dim AffID
sUserName = Session("MM_Username")
dateRange = Request.Form("dateRange")
Call OpenDB()
SqlAff = "SELECT * FROM Affiliates WHERE Username = '" & sUserName & "'"
Set oRsAff = dbConn.Execute(SqlAff)
if not oRsAff.EOF Then
AffID = oRsAff("AffiliateID")
Else
End if
Select case dateRange
Case 13
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '01/01/2003' AND '12/31/2003')"
Case 1
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '01/01/2003' AND '01/31/2003')"
Case 2
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '02/01/2003' AND '02/29/2003')"
Case 3
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '03/01/2003' AND '03/31/2003')"
Case 4
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '04/01/2003' AND '04/31/2003')"
Case 5
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '05/01/2003' AND '05/31/2003')"
Case 6
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '06/01/2003' AND '06/31/2003')"
Case 7
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '07/01/2003' AND '07/31/2003')"
Case 8
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '08/01/2003' AND '08/31/2003')"
Case 9
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '09/01/2003' AND '09/31/2003')"
Case 10
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '10/01/2003' AND '10/31/2003')"
Case 11
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '11/01/2003' AND '11/31/2003')"
Case 12
Sql = "SELECT aff_log.* FROM aff_log, Affiliates WHERE (aff_log.AffiliateID = " & AffID & " AND Affiliates.AffiliateID = " & AffID & ") AND (Affiliates.approved = 'y' AND aff_log.signupDate BETWEEN '12/01/2003' AND '12/31/2003')"
End Select
'Response.Write(dateRange)
'Response.End()
if dateRange <> "" Then
Set oRsAffLog = dbConn.Execute(Sql)
End if
%>
<HTML><!-- InstanceBegin template="/Templates/merchant_Temp.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META name="description" content="MerchantAccounts 4 Less is an industry leader in credit card processing for traditional and Internet businesses. Get A Merchant Account Today! 98% Merchant Application Approval!">
<META name="keywords" content="merchant account, Cardservice International, credit card, virtual terminal, online purchasing, credit card terminal, accept credit cards, visa, mastercard, american express, discover, e-commerce, payment solutions, online purchasing, credit card terminals, process credit cards, e-commerce, payment solutions">
<link rel="stylesheet" href="style.css" type="text/css">
<!-- InstanceBeginEditable name="doctitle" -->
<TITLE>Affordable Merchant Accounts 4 Less - Affiliates Sign Up</TITLE>
<!-- InstanceEndEditable --><style type="text/css">
.FormTextField
{
border:1px groove #3D5C85;
background-color: #D7DFE9;
font-family: arial;
font-size: 10pt;
color: #000000;
}
.button
{
border-style:solid;
border-width:1;
background-color: #D7DFE9;
color: #3D5C85;
font-family: Verdana;
font-weight:bold
}
</style>
<script src="pop-up.js">
</script>
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</HEAD>
<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<TABLE border=0 cellpadding=0 cellspacing=0>
<TR>
<TD rowspan=5>
<IMG src="credit_card_head.jpg" width="168" height="142"></TD>
<TD colspan=2 bgcolor=#3D5C85 class="topcell">
<IMG src="spacer.gif" width=612 height=32></TD>
</TR>
<TR>
<TD rowspan=3>
<IMG src="merchant_account_head2.jpg" width="155" height="66"></TD>
<TD>
<IMG src="credit_cards_head3.jpg" width="457" height="19"></TD>
</TR>
<TR>
<TD>
<IMG src="merchant_credit_cards.jpg" width="457" height="29"></TD>
</TR>
<TR>
<TD>
<IMG src="slogan.jpg" width="457" height="18"></TD>
</TR>
<TR>
<TD colspan=2>
<IMG src="process_credit_cards_head4.gif" width="612" height="44"></TD>
</TR>
</TABLE>
<table width="780" cellpadding="0" cellspacing="0">
<tr>
<td width="153" bgcolor="#375A83">
<script type='text/javascript'>
function Go(){return}
</script>
<script type='text/javascript' src='credit_card_menu.js'></script>
<script type='text/javascript' src='menu_com.js'></script>
</td>
<td width="627" background="bg1.gif">
<table width="627" cellpadding="10"><tr><td>
<!-- content -->
<!-- InstanceBeginEditable name="mainEditRegion" -->
<h3>Affiliates - Log</h3>
<p> </p>
<p align="center">
<img border="0" src="merchant_account.gif" width="493" height="10" alt="Affiliates"> </p>
<table width="493" border="0" align="center">
<tr>
<td colspan="2" bgcolor="#336699"><font color="#FFFFFF"> <strong>Affiliate <%=oRsAff("AffiliateID")%></strong></font></td>
</tr>
<tr>
<td width="213" valign="top"> Affiliate Name</td>
<td width="275"> <%=oRsAff("FNAme")%> <%=oRsAff("LName")%></td>
</tr>
<tr>
<td valign="top"> Affiliate Company</td>
<td> <%=oRsAff("Company")%></td>
</tr>
<tr>
<td height="26" valign="top"> Select Date Range</td>
<td align="right" valign="top">
<form name="AffLogForm" method="post" action="aff_log.asp">
<!--<form name="AffLogForm" method="post" action="debug.asp">-->
<select name="dateRange" class="FormTextField">
<option value="13">All</option>
<option value="1">January</option>
<option value="2">Febuary</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select> <input name="" type="submit" value="go" class="button">
</form>
</td>
</tr>
<tr>
<td colspan="2"> To update your information click <a href="aff_update.asp?number=<%=AffID%>">here</a></td>
</tr>
<tr>
<td colspan="2">
<table width="492" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#336699">
<td width="127"> <font color="#FFFFFF"><strong>Date</strong></font></td>
<td width="292"> <font color="#FFFFFF"><strong>Company</strong></font></td>
<td width="68"> <strong><font color="#FFFFFF">Amount</font></strong></td>
</tr>
<%
if dateRange <> "" Then
do while not oRsAffLog.eof%>
<tr>
<td> <%=oRsAffLog("signupDate")%></td>
<td> <%=oRsAffLog("Company")%></td>
<td> <%=FormatCurrency(oRsAffLog("amount"))%></td>
</tr>
<%
oRsAffLog.movenext
loop
else %>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<% end if%>
</table>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
Click
<a href="banner.asp">here</a> to add banners and/or co-branded
web pages
to your
website. In the meantime, if you have any questions please feel free to e-mail
us at <a href="mailto:affiliates@merchantaccounts4less.com">
affiliates@merchantaccounts4less.com</a>.
<!-- InstanceEndEditable -->
</td></tr></table>
</td>
</tr>
</table>
<!--#INCLUDE file="footer.asp" -->
</BODY>
<!-- InstanceEnd --></HTML>
<%
Call CloseDB()
%>
and in the datafunc.asp file:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
' functions to open and close the database connections
Dim rs, dbConn
Function OpenDB()
set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.Open "Provider=sqloledb;Data Source=64.26.22.77,1433;Network Library=DBMSSOCN;Initial Catalog=payit;User ID=payit;Password=crb_rg72;"
End Function
Function CloseDB()
' close cursor and database connection
Set rs = Nothing
' NOTICE! I used to have this as OBJECT, but
' found out later that it is now being returned as CONNECTION
' so update your code!
if ucase(TypeName(dbConn)) = "CONNECTION" then
dbConn.Close
Set dbConn = Nothing
end if
End Function
Function OpenRecordSet(recset, tablename)
Call OpenDB()
Set recset = Server.CreateObject("ADODB.Recordset")
recset.Open tablename, dbConn, 0, 1
End Function
Function CloseRecordSet(recset)
Set recset = Nothing
Call CloseDB()
End Function
</SCRIPT>
I had some work done on this, but the programmer is not around right now & I need to make sure this is working properly. Thanks!