<!--#include file="conn.asp"-->
<!--#include file="../../inc/filter.asp"-->
<%
Rem 获得套装列表
sub get_zhuangbei_list()
	dim list
	list=""

	set rs_list=Server.CreateObject("ADODB.RecordSet")
	rs_list.open "select * from [fksf_zb]",conn,1,1
	for i=1 to rs_list.recordcount
%>
		<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#cccccc'" style="padding: 0px 2px;">
					<td align="center"><%=rs_list("id")%></td>
					<td align="center"><%=rs_list("zbname")%></td>
					<td align="center"><%=rs_list("total")%></td>
					<td align="center"><img src="../upfile/<%=rs_list("pic")%>"></td>
					<td align="center"><a href="zhuangbei_update_form.asp?id=<%=rs_list("id")%>">修改</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="zhuangbei_delete.asp?id=<%=rs_list("id")%>">删除</a></td></tr>
<%
		rs_list.movenext()
	next
	rs_list.close()
	set rs_list=nothing
end sub
%>

<%
Rem 套装价格管理入口
sub zhuangbei_access()
	action=trim(request("action"))
	
	if(action="") then
		response.write("<script language=javascript>")
		response.write("alert('判断参数不能为空');")
		response.write("window.location='main_body.asp';")
		response.write("</script>")
	else
		if(ChkBadWord(action)<>0) then
			response.write("<script language=javascript>")
			response.write("alert('判断参数包含非法字符');")
			response.write("window.location='main_body.asp';")
			response.write("</script>")
		else
			if(action="update") then
				call zhuangbei_update()'操作套装价格更新
			else
				if(action="insert") then
					call zhuangbei_insert()'操作套装价格添加
				else
					if(action="delete") then
						call zhuangbei_delete()'操作套装价格删除
					end if
				end if
			end if
		end if
	end if
end sub
%>

