%@ LANGUAGE="VBScript" %><%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' System : StoreFront v.2.5.1
'
' Author : LaGarde, Incorporated
'
' Description: Handles the creation of the product table.
'
' Notes : There are no configurable elements in this file.
'
'
' COPYRIGHT NOTICE
'
' The contents of this file is protected under the United States
' copyright laws as an unpublished work, and is confidential and
' proprietary to LaGarde, Incorporated. Its use or disclosure in
' whole or in part without the expressed written permission of
' LaGarde, Incorporated is expressely prohibited.
'
' (c) Copyright 1998 by LaGarde, Incorporated. All rights reserved.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
%><%
InPage = Request.ServerVariables("HTTP_REFERER")
Description = Replace(Request.Form("Description"),"'","''")
Message = Replace(Request.Form("Message"),"'","''")
Manufacturer = Replace(Request.Form("Manufacturer"),"'","''")
If Request("WEIGHT") ="" Then
WEIGHT = "0"
Else
WEIGHT = Request("WEIGHT")
End If
Dim DSN_Name
DSN_Name = Session("DSN_Name")
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open "DSN="&DSN_Name&""
'Connection.Open "driver={Microsoft Access Driver (*.mdb)};dbq=e:\inetpub\vsroot\lagarde\thenaturestore\_private\naturestore.mdb"
'Outputs the product detail for the requested product
If Request.QueryString("Function") = "1" Then
SQLStmt = "SELECT * FROM Product WHERE Product_ID = '" & Request("Product_ID") & "' "
Set RS1 = Connection.Execute(SQLStmt)
'Adds the product information to the products table.
ElseIf Request("Function") = "2" Then
MyCurrSymbol = FormatCurrency(1)
MyCurrSymbol = Replace((MyCurrSymbol),"1","")
MyCurrSymbol = Replace((MyCurrSymbol),",","")
MyCurrSymbol = Replace((MyCurrSymbol),".","")
MyCurrSymbol = Replace((MyCurrSymbol),"0","")
ProdPrice = Replace(Request("Price"),MyCurrSymbol,"")
If MyCurrSymbol = "$" Then
rPrice = Replace((ProdPrice),",","")
Else
rPrice = Replace((ProdPrice),",",".")
End If
SQLStmt = "INSERT INTO Product (Product_ID, Description, "
SQLStmt = SQLStmt & "Price, Message, Category, Weight, Image_Path, Link, Mfg) "
SQLStmt = SQLStmt & "VALUES ('" & Request("Product_ID") & "', "
SQLStmt = SQLStmt & "'" & Description & "', "
SQLStmt = SQLStmt & "'" & rPrice & "', "
SQLStmt = SQLStmt & "'" & Message & "', '" & Request("Category") & "', "
SQLStmt = SQLStmt & "'" & Weight & "', '" & Request("Image_Path") & "',"
SQLStmt = SQLStmt & "'" & Request("Link") & "', '" & Manufacturer & "')"
Set RS2 =Connection.Execute(SQLStmt)
SQLStmt = "SELECT * FROM Product WHERE PRODUCT_ID = '" & Request("Product_ID") & "' "
Set RS2A = Connection.Execute(SQLStmt)
'Deletes the selected product from the products table.
ElseIf Request("Function") = "3" Then
SQLStmt = "DELETE * FROM Product WHERE Product_ID = '" & Request("Product_ID") & "' "
Set RS3 = Connection.Execute(SQLStmt)
'Response.Redirect InPage
'Edits the information for the selected product.
ElseIf Request("Function") = "4" Then
MyCurrSymbol = FormatCurrency(1)
MyCurrSymbol = Replace((MyCurrSymbol),"1","")
MyCurrSymbol = Replace((MyCurrSymbol),",","")
MyCurrSymbol = Replace((MyCurrSymbol),".","")
MyCurrSymbol = Replace((MyCurrSymbol),"0","")
ProdPrice = Replace(Request("Price"),MyCurrSymbol,"")
If MyCurrSymbol = "$" Then
rPrice = Replace((ProdPrice),",","")
Else
rPrice = Replace((ProdPrice),",",".")
End If
SQLStmt = "UPDATE Product SET Product_ID = '" & Request("PRODUCT_ID") & "', "
SQLStmt = SQLStmt & "DESCRIPTION = '" & Description & "', "
SQLStmt = SQLStmt & "PRICE = '" & rPrice & "', "
SQLStmt = SQLStmt & "MESSAGE = '" & Message & "', "
SQLStmt = SQLStmt & "CATEGORY = '" & Request("Category") & "', "
SQLStmt = SQLStmt & "WEIGHT = " & Weight & ", "
SQLStmt = SQLStmt & "IMAGE_PATH = '" & Request("IMAGE_PATH") & "', "
SQLStmt = SQLStmt & "LINK = '" & Request("LINK") & "', "
SQLStmt = SQLStmt & "MFG = '" & Manufacturer & "' "
SQLStmt = SQLStmt & "WHERE PRODUCT_ID = '" & Request("Product_ID") & "' "
'Response.Write SQLStmt
Set RS4 = Connection.Execute(SQLStmt)
SQLStmt = "SELECT * From Product WHERE PRODUCT_ID = '" & Request("Product_ID") & "' "
Set RS4A = Connection.Execute(SQLStmt)
End If
%>
StoreFront - Edit Product
<% If Request("Function") = "1" Then %><%
CurrentRecord = 0
Do While NOT RS1.EOF
%>
<%
RS1.MoveNext
CurrentRecord = CurrentRecord = 1
Loop
%><% ElseIf Request.QueryString("Function") = "4" Then %><%
CurrentRecord = 0
Do While NOT RS4A.EOF
%>
| Confirm Product Update |
| PRODUCT ID |
<%= RS4A("Product_ID") %> |
PRICE |
<%= FormatCurrency(RS4A("Price")) %> |
| CATEGORY |
<% If RS4A("CATEGORY") = "" Then %>None Specified <% Else %>
<%= RS4A("Category") %><% End If %> |
WEIGHT |
<%= RS4A("Weight") %> |
| DESCRIPTION |
| <% If RS4A("DESCRIPTION") = "" Then %>None Specified <% Else %>
<%= RS4A("Description") %><% End If %> |
| MESSAGE |
| <% If RS4A("MESSAGE") = "" Then %>None Specified <% Else %>
<%= Server.HTMLEncode(RS4A("MESSAGE")) %><% End If %> |
| IMAGE PATH |
<% If RS4A("IMAGE_PATH") = "" Then %>None Specified <% Else %>
<%= RS4A("IMAGE_PATH") %><% End If %> |
LINK |
<% If RS4A("LINK") = "" Then %>None Specified <% Else %>
<%= RS4A("LINK") %><% End If %> |
| MANUFACTURER |
<% If RS4A("MFG") = "" Then %>None Specified <% Else %>
<%= RS4A("MFG") %><% End If %> |
|
|
<%
RS4A.MoveNext
CurrentRecord = CurrentRecord = 1
Loop
%><% ElseIf Request.QueryString("Function") = "2" Then %><%
CurrentRecord = 0
Do While NOT RS2A.EOF
%>
| Product Entry Confirmatation |
| PRODUCT ID |
<%= RS2A("Product_ID") %> |
PRICE |
<%= FormatCurrency(RS2A("Price")) %> |
| CATEGORY |
<% If RS2A("CATEGORY") = "" Then %>None Specified <% Else %>
<%= RS2A("Category") %><% End If %> |
WEIGHT |
<% If RS2A("WEIGHT") = "" Then %>None Specified <% Else %>
<%= RS2A("WEIGHT") %><% End If %> |
| DESCRIPTION |
| <% If RS2A("DESCRIPTION") = "" Then %>None Specified <% Else %>
<%= RS2A("DESCRIPTION") %><% End If %> |
| MESSAGE |
| <% If RS2A("MESSAGE") = "" Then %>None Specified <% Else %>
<%= Server.HTMLEncode(RS2A("MESSAGE")) %><% End If %> |
| IMAGE PATH |
<% If RS2A("IMAGE_PATH") = "" Then %>None Specified <% Else %>
<%= RS2A("IMAGE_PATH") %><% End If %> |
LINK |
<% If RS2A("LINK") = "" Then %>None Specified <% Else %>
<%= RS2A("LINK") %><% End If %> |
| MANUFACTURER |
<% If RS2A("MFG") = "" Then %>None Specified <% Else %>
<%= RS2A("MFG") %><% End If %> |
|
|
<%
RS2A.MoveNext
CurrentRecord = CurrentRecord = 1
Loop
%><% ElseIf Request("Function") = "3" Then %>
| Product Delete Confirmatation |
| Product ID Number: <%= Request("Product_ID") %> has been deleted |
<% End If %>
Add Product | Delete Product | List Products | Edit Product
Sales Reporting | Store Set-Up