<%@ Language=VBScript %> <%Response.Buffer=True%> <% Updated = Request.QueryString("Updated") %> <% PageTitle = "SiteManager - New Product Categories" %> <% PageID=304 %> <% Header %> <% Menu PageID %> <%' Main body of page goes here ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %> <%SCategoryAdd%> <%' End Of Main body ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %> <% Footer %> <% Sub SCategoryAdd OpenConnection1 If Request.QueryString("DC")<>"" then Del="DELETE FROM SCategories WHERE CatID=" & Request.QueryString("DC") DB.Execute(Del) End If error = "" SET rs = Server.CreateObject("ADODB.Recordset") If Request.Form("hidSave")="true" then txtCategory=Trim(Request.Form("txtCategory")) If txtCategory="" then error="Enter the new category and press Save." If error="" then SEL = "SELECT * FROM SCategories" rs.Open SEL,DB,1,3 rs.AddNew rs("txtCategory")=dbReplace(txtCategory) rs.Update rs.Close End If End If %>

<%= FormatDateTime(Date,1) %>

<% If Request.QueryString("PA")=1 then%>

Products cannot be entered without a Product Category.
Please add a Product Category to the database first.

<%End If If error <> "" then%>

<%=error%>

<%End If%> <% Sel="SELECT * FROM SCategories" rs.Open Sel,DB,1,3 If rs.EOF then%> <%Else While Not rs.EOF%> <%rs.MoveNext Wend End If%>
Current Supply Categories:
 
No Supply Categories in database.
" title="Click here to edit this Category"> <%=rs("txtCategory")%> <%If CatEmpty(rs("CatID")) then%> " title="Click here to delete this empty Category"> <%End If%>
 
New Supply Category:
 

<%End Sub %> <% Function CatEmpty(CatID) Set rc=Server.CreateObject("ADODB.Recordset") Cat="SELECT * FROM Supplies WHERE nCatID=" & CatID rc.Open Cat,DB,1,3 If rc.EOF then CatEmpty=True Else CatEmpty=False End If rc.Close End Function %>