<%
Rem 套装价格更新
sub zhuangbei_update()
	id=trim(request("id"))
	zbname=trim(request("zbname"))
	pic=trim(request("pic"))
	dengji=trim(request("dengji"))
	wuqi_name=trim(request("wuqi_name"))
	wuqi_shuxing=trim(request("wuqi_shuxing"))
	wuqi_danjia=trim(request("wuqi_danjia"))
	
	yifu_name=trim(request("yifu_name"))
	yifu_shuxing=trim(request("yifu_shuxing"))
	yifu_danjia=trim(request("yifu_danjia"))
	
	toukui_name=trim(request("toukui_name"))
	toukui_shuxing=trim(request("toukui_shuxing"))
	toukui_danjia=trim(request("toukui_danjia"))
	
	xianglian_name=trim(request("xianglian_name"))
	xianglian_shuxing=trim(request("xianglian_shuxing"))
	xianglian_danjia=trim(request("xianglian_danjia"))
	
	zuojie_name=trim(request("zuojie_name"))
	zuojie_shuxing=trim(request("zuojie_shuxing"))
	zuojie_danjia=trim(request("zuojie_danjia"))
	
	youjie_name=trim(request("youjie_name"))
	youjie_shuxing=trim(request("youjie_shuxing"))
	youjie_danjia=trim(request("youjie_danjia"))
	
	zuoshou_name=trim(request("zuoshou_name"))
	zuoshou_shuxing=trim(request("zuoshou_shuxing"))
	zuoshou_danjia=trim(request("zuoshou_danjia"))
	
	youshou_name=trim(request("youshou_name"))
	youshou_shuxing=trim(request("youshou_shuxing"))
	youshou_danjia=trim(request("youshou_danjia"))
	
	xunzhang_name=trim(request("xunzhang_name"))
	xunzhang_shuxing=trim(request("xunzhang_shuxing"))
	xunzhang_danjia=trim(request("xunzhang_danjia"))
	
	xuezi_name=trim(request("xuezi_name"))
	xuezi_shuxing=trim(request("xuezi_shuxing"))
	xuezi_danjia=trim(request("xuezi_danjia"))
	
	dun_name=trim(request("dun_name"))
	dun_shuxing=trim(request("dun_shuxing"))
	dun_danjia=trim(request("dun_danjia"))
	
	yaodai_name=trim(request("yaodai_name"))
	yaodai_shuxing=trim(request("yaodai_shuxing"))
	yaodai_danjia=trim(request("yaodai_danjia"))
	
	total=trim(request("total"))
	memo=trim(request("memo"))
	
	if(id="" or zbname="" or pic="" or dengji="") then
		response.write("<script language=javascript>")
		response.write("alert('套装名称 套装图片路径 套装需求等级不能为空');")
		response.write("window.location='main_body.asp';")
		response.write("</script>")
	else
	if(ChkBadWord(id)<>0 or ChkBadWord(zbname)<>0 or ChkBadWord(pic)<>0 or ChkBadWord(dengji)<>0 or ChkBadWord(wuqi_name)<>0 or ChkBadWord(wuqi_shuxing)<>0 or ChkBadWord(wuqi_danjia)<>0 or ChkBadWord(yifu_name)<>0 or ChkBadWord(yifu_shuxing)<>0 or ChkBadWord(yifu_danjia)<>0 or ChkBadWord(toukui_name)<>0 or ChkBadWord(toukui_shuxing)<>0 or ChkBadWord(toukui_danjia)<>0) then
		response.write("<script language=javascript>")
		response.write("alert('输入参数包含非法字符');")
		response.write("window.location='main_body.asp';")
		response.write("</script>")
	else
		if(ChkBadWord(xianglian_name)<>0 or ChkBadWord(xianglian_shuxing)<>0 or ChkBadWord(xianglian_danjia)<>0 or ChkBadWord(zuojie_name)<>0 or ChkBadWord(zuojie_shuxing)<>0 or ChkBadWord(zuojie_danjia)<>0 or ChkBadWord(youjie_name)<>0 or ChkBadWord(youjie_shuxing)<>0 or ChkBadWord(youjie_danjia)<>0 or ChkBadWord(zuoshou_name)<>0 or ChkBadWord(zuoshou_shuxing)<>0 or ChkBadWord(zuoshou_danjia)<>0) then
			response.write("<script language=javascript>")
			response.write("alert('输入参数包含非法字符');")
			response.write("window.location='main_body.asp';")
			response.write("</script>")
		else
			if(ChkBadWord(youshou_name)<>0 or ChkBadWord(youshou_shuxing)<>0 or ChkBadWord(youshou_danjia)<>0 or ChkBadWord(xunzhang_name)<>0 or ChkBadWord(xunzhang_shuxing)<>0 or ChkBadWord(xunzhang_danjia)<>0 or ChkBadWord(xuezi_name)<>0 or ChkBadWord(xuezi_shuxing)<>0 or ChkBadWord(xuezi_danjia)<>0 or ChkBadWord(dun_name)<>0 or ChkBadWord(dun_shuxing)<>0 or ChkBadWord(dun_danjia)<>0 or ChkBadWord(yaodai_name)<>0 or ChkBadWord(yaodai_shuxing)<>0 or ChkBadWord(yaodai_danjia)<>0) then
				response.write("<script language=javascript>")
				response.write("alert('输入参数包含非法字符');")
				response.write("window.location='main_body.asp';")
				response.write("</script>")
			else
				if(ChkBadWord(total)<>0 or ChkBadWord(memo)<>0) then
					response.write("<script language=javascript>")
					response.write("alert('输入参数包含非法字符');")
					response.write("window.location='main_body.asp';")
					response.write("</script>")
				else
					set rs_zhuangbei=Server.CreateObject("ADODB.RecordSet")
					rs_zhuangbei.open "select * from [fksf_zb] where id="&id,conn,1,3
					if(rs_zhuangbei.eof) then
						rs_zhuangbei.close()
						set rs_zhuangbei=nothing
						response.write("<script language=javascript>")
						response.write("alert('该装备不存在');")
						response.write("window.location='main_body.asp';")
						response.write("</script>")
					else
						rs_zhuangbei("zbname")=zbname
						rs_zhuangbei("pic")=pic
						rs_zhuangbei("dengji")=dengji
						
						rs_zhuangbei("wuqi_name")=wuqi_name
						rs_zhuangbei("wuqi_shuxing")=wuqi_shuxing
						rs_zhuangbei("wuqi_danjia")=wuqi_danjia
						
						rs_zhuangbei("yifu_name")=yifu_name
						rs_zhuangbei("yifu_shuxing")=yifu_shuxing
						rs_zhuangbei("yifu_danjia")=yifu_danjia
						
						rs_zhuangbei("toukui_name")=toukui_name
						rs_zhuangbei("toukui_shuxing")=toukui_shuxing
						rs_zhuangbei("toukui_danjia")=toukui_danjia
						
						rs_zhuangbei("xianglian_name")=xianglian_name
						rs_zhuangbei("xianglian_shuxing")=xianglian_shuxing
						rs_zhuangbei("xianglian_danjia")=xianglian_danjia
						
						rs_zhuangbei("zuojie_name")=zuojie_name
						rs_zhuangbei("zuojie_shuxing")=zuojie_shuxing
						rs_zhuangbei("zuojie_danjia")=zuojie_danjia
						
						rs_zhuangbei("youjie_name")=youjie_name
						rs_zhuangbei("youjie_shuxing")=youjie_shuxing
						rs_zhuangbei("youjie_danjia")=youjie_danjia
						
						rs_zhuangbei("zuoshou_name")=zuoshou_name
						rs_zhuangbei("zuoshou_shuxing")=zuoshou_shuxing
						rs_zhuangbei("zuoshou_danjia")=zuoshou_danjia
						
						rs_zhuangbei("youshou_name")=youshou_name
						rs_zhuangbei("youshou_shuxing")=youshou_shuxing
						rs_zhuangbei("youshou_danjia")=youshou_danjia
						
						rs_zhuangbei("xunzhang_name")=xunzhang_name
						rs_zhuangbei("xunzhang_shuxing")=xunzhang_shuxing
						rs_zhuangbei("xunzhang_danjia")=xunzhang_danjia
						
						rs_zhuangbei("xuezi_name")=xuezi_name
						rs_zhuangbei("xuezi_shuxing")=xuezi_shuxing
						rs_zhuangbei("xuezi_danjia")=xuezi_danjia
						
						rs_zhuangbei("dun_name")=dun_name
						rs_zhuangbei("dun_shuxing")=dun_shuxing
						rs_zhuangbei("dun_danjia")=dun_danjia
						
						rs_zhuangbei("yaodai_name")=yaodai_name
						rs_zhuangbei("yaodai_shuxing")=yaodai_shuxing
						rs_zhuangbei("yaodai_danjia")=yaodai_danjia
						
						rs_zhuangbei("total")=total
						rs_zhuangbei("memo")=memo
						
						rs_zhuangbei.update()
						rs_zhuangbei.close()
						set rs_zhuangbei=nothing
						response.write("<script language=javascript>")
						response.write("alert('套装价格已经更新');")
						response.write("window.location='main_body.asp';")
						response.write("</script>")
					end if
				end if
			end if
		end if
	end if
	end if
