<%@ Language=VBScript %> <%Response.Buffer=True%> <% Updated = Request.QueryString("Updated") %> <% PageTitle = "SiteManager - Add New Supply" %> <% PageID=302 %> <% Header %> <% Menu PageID %> <%' Main body of page goes here ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %> <%SupplyAdd%> <%' End Of Main body ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %> <% Footer %> <% Sub SupplyAdd error = "" OpenConnection1 SET rs=Server.CreateObject("ADODB.Recordset") If Request.ServerVariables ("REQUEST_METHOD") = "POST" then txtSupply = dbReplace(TRIM(Request.Form("txtSupply"))) txtDescription=dbReplace(Trim(Request.Form("txtDescription"))) nCatID = Request.Form("selCat") txtItemNumber = dbReplace(TRIM(Request.Form("txtItemNumber"))) If txtSupply<>"" And txtItemNumber<>"" And nCatID<>0 then SEL="SELECT * FROM Supplies" rs.Open SEL,DB,1,3 rs.AddNew rs("nCatID")=nCatID rs("txtSupply")=txtSupply rs("txtDescription")=txtDescription rs("txtItemNumber")=txtItemNumber rs.Update SupplyID = rs("SupplyID") rs.Close Response.Redirect ("Supply_Details.asp?SID=" & SupplyID) Else If txtSupply="" then error="The Supply Name is required.
" End If If txtItemNumber="" then error=error & "The Supply Item Number is required.
" End If If nCatID=0 then error=error & "Please select a Supply Category.
" End If End If End If Sel="Select * FROM SCategories" rs.Open Sel,DB,1,3 If rs.EOF then rs.Close Response.Redirect("SCategory_Add.asp?PA=1") End If %>

<%= FormatDateTime(Date,1)%>

<%If error<>"" then%>

<%=error%>

<%error="" End If%>
Supply Category:
Supply Name:
Item Number:
Supply Description:
 

<%End Sub%> <% Function IsSelected(value,data) If value=data then IsSelected="Selected" Else IsSelected="" End If End Function %>