<%@ Language=VBScript %> <%Response.Buffer=True%> <% Updated = Request.QueryString("Updated") %> <% PageTitle = "SiteManager - Used Product Categories" %> <% PageID=253 %> <% Header %> <% Menu PageID %> <%' Main body of page goes here ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %> <%UCategoryAdd%> <%' End Of Main body ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %> <% Footer %> <% Sub UCategoryAdd OpenConnection1 pointer=Request.QueryString("P") If Request.QueryString("DC")<>"" then Del="DELETE FROM UCategories 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 UCategories" 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%>

Used 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 UCategories" rs.Open Sel,DB,1,3 If rs.EOF then%> <%Else While Not rs.EOF%> <%rs.MoveNext Wend End If%>
Current 'Used Product' Categories:
 
No 'Used Product' 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 'Used Product' Category:
 

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