<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/dbConn.asp" -->
<%
Dim rsCustomers
Dim rsCustomers_numRows
Set rsCustomers = Server.CreateObject("ADODB.Recordset")
rsCustomers.ActiveConnection = MM_dbConn_STRING
rsCustomers.Source = "SELECT * FROM qryCustomers ORDER BY CustomerFullName ASC"
rsCustomers.CursorType = 0
rsCustomers.CursorLocation = 2
rsCustomers.LockType = 1
rsCustomers.Open()
rsCustomers_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rsCustomers_numRows = rsCustomers_numRows + Repeat1__numRows
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Customers</title>
<link href="CSS/Level1_Verdana.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body>
<table width="815" border="1" cellpadding="1" cellspacing="1">
<tr>
<td width="100"><center><strong>Complaint number </strong></center></td>
<td width="256"><strong>Customer name </strong></td>
<td width="250"><strong>Address</strong></td>
<td width="205"><strong>Telephone number </strong></td>
</tr>
</table>
<div style="border:1px 000000 solid; width: 815px; height: 400px; overflow:auto; ">
<form action="custedit.asp" method="post" name="searchform" id="searchform">
<table width="799" border="1">
<%
While ((Repeat1__numRows <> 0) AND (NOT rsCustomers.EOF))
%>
<tr>
<td width="100"><center>
<%=(rsCustomers.Fields.Item("CustomerID").Value)%>
</center></td>
<td width="256"><a href="javascript:;" onClick="MM_openBrWindow('custinfo.asp?<%=MM_keepNone & MM_joinChar(MM_keepNone)&"CustomerID=" & rsCustomers.Fields.Item("CustomerID").Value%>','','scrollbars=yes,width=400,height=400')"><%=(rsCustomers.Fields.Item("CustomerFullName").Value)%></a> </td>
<td width="252"><% If (rsCustomers.Fields.Item("Address1").Value) <> "" Then %>
<%=(rsCustomers.Fields.Item("Address1").Value)%>
<% Else %>
<% End If %>
<td width="191"><% If (rsCustomers.Fields.Item("TelNo").Value) <> "" Then %>
<%=(rsCustomers.Fields.Item("TelNo").Value)%>
<% Else %>
<% End If %>
</td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsCustomers.MoveNext()
Wend
%>
</table>
</div><p>
<input name="selectname" type="text" id="selectname">
<input type="submit" name="Submit" value="Search">
<input type="reset" name="Reset" value="Reset">
</p>
</form>
<p><a href="summary.asp">Return to summary</a> </p>
</body>
</html>
<%
rsCustomers.Close()
Set rsCustomers = Nothing
%>