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

📄 study.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,sitem_id)
{
 	if(window.confirm("确定要删除此项目吗?"))
	{
		mystring="del.asp?id="+id+"&sid="+sid+"&item_id="+sitem_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 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_study_id" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="" maxlength="20">
			&nbsp;&nbsp;&nbsp;论文名称:<input name="query_study_name" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="" maxlength="20">
			&nbsp;&nbsp;&nbsp;论文作者:<input name="query_study_author" 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="12%" align=center height="25"><strong>论文编号</strong></td>
					<td width="25%" align=center><strong>论文名称</strong></td>
					<td width="20%" align=center nowrap><strong>论文作者</strong></td>
        			<td width="12%" align=center nowrap><strong>论文分类</strong></td>
        			<td width="16%" align=center nowrap><strong>论文发表时间</strong></td>
        			<td width="12%" align=center nowrap><div align="center"><strong>操 作</strong></div></td>
				</tr>
      			<%
      				query_study_id=request("query_study_id")
      				query_study_name=request("query_study_name")
      				query_study_author=request("query_study_author")

      				spage=request("page") 
      				     				
      				call checkinput(query_study_id)
      				call checkinput(query_study_name)
      				call checkinput(query_study_author)

      				if not Isnumeric(spage) then
      					response.redirect"error.asp?err=2"
      				end if
      				
      				sql="select * from study"
      				if len(query_study_id)>0 then
      					sql=sql&" where study_id like '%"&query_study_id&"%'"
      					if len(query_study_name)>0 then
      						sql=sql&" and study_name like '%"&query_study_name&"%'"
      						if len(query_study_author)>0 then
      							sql=sql&" and study_author like '%"&query_study_author&"%'"
      						end if
      					else
      						if len(query_study_author)>0 then
      							sql=sql&" and study_author like '%"&query_study_author&"%'"
      						end if
      					end if
      				else
      					if len(query_study_name)>0 then
      						sql=sql&" where study_name like '%"&query_study_name&"%'"
      						if len(query_study_author)>0 then
      							sql=sql&" and study_author like '%"&query_study_author&"%'"
      						end if
      					else
      						if len(query_study_author)>0 then
      							sql=sql&" where study_author like '%"&query_study_author&"%'"
      						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("study_id")%></td>
        			<td align=center><%=rs("study_name")%></td>
        			<td align=center nowrap><%=rs("study_author")%></td>
        			<td align=center nowrap><%=rs("study_sort")%></td>
        			<td align=center nowrap><%=rs("studypublish_time")%></td>
        			<td align=center><div align="center">
				<%
						link="index.asp?id="&id&"&sid="&sid&"&sstudy_id="&rs("id")&""
						str="<a class=right_white href="&link&" title='修改项目 "&rs("study_name")&"'>修改</a>&nbsp;|&nbsp;<a class=right_white href='javascript:del("&id&","&sid&","&rs("id")&")' title='删除项目 "&rs("study_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=6 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_study_id=<%=query_study_id%>&query_study_name=<%=query_study_name%>&query_study_author=<%=query_study_author%>'>首页</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_study_id="&cstr(query_study_id)&"&query_study_name="&cstr(query_study_name)&"&query_study_author="&query_study_author&"'>上一页</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_study_id="&query_study_id&"&query_study_name="&query_study_name&"&query_study_author="&query_study_author&"'>下一页</a>&nbsp;"
								Response.write "<a class=right_white href='index.asp?id="&id&"&sid="&sid&"&page="&pagecount&"&query_study_id="&query_study_id&"&query_study_name="&query_study_name&"&query_study_author="&query_study_author&"'>尾页</a>&nbsp;"
							end if
						end if
				%>&nbsp;&nbsp;</div>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td height="2" valign="middle" bgcolor="#999999"></td>
	</tr>
	<%
				sstudy_id=request("sstudy_id")
				if not Isnumeric(sstudy_id) then
					response.redirect"error.asp?err=2"
				end if
				
				if sstudy_id>0 then
					rs.close
					sql="select * from study where id="&sstudy_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 "&sstudy_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="study_id" type="text" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("study_id") end if%>" maxlength="20"><span class="redfont">&nbsp;*</span>
					</td>
					<td valign=middle class=blackfont>
						&nbsp;&nbsp;&nbsp;&nbsp;论文名称 &nbsp;:<input name="study_name" type="text" style="width:120px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("study_name") end if%>" maxlength="20"><span class="redfont">&nbsp;*</span>
					</td>					
				</tr>
				<tr>					
					<td height="36" valign=middle class=blackfont>
						论文分类 &nbsp;:<select name="study_sort" type="select" style="width:100px;border: 1px solid #CCCCCC;height:20px" value="">
						<% if n=1 then %>
						<option checked><%=rs("study_sort")%></option>
						<% else %>
						<option checked>请选择</option>				
						<%end if%>
						<option>人文</option>
						<option>经济</option>
						<option>法律</option>
						<option>社会科学</option>
						<option>自然科学</option>
						<option>技术科学</option>
						<option>其他分类</option>										
					</td>
					<td valign=middle class=blackfont>
					&nbsp;&nbsp;&nbsp;&nbsp;发表时间  &nbsp;:<input name="studypublish_time" type="text" style="width:120px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("studypublish_time")  else response.write date() end if%>" maxlength="20"><span class="redfont">&nbsp;格式:2005-05-20</span>
					</td>					
				</tr>
				<tr>					
					<td height="36" colspan=2 valign=middle class=blackfont>
						论文作者 &nbsp;:<input name="study_author" type="text" style="width:350px;border: 1px solid #CCCCCC;height:20px" value="<% if n=1 then response.write rs("study_author") 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 height="36" 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 + -