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

📄 buy2buycz.asp

📁 信运网店系统是一套功能完善、简洁美观
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录!');history.go(-1);</script>"
response.End
else
if request.cookies("Buy2Buy")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录!');history.go(-1);</script>"
response.End
end if
end if
'限制查看权限管理员
if session("rank")=3 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('您的管理权限未达到此操作等级!');history.go(-1);</script>"
response.End
end if


maction=FormatSQL(SafeRequest("maction",0))
ID=SafeRequest("ID",1)
if maction="newsave" then
	'新添保存
	materialName=FormatSQL(SafeRequest("materialName",0))
	IndexID=FormatSQL(SafeRequest("IndexID",0))
	mSql="Insert Into Buy2BuyMaterial(materialName,IndexID) values('"&materialName&"','"&IndexID&"')"
	conn.execute(mSql)
	response.write "<script>alert('保存成功!');window.location.href='buy2buycz.asp';</Script>"
	response.end
end if

if maction="modsave" then
	'保存修改
	materialName=FormatSQL(SafeRequest("materialName",0))
	IndexID=FormatSQL(SafeRequest("IndexID",0))
	mSql="Update Buy2BuyMaterial set materialName='"&materialName&"',IndexID='"&IndexID&"' where ID="&ID
	conn.execute(mSql)
	response.write "<script language=javascript>alert('修改成功!');history.go(-1);</script>"
	response.End
end if

if maction="del" then
	'删除操作
	mSql="delete from Buy2BuyMaterial where ID="&ID
	conn.execute(mSql)
	response.write "<script>alert('删除成功!');window.location.href='buy2buycz.asp';</Script>"
	response.end
end if
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.STYLE1 {color: #000000;
	font-weight: bold;
}
.STYLE2 {color: #FF0000}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<table width="99%" border="5" align="center" cellpadding="5" cellspacing="5" bordercolor="#CCCCCC" bgcolor="#FFFFFF">
  <tr> 
    <td background="images/topbg.gif"><span class="STYLE1"><img src="images/pic5.gif" width="28" height="22" align="absmiddle" />您现在所在的位置是: <a href="adminhelp.asp">管理首页</a> -&gt; <span class="STYLE2">材质商品</span></span></td>
  </tr>
  <tr> 
    <td valign="top" bgcolor="#FFFFFF"> 
	
        <br>
        <table width="95%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#f2f2f2">
          
          <tr bgcolor="#FFFFFF"> 
            <td width="51%" align="right" valign="top"><table width="99%"  border="2" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#CCCCCC">
                <tr align="center" bgcolor="#F7F7F7">
                  <td height="25" colspan="3" background="images/topbg.gif"><strong>现有材质信息管理</strong></td>
                </tr>
              <tr align="center" bgcolor="#F7F7F7">
                <td width="42%" height="25" background="images/topbg.gif"><strong>名称</strong></td>
                <td width="28%" background="images/topbg.gif"><strong>序号</strong></td>
                <td width="30%" background="images/topbg.gif"><strong>操作</strong></td>
              </tr>
			  <%
			  	mSql="select * from Buy2BuyMaterial Order by IndexID"
				set mRs=conn.execute(mSql)
				if not (mRs.eof and mRs.bof) then
				while not mRs.eof
			  %>
			  <form name="formMod<%=mRs("ID")%>" method="post" action="buy2buycz.asp?maction=modsave&ID=<%=mRs("ID")%>">
              <tr align="center" bgcolor="#FFFFFF">
                <td height="25"><input name="MaterialName" type="text" class="input_sr" id="MaterialName" value="<%=mRs("materialName")%>"></td>
                <td><input name="IndexID" type="text" class="input_sr" id="IndexID" onKeyPress	= "return regInput(this,	/^[0-9]*$/,		String.fromCharCode(event.keyCode))" value="<%=mRs("IndexID")%>" size="8"
		onpaste		= "return regInput(this,	/^[0-9]*$/,		window.clipboardData.getData('Text'))"
		ondrop		= "return regInput(this,	/^[0-9]*$/,		event.dataTransfer.getData('Text'))"></td>
                <td><input name="Submit" type="submit" class="input_bot" value="修改"> 
                  <a href="buy2buycz.asp?maction=del&ID=<%=mRs("ID")%>"><img src="images/pic12.gif" width="20" height="15" border="0" align="absmiddle" />删除</a></td>
              </tr>
			  </form>
			  <%
			  		mRs.movenext
			  	wend
			  	end if
				mRs.close
				set mRs=nothing
			  %>
            </table>
            </td>
            <td width="49%" align="center" valign="top" bgcolor="#FFFFFF"><table width="99%"  border="2" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#CCCCCC">
			  <form name="formNew" method="post" action="buy2buycz.asp?maction=newsave">
              <tr align="center" bgcolor="#F7F7F7">
                <td height="25" colspan="3" background="images/topbg.gif"><strong>添加材质信息</strong></td>
              </tr>
              <tr align="center" bgcolor="#F7F7F7">
                <td width="42%" height="25" background="images/topbg.gif"><strong>名称</strong></td>
                <td width="28%" background="images/topbg.gif"><strong>序号</strong></td>
                <td width="30%" background="images/topbg.gif"><strong>操作</strong></td>
              </tr>
              <tr align="center" bgcolor="#FFFFFF">
                <td height="25"><input name="MaterialName" type="text" class="input_sr" id="MaterialName"></td>
                <td><input name="IndexID" type="text" class="input_sr" id="IndexID" onKeyPress	= "return regInput(this,	/^[0-9]*$/,		String.fromCharCode(event.keyCode))" size="8"
		onpaste		= "return regInput(this,	/^[0-9]*$/,		window.clipboardData.getData('Text'))"
		ondrop		= "return regInput(this,	/^[0-9]*$/,		event.dataTransfer.getData('Text'))"></td>
                <td><input name="Submit" type="submit" class="input_bot" value="添加"></td>
              </tr></form>
            </table>
			
            </td>
          </tr>
        </table>
    <br>	</td>
  </tr>
</table>

<script>
	function regInput(obj, reg, inputStr)
	{
		var docSel	= document.selection.createRange()
		if (docSel.parentElement().tagName != "INPUT")	return false
		oSel = docSel.duplicate()
		oSel.text = ""
		var srcRange	= obj.createTextRange()
		oSel.setEndPoint("StartToStart", srcRange)
		var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
		return reg.test(str)
	}
</script>

⌨️ 快捷键说明

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