home *** CD-ROM | disk | FTP | other *** search
- <%@ LANGUAGE="VBSCRIPT" %>
-
- <HTML>
- <HEAD>
- <META NAME="GENERATOR" Content="Microsoft Visual InterDev 6.0">
- <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
- <TITLE>NIMS - Product Categories</TITLE>
- <LINK REL="stylesheet" TYPE="text/css" HREF="nimstyle.css">
- <!-- #include file="ADOVBS.INC" -->
- </HEAD>
- <BODY>
-
- <%
- 'Get the display operation from the querystring
- ' The operation determines whether the product information display
- ' will contain Update or Remove options.
- op = Request.QueryString("op")
-
- 'Reference the Session connection variable
- cn = Session("cnn")
-
- 'Create a recordset
- Set CategoryInfo = Server.CreateObject("ADODB.Recordset")
-
- 'Create a query string
- querystr = "SELECT CategoryName, Description, CategoryID FROM Categories Order By CategoryID, CategoryName"
-
- 'Open the Recordset with the query string on the connection cn.
- CategoryInfo.Open querystr, cn
- %>
-
- <!-- Output Page Header -->
- <CENTER>
- <H2>Northwind Inventory Management System</H2>
- <HR>
- <H3>Product Categories</H3>
-
- <% 'Output instructions to the user to select the category of the product
- 'they wish to view, update, or remove.
- IF op <> "" THEN
- Response.Write "Select the category of the product you wish to " & op & ".<BR><Br>"
- ELSE
- Response.Write "Select the category of the products you wish to view.<BR><BR>"
- END IF %>
-
- <!-- Output the table of categories and their descriptions -->
- <TABLE CELLPADDING=3 BORDER=0 COLSPAN=8>
- <TR>
- <% 'Output the table headers
- For i = 0 To 1
- Response.Write "<TD CLASS=header>" & CategoryInfo.Fields(i).Name & "</TD>"
- NEXT %>
- </TR>
- <% 'Loop through the recordset and output the table values
- Do While Not CategoryInfo.EOF
- Response.Write "<TR>"
- For i = 0 to 1
- Response.Write "<TD>"
- IF i = 0 THEN 'Make the category name a link to the display products
- 'page with the CategoryID in the querystring %>
- <A HREF="displayp.asp?CategoryID=<%=CategoryInfo.Fields(2)%>&op=<%=op%>">
- <%Response.Write CategoryInfo.Fields(i).Value & "</A>"
- ELSE ' Output the category description
- Response.Write CategoryInfo.Fields(i).Value
- END IF
- Response.Write "</TD>"
- NEXT
- Response.Write "</TR>"
- CategoryInfo.MoveNext
- LOOP %>
-
- </TABLE>
-
- <% 'Close the recordset
- CategoryInfo.Close %>
-
- </CENTER>
- <BR><BR><HR>
- Return to the <A HREF="default.htm">Main Menu</A>
-
- </BODY>
- </HTML>
-