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

📄 proinfomanage.asp

📁 ASP编写的一个公司网站的源程序
💻 ASP
字号:
<%@ Language=VBScript %>

<!--#include virtual="/Include/Const.asp"-->
<!--#include virtual="/Include/DBConn.asp"-->
<!--#include virtual="/Include/ChkSession.asp"-->
<!--#include virtual="/Include/FuncPub.asp"-->
<!--#Include virtual="/include/PageNavigator.asp"-->


<html>
<head>
<title><%=Application("Site_Name")%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content=" ">
<link rel="stylesheet" href="../Css/Css.css" type="text/css">

<script language="Javascript" src="/JS/CheckInput.js"></script>
<script language="javascript">
<!--
function deleted(DoType,url) {
var Content=DoType;
var truthBeTold =window.confirm("你确定要"+Content+"?");
if (truthBeTold) {
window.location = ( url )
} 
else
{
	return false;
}
}
-->
</script>
</head>
<body>

<!--#include file="Menu.asp"-->

<%
If Request("opr")<>"" then
	If Request("opr")="set" then
		If Request("state")<>"" and Request("ID")<>"" then
			Conn.Execute "Update ProInfo Set state="&Request("state")&" where Pro_ID="&Request("ID")&""
		End IF
	ElseIF Request("opr")="del" then
		if Request("ID")<>"" then
			Conn.Execute "delete * from ProInfo where Pro_ID="&Request("ID")&""
		End IF	
	End IF	
End IF
'----查询条件Start----------------------------
Dim SearchItem
If UCASE(Trim(Request("WhereItem"))) = "TRUE" then	'保留 Session("WhereString")的值
	
Else	'不保留 Session("WhereString") 的值
	Dim keyname,type_ID
	keyname = ModifyInput(Request("keyname"))
	
	type_ID = ModifyInput(trim(Request("type_ID")))
	
	Session("WhereString") = " WHERE 1=1 "

	If type_ID <> "" Then	
		Session("WhereString") = Session("WhereString") & " AND type_ID="& type_ID &" "
	END If	
	
	If keyname <> "" Then	
		Session("WhereString") = Session("WhereString") & " AND Pro_Name like '%"& keyname &"%' or Pro_Content like '%"&keyname&"%' "
	END If	

	
End If
%>
<!--------Center Start ----------------->

<!--列出Users-->
<!--注意事项-->

<!-- 以下代码由程序自动生成 -->
<form method="POST" name="frmUsersList" action="DeleteNews.asp" ID="Form1">
	<table border=0 cellspacing=1 cellpadding=2  class=list width=98% ID="Table1">
	<tr class=header>
<td width=20 nowrap>ID</td>
<td width=150 >名称</td>
<td nowrap>类别</td>
<td>小图片</td>
<td colspan=2>操作</td>

    </tr>

<%
	'Dim WOA
	'Set WOA = Server.CreateObject("Com.Char")

	Dim strSQL
	strSQL = "SELECT * FROM ProInfo "
	
	StrSQL = StrSQL & Session("WhereString")
	
	strSQL = strSQL & " Order by type_ID,orderline asc"	'加上排序条件
	'Response.Write strsql	' 用于测试
	'On Error Resume Next
	'Response.End 
	'打开数据链接
	Dim rs
	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.Open strSQL, Conn, adOpenKeyset ,adLockReadOnly 
	
	' 如果没有数据,则结束网页
	If rs.EOF Then
		Response.Write "<Font Color=Red>没有找到记录!</Font><br>"
		Response.Write "<input type=""button"" name=""btnAdd"" value=""添加"" onclick=""window.location.href='ProInfoAdd.asp'"">"
		Response.End 
	End If
	
	' 否则初始化页
	Call InitRS( rs, 15 )	' 默认每页 20 行
	
	Dim i
	For i = 1 To PageSize
%>
    <tr>
      <td class=list><%= rs("Pro_ID") %></td>
<td class=list><% If(len(DeModifyInput(rs("Pro_Name"))))>8 then Response.Write left(DeModifyInput(rs("Pro_Name")),8)&".." else Response.Write DeModifyInput(rs("Pro_Name"))%></td>
<td class=list nowrap>
<%Dim rstype,StrSQLtype
  Set rstype = Server.CreateObject("Adodb.Recordset")
   StrSQLType = "Select * From ProType where Type_ID="&rs("Type_ID")&""
   rstype.Open StrSQLType,conn,1,3
   If not rstype.EOF then
		If (len(rstype("Type_Name")))>4 then
			Response.Write left(rstype("Type_Name"),4)&".."
		Else
			Response.Write rstype("type_Name")
		End IF	
   End IF
   rstype.Close
 
%></td> 
<td class=list><a href="<%=rs("Pro_simg")%>" onclick="return openNewWin(this.href,350,350,200,20);" ><%= rs("Pro_simg") %></a></td>

<td class=list colspan=2 width=180 nowrap>	<%
				If rs("state") = 0 Then
					Response.Write "<a href='ProInfoManage.asp?opr=set&state=1&ID="&rs("Pro_ID")&"&WhereItem=True' title='点击产品被开放' onclick='return deleted(""开放信息"",this.href);'><u>[开放]</u></a>"
				Else
					Response.Write "<a href='ProInfoManage.asp?opr=set&state=0&ID="&rs("Pro_ID")&"&WhereItem=True' title='点击产品被关闭' onclick='return deleted(""关闭信息"",this.href);'><font color=red><u>[关闭]</u></font></a>"
				End If	
				 %>
				 &nbsp;&nbsp;&nbsp;<a href="ProInfoEdit.asp?Pro_ID=<%= rs("Pro_ID")%>&type_ID=<%=rs("type_ID")%>"><u>[修改]</u></a> 
				 &nbsp;&nbsp;&nbsp;<a href="ProInfoManage.asp?opr=del&ID=<%=rs("Pro_ID")%>&WhereItem=True" title='点击产品被删除' onclick="return deleted('删除产品',this.href);"><u>[删除]</u></a> 
</td>

    </tr>
<%
		rs.MoveNext 
		
		If rs.EOF Then Exit For
	Next
	
	rs.Close
	Set rstype = Nothing
	Set rs = Nothing
Set fso = nothing
	'关闭数据链接
%>
  </table>

<table width="98%" border="0" cellspacing="0" cellpadding="0" ID="Table2">
  <tr>
    <td width="50%">
	<input type="button" name="btnAdd" value="添加" onclick="window.location.href='ProInfoAdd.asp'" ID="Button1">
    </td>
    <td width="50%" align=right>
<% Call ShowPageNavigator( Request.ServerVariables("SCRIPT_NAME") & "?WhereItem=True&OrderItem=" & Trim(Request.QueryString("OrderItem")) & "&SortItem=" & Trim(Request.QueryString("SortItem")) , 1 ) %>
</td>
  </tr>
</table>

</form>
<!-- 代码结束 -->
<!------------------------->
<!--#include virtual="/Include/DBClose.asp"-->
</body>
</html>

⌨️ 快捷键说明

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