end sub
%>

<%
Rem 套装价格添加
sub zhuangbei_insert()
	zbname=trim(request("zbname"))
	pic=trim(request("pic"))
	dengji=trim(request("dengji"))
	wuqi_name=trim(request("wuqi_name"))
	wuqi_shuxing=trim(request("wuqi_shuxing"))
	wuqi_danjia=trim(request("wuqi_danjia"))
	
	yifu_name=trim(request("yifu_name"))
	yifu_shuxing=trim(request("yifu_shuxing"))
	yifu_danjia=trim(request("yifu_danjia"))
	
	toukui_name=trim(request("toukui_name"))
	toukui_shuxing=trim(request("toukui_shuxing"))
	toukui_danjia=trim(request("toukui_danjia"))
	
	xianglian_name=trim(request("xianglian_name"))
	xianglian_shuxing=trim(request("xianglian_shuxing"))
	xianglian_danjia=trim(request("xianglian_danjia"))
	
	zuojie_name=trim(request("zuojie_name"))
	zuojie_shuxing=trim(request("zuojie_shuxing"))
	zuojie_danjia=trim(request("zuojie_danjia"))
	
	youjie_name=trim(request("youjie_name"))
	youjie_shuxing=trim(request("youjie_shuxing"))
	youjie_danjia=trim(request("youjie_danjia"))
	
	zuoshou_name=trim(request("zuoshou_name"))
	zuoshou_shuxing=trim(request("zuoshou_shuxing"))
	zuoshou_danjia=trim(request("zuoshou_danjia"))
	
	youshou_name=trim(request("youshou_name"))
	youshou_shuxing=trim(request("youshou_shuxing"))
	youshou_danjia=trim(request("youshou_danjia"))
	
	xunzhang_name=trim(request("xunzhang_name"))
	xunzhang_shuxing=trim(request("xunzhang_shuxing"))
	xunzhang_danjia=trim(request("xunzhang_danjia"))
	
	xuezi_name=trim(request("xuezi_name"))
	xuezi_shuxing=trim(request("xuezi_shuxing"))
	xuezi_danjia=trim(request("xuezi_danjia"))
	
	dun_name=trim(request("dun_name"))
	dun_shuxing=trim(request("dun_shuxing"))
	dun_danjia=trim(request("dun_danjia"))
	
	yaodai_name=trim(request("yaodai_name"))
	yaodai_shuxing=trim(request("yaodai_shuxing"))
	yaodai_danjia=trim(request("yaodai_danjia"))
	
	total=trim(request("total"))
	memo=trim(request("memo"))
	
	if(zbname="" or pic="" or dengji="") then
		response.write("<script language=javascript>")
		response.write("alert('套装名称 套装图片路径 套装需求等级不能为空');")
		response.write("window.location='main_body.asp';")
		response.write("</script>")
	else
	if(ChkBadWord(zbname)<>0 or ChkBadWord(pic)<>0 or ChkBadWord(dengji)<>0 or ChkBadWord(wuqi_name)<>0 or ChkBadWord(wuqi_shuxing)<>0 or ChkBadWord(wuqi_danjia)<>0 or ChkBadWord(yifu_name)<>0 or ChkBadWord(yifu_shuxing)<>0 or ChkBadWord(yifu_danjia)<>0 or ChkBadWord(toukui_name)<>0 or ChkBadWord(toukui_shuxing)<>0 or ChkBadWord(toukui_danjia)<>0) then
		response.write("<script language=javascript>")
		response.write("alert('输入参数包含非法字符');")
		response.write("window.location='main_body.asp';")
		response.write("</script>")
	else
		if(ChkBadWord(xianglian_name)<>0 or ChkBadWord(xianglian_shuxing)<>0 or ChkBadWord(xianglian_danjia)<>0 or ChkBadWord(zuojie_name)<>0 or ChkBadWord(zuojie_shuxing)<>0 or ChkBadWord(zuojie_danjia)<>0 or ChkBadWord(youjie_name)<>0 or ChkBadWord(youjie_shuxing)<>0 or ChkBadWord(youjie_danjia)<>0 or ChkBadWord(zuoshou_name)<>0 or ChkBadWord(zuoshou_shuxing)<>0 or ChkBadWord(zuoshou_danjia)<>0) then
			response.write("<script language=javascript>")
			response.write("alert('输入参数包含非法字符');")
			response.write("window.location='main_body.asp';")
			response.write("</script>")
		else
			if(ChkBadWord(youshou_name)<>0 or ChkBadWord(youshou_shuxing)<>0 or ChkBadWord(youshou_danjia)<>0 or ChkBadWord(xunzhang_name)<>0 or ChkBadWord(xunzhang_shuxing)<>0 or ChkBadWord(xunzhang_danjia)<>0 or ChkBadWord(xuezi_name)<>0 or ChkBadWord(xuezi_shuxing)<>0 or ChkBadWord(xuezi_danjia)<>0 or ChkBadWord(dun_name)<>0 or ChkBadWord(dun_shuxing)<>0 or ChkBadWord(dun_danjia)<>0 or ChkBadWord(yaodai_name)<>0 or ChkBadWord(yaodai_shuxing)<>0 or ChkBadWord(yaodai_danjia)<>0) then
				response.write("<script language=javascript>")
				response.write("alert('输入参数包含非法字符');")
				response.write("window.location='main_body.asp';")
				response.write("</script>")
			else
				if(ChkBadWord(total)<>0 or ChkBadWord(memo)<>0) then
					response.write("<script language=javascript>")
					response.write("alert('输入参数包含非法字符');")
					response.write("window.location='main_body.asp';")
					response.write("</script>")
				else
					set rs_zhuangbei=Server.CreateObject("ADODB.RecordSet")
					rs_zhuangbei.open "select * from [fksf_zb] where zbname='"&zbname&"'",conn,1,3
					if(not rs_zhuangbei.eof) then
						rs_zhuangbei.close()
						set rs_zhuangbei=nothing
						response.write("<script language=javascript>")
						response.write("alert('本系统中已有该装备');")
						response.write("window.location='main_body.asp';")
						response.write("</script>")
					else
						rs_zhuangbei.addnew()
						
						rs_zhuangbei("zbname")=zbname
						rs_zhuangbei("pic")=pic
						rs_zhuangbei("dengji")=dengji
						
						rs_zhuangbei("wuqi_name")=wuqi_name
						rs_zhuangbei("wuqi_shuxing")=wuqi_shuxing
						rs_zhuangbei("wuqi_danjia")=wuqi_danjia
						
						rs_zhuangbei("yifu_name")=yifu_name
						rs_zhuangbei("yifu_shuxing")=yifu_shuxing
						rs_zhuangbei("yifu_danjia")=yifu_danjia
						
						rs_zhuangbei("toukui_name")=toukui_name
						rs_zhuangbei("toukui_shuxing")=toukui_shuxing
						rs_zhuangbei("toukui_danjia")=toukui_danjia
						
						rs_zhuangbei("xianglian_name")=xianglian_name
						rs_zhuangbei("xianglian_shuxing")=xianglian_shuxing
						rs_zhuangbei("xianglian_danjia")=xianglian_danjia
						
						rs_zhuangbei("zuojie_name")=zuojie_name
						rs_zhuangbei("zuojie_shuxing")=zuojie_shuxing
						rs_zhuangbei("zuojie_danjia")=zuojie_danjia
						
						rs_zhuangbei("youjie_name")=youjie_name
						rs_zhuangbei("youjie_shuxing")=youjie_shuxing
						rs_zhuangbei("youjie_danjia")=youjie_danjia
						
						rs_zhuangbei("zuoshou_name")=zuoshou_name
						rs_zhuangbei("zuoshou_shuxing")=zuoshou_shuxing
						rs_zhuangbei("zuoshou_danjia")=zuoshou_danjia
						
						rs_zhuangbei("youshou_name")=youshou_name
						rs_zhuangbei("youshou_shuxing")=youshou_shuxing
						rs_zhuangbei("youshou_danjia")=youshou_danjia
						
						rs_zhuangbei("xunzhang_name")=xunzhang_name
						rs_zhuangbei("xunzhang_shuxing")=xunzhang_shuxing
						rs_zhuangbei("xunzhang_danjia")=xunzhang_danjia
						
						rs_zhuangbei("xuezi_name")=xuezi_name
						rs_zhuangbei("xuezi_shuxing")=xuezi_shuxing
						rs_zhuangbei("xuezi_danjia")=xuezi_danjia
						
						rs_zhuangbei("dun_name")=dun_name
						rs_zhuangbei("dun_shuxing")=dun_shuxing
						rs_zhuangbei("dun_danjia")=dun_danjia
						
						rs_zhuangbei("yaodai_name")=yaodai_name
						rs_zhuangbei("yaodai_shuxing")=yaodai_shuxing
						rs_zhuangbei("yaodai_danjia")=yaodai_danjia
						
						rs_zhuangbei("total")=total
						rs_zhuangbei("memo")=memo
						
						rs_zhuangbei.update()
						rs_zhuangbei.close()
						set rs_zhuangbei=nothing
						response.write("<script language=javascript>")
						response.write("alert('套装价格已经添加');")
						response.write("window.location='main_body.asp';")
						response.write("</script>")
					end if
				end if
			end if
		end if
	end if
	end if
end sub
%>

<%
Rem 套装价格删除
sub zhuangbei_delete()
	id=trim(request("id"))
	if(id="") then
		response.write("<script language=javascript>")
		response.write("alert('参数不能为空');")
		response.write("window.location='main_body.asp';")
		response.write("</script>")
	else
		if(ChkBadWord(id)<>0) then
			response.write("<script language=javascript>")
			response.write("alert('参数包含非法字符');")
			response.write("window.location='main_body.asp';")
			response.write("</script>")
		else
			conn.execute("delete from [fksf_zb] where id="&id)
			response.Write("<script language=javascript>")
			response.Write("alert('删除套装价格成功');")
			response.Write("window.location='main_body.asp';")
			response.Write("</script>")
		end if
	end if
end sub
%>