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

📄 add.asp

📁 科研及设备管理系统是一个基于WEB的网络管理信息系统
💻 ASP
字号:
<!--#include file="../share/checklogin.asp" -->
<!--#include file="../share/checkinput.asp" -->
<%
	dim pathlevel,cn
	
	pathlevel="../"
%>
<!--#include file="../database/conn.asp" -->
<%
	dim id,sid,sitem_id,sitem_name,sqltable,sqlsitem_id,sqlsitem_name
	
	id=request("id")
	sid=request("sid")
	
	if not isnumeric(id) then
		response.redirect"error.asp?err=2"
	end if
	if not isnumeric(sid) then
		response.redirect"error.asp?err=2"
	end if
	
	if id=1 then
		if sid=1 then
			sitem_id=request.form("item_id")
			sitem_name=request.form("item_name")
			item_styl=request.form("item_styl")
			item_outlay=request("item_outlay")
			item_principal=request("item_principal")
			item_framer=request("item_framer")
			
			if len(item_outlay)>0 then
				if not Isnumeric(item_outlay) then
					response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=7"
				end if
			else
				item_outlay=0
			end if
			
			sqltable="resitem"
			sqlsitem_id="item_id"
			sqlsitem_name="item_name"
		end if
		if sid=2 then
			sitem_id=request.form("study_id")
			sitem_name=request.form("study_name")
			study_sort=request.form("study_sort")
			studypublish_time=request.form("studypublish_time")
			study_author=request.form("study_author")
			
			if len(studypublish_time)>0 then
				if not Isdate(studypublish_time) then
					response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=6"
				end if
			else
				studypublish_time=date()
			end if
			
			sqltable="study"
			sqlsitem_id="study_id"
			sqlsitem_name="study_name"
		end if
		if sid=3 then
			sitem_id=request.form("newitem_id")
			sitem_name=request.form("newitem_name")
			newitem_content=request.form("newitem_content")
			check_time=request.form("check_time")
			check_idea=request.form("check_idea")
			
			if len(check_time)>0 then
				if not Isdate(check_time) then
					response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=6"
				end if
			else
				check_time=date()
			end if

			sqltable="alteritem"			
			sqlsitem_id="newitem_id"
			sqlsitem_name="newitem_name"
		end if
		if sid=4 then
			sitem_id=request.form("teitem_id")
			sitem_name=request.form("teitem_name")
			t_name=request.form("t_name")
			c_name=request.form("c_name")
			year_term=request.form("year_term")	
			check_result=request.form("check_result")
			check_man=request.form("check_man")
			check_date=request.form("check_date")
			
			if len(year_term)>0 then
				if not Isnumeric(left(year_term,4))  or mid(year_term,5,1)<>"年" or mid(year_term,7,2)<>"学年" or right(year_term,2)<>"学年" then
					response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=7"
				end if
			end if
			if len(check_date)>0 then
				if not Isdate(check_date) then
					response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=6"
				end if
			else
				check_date=date()
			end if

			sqltable="teach_harvest"			
			sqlsitem_id="teitem_id"
			sqlsitem_name="teitem_name"			
		end if
		if sid=5 then
			sitem_id=request.form("foitem_id")
			sitem_name=request.form("foitem_name")
			foitem_aspect=request.form("foitem_aspect")
			start_time=request.form("start_time")
			foitem_outlay=request.form("foitem_outlay")
			group_principal=request.form("group_principal")
			
			if len(start_time)>0 then
				if not Isdate(start_time) then
					response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=6"
				end if
			else
				start_time=date()
			end if
			if len(foitem_outlay)>0 then
				if not Isnumeric(foitem_outlay) then
					response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=7"
				end if
			else
				foitem_outlay=0
			end if
			
			sqltable="foitem"
			sqlsitem_id="foitem_id"
			sqlsitem_name="foitem_name"				
		end if
	end if
	if id=2 then
		if sid=1 then
			sitem_id=request.form("eq_id")
			sitem_name=request.form("eq_name")
			eq_type=request.form("eq_type")
			buy_time=request.form("buy_time")
			buy_price=request.form("buy_price")
			puse_time=request.form("puse_time")
			useyear_limit=request.form("useyear_limit")
			admin_name=request.form("admin_name")
			
			if len(buy_price)>0 then
				if not Isnumeric(buy_price) then
					response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=7"
				end if
			else
				buy_price=0
			end if
			if len(useyear_limit)>0 then
				if not Isnumeric(useyear_limit) then
					response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=8"
				end if
			else
				useyear_limit=0
			end if
			if len(buy_time)>0 then
				if not Isdate(buy_time) then
					response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=6"
				end if
			else
				buy_time=date()
			end if
			if len(puse_time)>0 then
				if not Isdate(puse_time) then
					response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=62"
				end if
			else
				puse_time=date()
			end if			

			sqltable="equipment"
			sqlsitem_id="eq_id"
			sqlsitem_name="eq_name"
		end if
		if sid=2 then
			sqltable="eq_plan"
		end if
		if sid=3 then
			sqltable="scrap"
		end if
	end if				
	
	if len(sitem_id)<=0 then
		response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=1"
	end if
	if len(sitem_name)<=0 then
		response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=2"
	end if
	
	call checkinput(sitem_id)
	call checkinput(sitem_name)
			
	set rs=server.createobject("ADODB.Recordset")
	sql="select top 1 * from "&sqltable&" where "&sqlsitem_id&"='"&sitem_id&"'"
	rs.Cursorlocation=3
	rs.open sql,cn,1,3
	if not rs.eof then
		response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=3"		
	end if
	rs.close
	sql="select top 1 * from "&sqltable&" where "&sqlsitem_name&"='"&sitem_name&"'"
	rs.Cursorlocation=3	
	rs.open sql,cn,1,3
	if not rs.eof then
		response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=4"		
	end if
	rs.close
	sql="select * from "&sqltable&" where id is null"
	rs.Cursorlocation=3
	rs.open sql,cn,3,3
	rs.addnew
		if id=1 and sid=1 then
			rs("item_id")=sitem_id
			rs("item_name")=sitem_name
			rs("item_styl")=item_styl
			rs("item_outlay")=item_outlay
			rs("item_principal")=item_principal
			rs("item_framer")=item_framer
		end if		
		if id=1 and sid=2 then
			rs("study_id")=sitem_id
			rs("study_name")=sitem_name
			rs("study_author")=study_author
			rs("study_sort")=study_sort
			rs("studypublish_time")=studypublish_time
		end if
		if id=1 and sid=3 then
			rs("newitem_id")=sitem_id
			rs("newitem_name")=sitem_name
			rs("newitem_content")=newitem_content
			rs("check_time")=check_time
			rs("check_idea")=check_idea
		end if
		if id=1 and sid=4 then
			rs("teitem_id")=sitem_id
			rs("teitem_name")=sitem_name
			rs("t_name")=t_name
			rs("c_name")=c_name
			rs("check_date")=check_date
			rs("check_man")=check_man
			rs("check_result")=check_result
			rs("year_term")=year_term
		end if
		if id=1 and sid=5 then
			rs("foitem_id")=sitem_id
			rs("foitem_name")=sitem_name
			rs("foitem_aspect")=foitem_aspect
			rs("start_time")=start_time
			rs("foitem_outlay")=foitem_outlay
			rs("group_principal")=group_principal
		end if
		if id=2 and sid=1 then
			rs("eq_id")=sitem_id
			rs("eq_name")=sitem_name
			rs("eq_type")=eq_type
			rs("buy_time")=buy_time
			rs("buy_price")=buy_price
			rs("useyear_limit")=useyear_limit
			rs("puse_time")=puse_time
			rs("admin_name")=admin_name
			rs("equ_now")="良好"
		end if
	rs.update
	rs.close
	set rs=nothing
		response.redirect"index.asp?id="&id&"&sid="&sid&"&mess=10"			
	cn.close
	set cn=nothing
%>

⌨️ 快捷键说明

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