<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "311, 332, 333, 335, 339, 354, 403, 404, 405, 406, 407, 408" strThisBackPage = "orders" %> <% '=============================================== ' CactuShop ASP Shopping Cart ' ©1999-2004 Cactusoft Ltd. www.cactusoft.com '=============================================== ' All rights reserved. ' Use of this code is covered by the terms and ' conditions in the license agreement. No ' unauthorized duplication or distribution is ' permitted. Cactusoft's copyright notices must ' remain in the ASP sections of the code. '=============================================== '----------------------------------------------- 'CUSTOMERS LIST 'Shows customers, allows the store owner to find 'a customer, list all their orders and give them 'a discount which will be applied to future 'purchases from the shop. '----------------------------------------------- strEmailAddress = request.querystring("CD_EmailAddress") numResultsLimit = request.querystring("numResultsLimit") If strEmailAddress <> "" then numResultsLimit = 99999 elseif numResultsLimit = "" or Not IsNumeric(numResultsLimit) then numResultsLimit = 20 end if If strDatabaseType = "mysql" Then strQuery = "SELECT * FROM tblCactuShopCardholderDetails WHERE CD_EmailAddress LIKE '%" & sqlsafe(strEmailAddress) & "%' AND CD_EmailAddress<>'' ORDER BY CD_ID LIMIT 0, " & numResultsLimit Else strQuery = "SELECT TOP " & numResultsLimit & " * FROM tblCactuShopCardholderDetails WHERE CD_EmailAddress LIKE '%" & sqlsafe(strEmailAddress) & "%' AND CD_EmailAddress<>'' ORDER BY CD_ID" End If Call ExecuteSQL(strQuery, numCursorType, objRecordSet) numRecordCount = objRecordSet.recordcount %> <% =GetString("Config_headtitle") %>
<% WriteString("PageTitle_Customers") %>
<% WriteString("ContentText_FindACustomer") %> ">
<% WriteString("ContentText_EnterEmailAddress") %>
<% if numResultsLimit <> 99999 then %> <% end if %>
<% WriteString("ContentText_ThereAreMoreCustomers") %> <% WriteString("ContentText_ClickHere") %>
<% if numRecordCount <> 0 then do while numBackgroundCounter < numResultsLimit AND NOT objRecordSet.EOF numBackgroundCounter = numBackgroundCounter + 1 If numBackgroundCounter mod 2 = 0 then strBgColour="#EEEEEE" else strBgColour="#DDDDDD" end if %> <% objRecordSet.moveNext loop else %> <% end if objRecordSet.Close %>
<% WriteString("ContentText_CustomerName") %> <% WriteString("ContentText_Email") %>  
<% =objRecordSet("CD_CardholderName") %> "><% =objRecordSet("CD_EmailAddress") %> "><% WriteSafeString(" title="<% WriteSafeString("ContentText_ListOrders") %>"> "><% WriteSafeString(" title="<% WriteSafeString("ImageLabel_ViewThisCustomer") %>">

<% WriteString("ContentText_NoCustomersWereFound") %>

<% objDataConn.Close set objDataConn = nothing %>