⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inventory.asp

📁 不错的代码 看完后一定要留评论哦 有疑问联系我
💻 ASP
字号:
<html>
<head>
<% session("repeat")=0 %>
<!-- BASE TARGET="catdisplay" -->
<title>Inventory Display</title>
<style TYPE="text/css">
<!--
P {font-size: 10pt; text-align: left; font-family: Arial; font-color: blue}

P.large	{font-size: 12pt; text-align: left; font-family: Arial; font-color: blue}

TD {font-size: 9pt; font-family: Arial; font-color: blue; font-weight: bold}

TD.small {font-size: 9pt; font-family: Arial; font-color: blue; font-weight: bold}

TD.medium {font-size: 10pt; font-family: Arial; font-color: blue; font-weight: bold}
-->
</style>

<!--<SCRIPT RUNAT=Server LANGUAGE="VBSCRIPT">

Function Fiks(FixWhat)
	if (isnull(FixWhat) or FixWhat="") then		
                 Fiks="<CENTER> - </CENTER>"	
        else		
                 Fiks=trim(FixWhat)	
        end if
End Function

Function Anchor_It (item_ID, strDescription)	
        if (isnull(item_ID) or isnull(strDescription)) then		
                Anchor_It=" - "	
        else		
                Description=replace(strDescription," ","-")		
                Anchor_It="<A HREF='build_sys_mod.asp?repeat=0&item_ID=" & trim(item_ID) & "&desc=" & Description & "'>" & strDescription & "</A>"	
        end if
End Function

Function AnchorDescription(strProductID, strDescription, CategoryID)	
         if (isnull(strProductID) or isnull(strDescription)) then		
                 AnchorDescription=" - "	
         else		
                 AnchorDescription="<A HREF='ProductDescription.asp?strProductID=" & trim(strProductID) & "&CategoryID=" & trim(CategoryID) & "'>" & strDescription & "</A>"	
         end if
End Function
</SCRIPT>
-->

<!-- #INCLUDE FILE="odbc_connection.inc" -->
<!-- #INCLUDE FILE="shared_checkBrowser.inc" -->
<!-- #INCLUDE FILE="openShoppingCartToShow.inc" -->
<%
RS.close
set RS=nothing
CartSize=Rows

s_Category=request.form("cboCategory")
if s_Category="" then
	s_Category="Computer System"
end if

