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

📄 foitem.asp

📁 科研及设备管理系统是一个基于WEB的网络管理信息系统
💻 ASP
字号:
<%	
	pathlevel="../"
%>
<!--#include file="../database/conn.asp" -->
<!--#include file="../share/checkinput.asp" -->
<!--#include file="../share/checklogin.asp" -->
<script language="javascript">
function del(id,sid,item_id)
{
 	if(window.confirm("确定要删除此项目吗?"))
	{
		mystring="del.asp?id="+id+"&sid="+sid+"&item_id="+item_id
		setTimeout('location.href=mystring',1)
		location.href=mystring
	}
}
</script>
<%
	mess=request("mess")
	select case mess
		case 1
			message="预研项目编号不能为空"
		case 2
			message="预研项目名称不能为空"
		case 3
			message="该预研项目编号已存在"
		case 4
			message="该预研项目名称已存在"
		case 5
			message="数据不存在或被删除"
		case 6
			message="启动时间格式不对,请按照提示格式输入!"
		case 7
			message="请输入人民币数字!"
		case 10
			message="添加成功!"
		case 11
			message="修改成功!"
	end select
%>
<table width="100%" border="0" valign=top cellpadding="0" cellspacing="0">
	<tr>
		<td height="25" valign="middle" bgcolor="#C8E0FB">&nbsp;&nbsp;&nbsp;<span class="redfont"><strong>预研项目库</strong></span></td>
	</tr>	
	<tr>
		<form action="index.asp?id=<%=id%>&sid=<%=sid%>" method="post" name="myform" id="myform" onSubmit="return checkinput()">
		<td height="36" valign=middle class=blackfont>
			&nbsp;&nbsp;&nbsp;预研项目编号:<input name="query_foitem_id" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="" maxlength="20">
			&nbsp;&nbsp;&nbsp;预研项目名称:<input name="query_foitem_name" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="" maxlength="20">
			&nbsp;&nbsp;&nbsp;工作组负责人:<input name="query_group_principal" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="" maxlength="20">
			&nbsp;&nbsp;<input type="submit" name="Submit" value="查 询"><span class=redfont>&nbsp;&nbsp;&nbsp;&nbsp;( 输入关键字查询 )</span>

		</td>
		</form>
	</tr>
	<tr>
		<td height="2" valign="middle" bgcolor="#666666"></td>
	</tr>
	<tr>
		<td height=200 valign="top" bgcolor="#C8E0FB">
			<table width="100%"  border="0" valign=top align="center" cellpadding="0" cellspacing="0" bgcolor="#f0f0f0" class="blackfont">
				<tr bgcolor="#8CBDFF">
					<td width="10%" align=center height="25"><strong>预研编号</strong></td>
					<td width="16%" align=center><strong>预研名称</strong></td>
					<td width="25%" align=center nowrap><strong>研究方向</strong></td>
        			<td width="10%" align=center nowrap><strong>项目经费</strong></td>
        			<td width="9%" align=center nowrap><strong>启动时间</strong></td>
        			<td width="20%" align=center nowrap><strong>工作组负责人</strong></td>
        			<td width="10%" align=center nowrap><div align="center"><strong>操 作</strong></div></td>
				</tr>
      			<%
      				query_foitem_id=request("query_foitem_id")
      				query_foitem_name=request("query_foitem_name")
      				query_group_principal=request("query_group_principal")
      				spage=request("page") 
      				     				
      				call checkinput(query_foitem_id)
      				call checkinput(query_foitem_name)
      				call checkinput(query_group_principal)
      				
      				if not Isnumeric(spage) then
      					response.redirect"error.asp?err=2"
      				end if
      				
      				sql="select * from foitem"
      				if len(query_foitem_id)>0 then
      					sql=sql&" where foitem_id like '%"&query_foitem_id&"%'"
      					if len(query_foitem_name)>0 then
      						sql=sql&" and foitem_name like '%"&query_foitem_name&"%'"
      						if len(query_group_principal)>0 then
      							sql=sql&" and group_principal like '%"&query_group_principal&"%'"
      						end if
      					else
      						if len(query_group_principal)>0 then
      							sql=sql&" and group_principal like '%"&group_principal&"%'"
      						end if
      					end if
      				else
      					if len(query_foitem_name)>0 then
      						sql=sql&" where foitem_name like '%"&query_foitem_name&"%'"
      						if len(query_group_principal)>0 then
      							sql=sql&" and group_principal like '%"&query_group_principal&"%'"
      						end if
      					else
      						if len(query_group_principal)>0 then
      							sql=sql&" where group_principal like '%"&query_group_principal&"%'"
      						end if	
      					end if
      				end if		
      				
					set rs=server.CreateObject("adodb.recordset")
					rs.Cursorlocation=3
					rs.open sql,cn,1,3
					if rs.eof then
						response.write "&nbsp;<span class='redfont'>查询不到或还未添加任何项目</span>"
					else
						rs.PageSize=10
						pagesize=rs.pagesize
						pagecount=rs.PageCount
						allcount=rs.RecordCount
						if cint(spage)<=pagecount and spage>0 then
							rs.AbsolutePage=cint(spage)
						else
							spage="1"
							rs.AbsolutePage=cint(spage)
						end if

						for i=1 to rs.PageSize
				%>				
				<tr bgcolor="eeeeee">
					<td height="25" align=center><%=rs("foitem_id")%></td>
        			<td align=center><%=rs("foitem_name")%></td>
        			<td align=center nowrap><%=rs("foitem_aspect")%></td>
        			<td align=center nowrap>&yen;<%=rs("foitem_outlay")%></td>
        			<td align=center nowrap><%=rs("start_time")%></td>
        			<td align=center nowrap><%=rs("group_principal")%></td>
        			<td align=center><div align="center">
				<%
						link="index.asp?id="&id&"&sid="&sid&"&sfoitem_id="&rs("id")&""
						str="<a class=right_white href="&link&" title='修改项目 "&rs("foitem_name")&"'>修改</a>&nbsp;|&nbsp;<a class=right_white href='javascript:del("&id&","&sid&","&rs("id")&")' title='删除项目 "&rs("foitem_name")&"'>删除</a>"					
						response.write str
				%>
					</td>
				</tr>
				<%
						rs.movenext
						if rs.eof then
							exit for
						end if
						next
				%>
				<tr bgcolor="#8CBDFF">
        			<td width="100%" height=20 colspan=7 align=center nowrap><div align="right">
        				共 <%=pagecount%> 页,<%=allcount%> 条记录,每页 <%=pagesize%> 条记录,本页是第 <%=spage%> 页.&nbsp;<a class=right_white href='index.asp?id=<%=id%>&sid=<%=sid%>&page=1&query_foitem_id=<%=query_foitem_id%>&query_foitem_name=<%=query_foitem_name%>&query_group_principal=<%=cstr(query_group_principal)%>'>首页</a>&nbsp;
				<%			if cint(spage)>1 then
								Response.write "<a class=right_white href='index.asp?id="&id&"&sid="&sid&"&page="&cstr(spage-1)&"&query_foitem_id="&cstr(query_foitem_id)&"&query_foitem_name="&cstr(query_foitem_name)&"&query_group_principal="&cstr(query_group_principal)&"'>上一页</a>&nbsp;"
							end if
							if cint(spage)<pagecount then
								Response.write "<a class=right_white href='index.asp?id="&id&"&sid="&sid&"&page="&cstr(spage+1)&"&query_foitem_id="&query_foitem_id&"&query_foitem_name="&query_foitem_name&"&query_group_principal="&cstr(query_group_principal)&"'>下一页</a>&nbsp;"
								Response.write "<a class=right_white href='index.asp?id="&id&"&sid="&sid&"&page="&pagecount&"&query_foitem_id="&query_foitem_id&"&query_foitem_name="&query_foitem_name&"&query_group_principal="&cstr(query_group_principal)&"'>尾页</a>&nbsp;"
							end if
						end if
				%>&nbsp;&nbsp;</div>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td height="2" valign="middle" bgcolor="#999999"></td>
	</tr>
	<%
				sfoitem_id=request("sfoitem_id")
				if not Isnumeric(sfoitem_id) then
					response.redirect"error.asp?err=2"
				end if
				
				if sfoitem_id>0 then
					rs.close
					sql="select * from foitem where id="&sfoitem_id
					rs.open sql,cn,1,3
					if rs.eof then
						response.redirect"error.asp?err=1"
					else
						n=1
					end if
				end if
	%>
	<tr>
		<td height="25" valign="middle" bgcolor="#C8E0FB">&nbsp;&nbsp;&nbsp;<span class="redfont"><strong><% if n=1 then response.write "修改" else response.write "添加" end if%>预研项目</strong>&nbsp;&nbsp;*标记为必填项</span></td>
	</tr>
	<tr>
		<td height=200 valign="top" bgcolor="#C8E0FB">			
			<form action="<% if n=1 then response.write "edit" else response.write "add" end if%>.asp?id=<%=id%>&sid=<%=sid%><%if n=1 then response.write "&sfoitem_id="&rs("id")%>" method="post" name="myform" id="myform" onSubmit="return checkinput()">
			<table width="500"  border="0" valign=top align="center" cellpadding="0" cellspacing="0" bgcolor="#C8E0FB" class="blackfont">				
				<tr>					
					<td height="36" valign=middle class=blackfont>
						预 研 编 号 &nbsp;:<input name="foitem_id" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("foitem_id") end if%>" maxlength="20"><span class="redfont">&nbsp;*</span>
					</td>
					<td valign=middle class=blackfont>
						&nbsp;&nbsp;&nbsp;&nbsp;预 研 名 称 &nbsp;:<input name="foitem_name" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("foitem_name") end if%>" maxlength="30"><span class="redfont">&nbsp;*</span>
					</td>					
				</tr>
				<tr>					
					<td height="36" valign=middle colspan=2 class=blackfont>
						研 究 方 向 &nbsp;:<input name="foitem_aspect" type="text" style="width:360px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("foitem_aspect") end if%>" maxlength=100>
					</td>				
				</tr>
				<tr>					
					<td height="36" valign=middle colspan=2 class=blackfont>
						项 目 经 费 &nbsp;:<input name="foitem_outlay" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("foitem_outlay") end if%>" maxlength="20"><span class="redfont">&nbsp;数字RMB</span>
					</td>					
				</tr>
				<tr>
					<td valign=middle colspan=2 class=blackfont>
						启 动 时 间 &nbsp;:<input name="start_time" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("start_time") end if%>" maxlength="20"><span class="redfont">&nbsp;格式:2005-05-25</span>
					</td>					
				</tr>
				<tr>
					<td height=36 valign=middle colspan=2 class=blackfont>
						工作组负责人 :<input name="group_principal" type="text" style="width:360px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("group_principal") end if%>" maxlength="50">
					</td>					
				</tr>
				<tr>					
					<td height="36" valign=middle align=right class=blackfont>
						<input type="submit" name="Submit" value="<% if n=1 then response.write "修 改" else response.write "添 加" end if%>">
					</td>
					<td valign=middle align=left class=blackfont>
						&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value="重 置">
					</td>					
				</tr>
				<tr>					
					<td height="20" valign=middle colspan=2 class=blackfont><span class="redfont"><b><%=message%></b></span>
					</td>					
				</tr>
				<% if n=1 then
				%>
				<tr>					
					<td height="20" colspan=2 valign=middle class=blackfont>
						<input name="h_id" type="hidden" value="<%=rs("id")%>" maxlength="20">
					</td>				
				</tr>
				<% end if %>
			</table>
			</form>
		</td>
	</tr>
</table>
<%
	rs.close
	set rs=nothing
	cn.close
	set cn=nothing
%>

















⌨️ 快捷键说明

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