All pastes #201571 Raw Edit

Stuff

public text v1 · immutable
#201571 ·published 2006-10-13 22:05 UTC
rendered paste body
<%
	on error resume next
	
	if isempty(request("idPhoto")) then
		response.redirect "viewAllPhotos.asp?error="& escape("ERROR: You must select a photo before adding a pricing option.")
		response.end
	end if
%>
<!-- #include file="inc/serv/db.asp"-->
<%
	dim proc, rs, idPricing, idPhoto
	dim name, size, price, resin_price, description, make_offer, offer_limit, is_active, in_stock
	dim status_msg, title, hierarchy(4, 2)
	
	status_msg = ""
	
	title = "Create Pricing Option"
	
	hierarchy(0, 0) = "Home"
	hierarchy(0, 1) = "home.asp"
	
	hierarchy(1, 0) = "Inventory Management"
	hierarchy(1, 2) = "inventoryOverview.asp"
	
	hierarchy(2, 0) = "Photographs"
	hierarchy(2, 1) = "viewAllPhotos.asp"
	
	hierarchy(3, 0) = "Add Pricing Option"
	hierarchy(3, 1) = "createPricing.asp"
	
	idPhoto = cLng(request("idPhoto"))
	
	set adoProc = server.createObject("ADODB.Command")
	

		proc = run_proc_return(adoProc, "sp_insertPricing", adExecuteNoRecords, idPricing, adInteger)
		response.write "val: "& idPricing &"<br />"
		
		if proc = true then
			status_msg = status_msg &"<p class=""success"">Successfully Inserted Pricing Option ID # "& idPricing &"</p><br />"
		else
			status_msg = status_msg &"<p class=""error"">ERROR: Could not insert pricing option.<br />"& proc &"</p><br />"
			
			name = request.form("name")
			size = request.form("size")
			price = request.form("price")
			resin_price = request.form("resin_price")
			description = request.form("description")
			make_offer = request.form("make_offer")
			offer_limit = request.form("offer_limit")
			is_active = request.form("is_active")
			in_stock = request.form("in_stock")
		end if

	
	proc = run_proc(adoProc, "sp_getPhotograph", 0, rs)
	
	if proc <> true then
		status_msg = status_msg &"<p class=""error"">ERROR: Could not retrieve photograph info.<br />"& proc &"</p><br />"
	end if
	
	set adoProc = nothing
%>