IF session("search")="yes" THEN
	searchfield=request.form("searchfield")
	strSearch=request.form("strSearch")
	strSearch=LTrim(strSearch)
	strSearch=RTrim(strSearch)
	strSearch  = Replace(strSearch,"(","")
	strSearch  = Replace(strSearch,")","")
	strSearch  = Replace(strSearch,"""","")
	strSearch = Replace(strSearch,"     "," ")
	strSearch = Replace(strSearch,"   "," ")
	strSearch = Replace(strSearch,"  "," ")
	If Not IsNull(strSearch) AND (Len(strSearch)>0) Then
		sSQL="SELECT"
		sSQL=sSQL & " s_Item_No"
		sSQL=sSQL & ",s_Description"
		sSQL=sSQL & ",s_Brand"
		sSQL=sSQL & ",Price"
		if session("Wholesaler")="True" then sSQL=sSQL & ",Cost"
		sSQL=sSQL & " FROM tbl_Inventory"
		sSQL=sSQL & " WHERE (" & searchfield & " LIKE '%" & strSearch & "%')"
		sSQL=sSQL & " ORDER BY s_Item_No"
	end if
ELSE
	sSQL="SELECT"
	sSQL=sSQL & " s_Item_No"
	sSQL=sSQL & ",s_Description"
	sSQL=sSQL & ",s_Category"
	sSQL=sSQL & ",s_Brand"
	sSQL=sSQL & ",Price"
	if session("Wholesaler")="True" then sSQL=sSQL & ",Cost"
	sSQL=sSQL & " FROM tbl_Inventory"
	sSQL=sSQL & " WHERE s_Category='" & s_Category & "'"
	sSQL=sSQL & " ORDER BY s_Item_No"
END IF

%>
</head>
<% iBorder=0 %>
<body text="white" BGCOLOR="gold">
<center>
<table align="center" width="97%">
<tr>
<td align="center"><a href="ShowCart.asp"><img src="images/Wheelbarrow.gif" border="0" alt="View Shopping Cart Contents" WIDTH="126" HEIGHT="78"></a></td>
<td align="center" class="medium"><font color="black"><b>Your Shopping Cart<br>
Contains <%=CartSize%> Items</b></font></td>
<td align="center"><a href="EmptyCart.asp"><img src="images/Wheelbarrow_empty.gif" border="0" alt="Remove All Items From Your Shopping Cart" WIDTH="126" HEIGHT="78"></a></td>
</tr>
</table>
</center>

<center>
<table align="center" width="98%" valign="top" border="1" cellspacing="1" cellpadding="1">
<form name="scottForm" method="post" action="AddToCart.asp">
<tr valign="center">
<td class="small" align="center" bgcolor="black"><font face="arial"><input type="submit" value="Add to Cart"></font></td>
<td class="small" align="center" bgcolor="black"><font face="arial" color="gold"><b>Item</b></font></td>
<td class="small" align="center" bgcolor="black"><font face="arial" color="gold"><b>Description</b></font></td>
<td class="small" align="center" bgcolor="black"><font face="arial" color="gold"><b>Brand</b></font></td>
<td class="small" align="center" bgcolor="black"><font face="arial" color="gold"><b>Price</b></font></td>
</tr>

<!-- #INCLUDE FILE="odbc_connection.inc" -->

<%
'response.write "<BR>" & sSQL & "<BR>"
If Not IsNull(sSQL) AND (Len(sSQL)>0) Then
'=============================
'on error resume next
Set RS = server.createObject("ADODB.recordset")
RS.open sSQL, conn, 3, 3 'read
'response.write "<font color=black>error: " & err.description & "<BR></font>"
'response.write sSQL
Flag=0

If Err.Description <> "" Then
	Response.Write "<B>Database Error: " + Err.Description + "</B><BR>"
Else
	' Check for the no-record case
	If RS.EOF And RS.BOF Then
		Response.Write "<B>No Records Returned</B><BR>"
	Else
		RS.movefirst
		Do Until RS.EOF
			Item_No=RS("s_Item_No")
			Response.Write "<TR valign=center>"
			Response.Write "<td align='center' class='small' bgcolor='black'><font face='arial' color='white'>" & "Qty <input type=text size=5 value=0 name='" & Item_No & "'>" & "</font></TD>"
			Response.Write "<td class='small' bgcolor='black'><font face='arial'>" & Fiks(Item_No) & "</font></TD>"
			if s_Category="Computer System" then
				%><!-- #INCLUDE FILE="check_system_price.inc" --><%
				if Price=0 then
					Price=RS("Price")
					Response.Write "<td class='small' bgcolor='black'><font face='arial' color='white'>" & Anchor_It(Item_No,trim(RS("S_Description"))) & "</font></TD>"
				else
					Response.Write "<td class='small' bgcolor='black'><font face='arial' color='white'><font color='gold'><b>Customized:</b></font>&nbsp;" & Anchor_It(Item_No,trim(RS("S_Description"))) & "</font></TD>"
				end if
			else
				Price=RS("price")
				if session("Wholesaler")="True" then Price=RS("cost")+(RS("cost")*0.1)
				Response.Write "<td class='small' bgcolor='black'><font face='arial' color='white'>" & Fiks(RS("S_Description")) & "</font></TD>"
			end if
			Response.Write "<td class='small' align='left' bgcolor='black'><font face='arial' color='white'>" & Fiks(RS("s_Brand")) & "</font></TD>"
			Response.Write "<td class='small' align='right' bgcolor='black'><font face='arial' color='white'>" & FormatCurrency(Price) & "</font></TD>"

			Response.Write "</TR>"
			RS.MoveNext
		Loop
	End If
	RS.Close
' Close the If condition checking for a connection error
End If
set RS = Nothing
'=================================
ELSE
	Response.Write "<B>No Records Returned</B><BR>"
END IF
%>
</form>
</table>
</center>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -