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

📄 projectxq_editlist.asp

📁 ASP程序实现的科技期刊系统
💻 ASP
字号:
<!--#include file="../Include/TimeOut.asp"-->
<%modulecode="1001"%>
<!--#include file="../Include/ModuleUserCheck.asp"-->
<html>
<head>
<title>需求列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>
TD {FONT-SIZE: 9pt}

A:link
{
    COLOR: #000000;
    FONT-FAMILY: 宋体;
    FONT-SIZE: 9pt
}
A:visited
{
    COLOR: #000000;
    FONT-FAMILY: 宋体;
    FONT-SIZE: 9pt
}
A:active
{
    COLOR: #000000;
    FONT-FAMILY: 宋体;
    FONT-SIZE: 9pt
}
A:hover
{
    COLOR: blue;
    FONT-FAMILY: 宋体;
    FONT-SIZE: 9pt
}

</style>
</head>

<Script Language=JavaScript>
<!--
function SelAll_onclick(){
	if(ConList.SelAll.checked){
		SetAll();
	}
	else{
		UnSetAll();
	}
}
function SetAll(){
	var intCount;
	if(ConList.all("checkCon").length > 1){
		for(intCount = 0; intCount < ConList.all("checkCon").length; intCount++){
			ConList.checkCon(intCount).checked = true;
		}
	}
	else{
		ConList.checkCon.checked = true;
	}
	
}
function UnSetAll(){
	var intCount;
	if(ConList.all("checkCon").length > 1){
		for(intCount = 0; intCount < ConList.all("checkCon").length; intCount++){
			ConList.checkCon(intCount).checked = false;
		}
	}
	else{
		ConList.checkCon.checked = false;
	}
	
}
function checkCon_onclick(){
	var intCount;
	ConList.SelAll.checked = true;
	if(ConList.all("checkCon").length > 1){
		for(intCount = 0; intCount < ConList.all("checkCon").length; intCount++){
			if(ConList.checkCon(intCount).checked == false){
				ConList.SelAll.checked = false;
			}
		}
	}
	else{
		if(ConList.checkCon.checked == false){
			ConList.SelAll.checked = false;
		}
	}
	
}

//-->
</Script>

<script language="vbscript"runat="server">
function msgzh()
	msgzh= MsgBox ("确定要删除这些记录吗?", vbYesNo, "提示信息")
	if msgzh=vbyes then document.ConList.submit()
end function
function check_onclick(i,tpr)
	msgsindel= MsgBox ("确定要删除这条记录吗?", vbYesNo, "提示信息")
	if msgsindel=vbyes then
		if  tpr > 1 then
			for intcount = 0 to  ConList.all("checkCon").length - 1
				if intcount=i-1 then ConList.checkCon(intCount).checked=true else  ConList.checkCon(intCount).checked=false
			next
			else 
			ConList.checkCon.checked = true
		end if
		document.ConList.submit()
	end if 
end function
</script>

<body bgcolor="#FFFFFF" text="#000000" onload="window.top.ProjectMax()" link="#FFFFFF">
<%
	dim objres        'recordset对象
	dim strsql         'sql语句
	if Request.QueryString("muldel")="muldel"then   '从删除转来, 删除相应记录
			for each item in  Request.Form("checkCon")
				projectname=Item
				strsql="delete from diaoca where 项目名称="+"'"+projectname+"'"
				conn.Execute strsql,1
			next
	end if
	
	if not  Request.QueryString("strsql")="" then
	select case Request.QueryString("strsql")
	case "query"	'由查询转来
			dim projectName
			dim guanlichushi
			dim danweiname
			dim zhudaochanye
			dim strQueryType
			dim strSQLWhere
		
			projectName=trim(request.form("projectName"))
			danweiname=trim(request.form("danweiname"))
			zhudaochanye=trim(request.form("zhudaochanye"))
			guanlichushi=trim(request.form("guanlichushi"))
			
					
		'复选框选中时,strQueryType="%"
			if Request.Form("checkbox").Count=1 then
			   strQueryType="%"
			   else 
			   strQueryType=""
			end if
			'无任何where选项时
			strsql="select * from DiaoCa where 1=1"
			'按查询界面各输入框生成多条件where选项
			if not projectname="" then
			   strSQLWhere=strSQLWhere+" and 项目名称 like '"+strQueryType+projectName+strQueryType+"'"
			end if
			if not danweiname="" then
			   strSQLWhere=strSQLWhere+" and 单位名称 like '"+strQueryType+danweiname+strQueryType+"'"
			end if
			if not zhudaochanye="" then
			   strSQLWhere=strSQLWhere+" and 主导产业 like '"+strQueryType+zhudaochanye+strQueryType+"'"
			end if
			if not guanlichushi="" then
			   strSQLWhere=strSQLWhere+" and 管理处室 like '"+strQueryType+guanlichushi+strQueryType+"'"
			end if
			strSQL=strSQL+StrSQLWhere

	case else  '各页间转换
			strsql=Request.QueryString("strsql")
			
	end  select
	
		
	set objres=server.CreateObject ("adodb.recordset")
	objres.CursorType =3
	objres.CursorLocation =3
	objres.LockType =2
	objres.Open strsQl,strConn
	
	dim pagesum '页数
	dim thispagerecords '当前页记录条数 
	dim recordcode '记录序号
	dim curpage '当前页码
	dim pagesize
	pagesize=10
	pagesum=objres.PageCount 
	if Request.QueryString("page")=""then curpage=1 else curpage=Request.QueryString("page")
	
	if cint(curpage)> cint(pagesum) then curpage=pagesum           '转换成整数格式时必须的,大量实验已经证明
end if
%>
<% if not  Request.QueryString("strsql")="" then %><form name=ConList method="post" action="ProjectXQ_EditList.asp?muldel=muldel&strsql=<%=server.URLEncode(strsql)%>&page=<%=curpage%>"> 
<% else %>
<form name=ConList method="post" action="../project/projectXQ_editlist.asp">
  <% 
   end if
  %> 
  <table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr> 
      <td width="630" height="38" valign="top"><img src="images/editlist_xuqiu.gif" width="227" height="38"></td>
      <td width="69" valign="middle" align="center"> 
        <div align="center"><a href="projectXQ.asp"><img src="../public/images/query.gif" width="24" height="18" border="0"><br>
          </a> <font color="#003399">查询</font></div>
      </td>
      <td width="61" valign="top">&nbsp;</td>
    </tr>
  </table>
  <table width="100%" border="0" cellspacing="1" cellpadding="0" bordercolor="#0099FF" align="center" bgcolor="#006699">
    <tr bordercolor="#0099FF"> 
      <td width="24" height="20" valign="top" bgcolor="#6699CC"> 
        <input type="checkbox" name="SelAll" onClick ="SelAll_onclick()"value="checkbox">
      </td>
      <td valign="middle" width="35" align="center" bgcolor="#6699CC"> 
        <div align="center"><font color="#FFFFFF">序号</font></div>
      </td>
      <td valign="middle" width="114" bgcolor="#6699CC"> 
        <div align="center"> <font color="#FFFFFF">项目名称</font></div>
      </td>
      <td valign="middle" width="71" align="center" bgcolor="#6699CC"> 
        <div align="center"> <font color="#FFFFFF">单位名称</font></div>
      </td>
      <td valign="middle" width="76" align="center" bgcolor="#6699CC"> <font color="#FFFFFF">主导产业</font></td>
      <td valign="middle" width="80" align="center" bgcolor="#6699CC"> <font color="#FFFFFF">管理处室</font></td>
      <td valign="middle" width="103" align="center" bgcolor="#6699CC"><font color="#FFFFFF">备注1</font></td>
      <td valign="middle" width="102" bgcolor="#6699CC" align="center"><font color="#FFFFFF">备注2</font></td>
      <td valign="middle" width="94" bgcolor="#6699CC" align="center"><font color="#FFFFFF">备注3</font></td>
      <td valign="middle" width="34" align="center" bgcolor="#6699CC"><font color="#FFFFFF">修改</font></td>
      <td width="34" valign="middle" align="center" bgcolor="#6699CC"><font color="#FFFFFF">删除</font></td>
    </tr>
    <%
	if   Request.QueryString("strsql")="" then Response.End 
	if objres.RecordCount >pagesize*curpage then thispagerecords=pagesize else thispagerecords=objres.RecordCount-pagesize*(curpage-1)
	recordcode=10*(curpage-1)
	if objres.RecordCount >0 then 
			objres.MoveFirst 
			objres.Move((curpage-1)*10)	
		else 
	%>
    <tr> 
      <td colspan="11" height="12" bgcolor="#FFFFFF">对不起,没有符合要求的记录! </td>
    </tr>
    <%
			Response.End 
	end if
    for i=1 to thispagerecords 
     recordcode=recordcode+1
    %>
    <tr> 
      <td valign="middle" height="24" align="center" bgcolor="#FFFFFF"> 
        <input type="checkbox" name="checkCon" onClick="checkCon_onclick()" value=<% =objres.Fields("项目名称").Value %>>
      </td>
      <td valign="middle" align="center" bgcolor="#FFFFFF"> 
        <% =recordcode%>
      </td>
      <td valign="middle" align=center bgcolor="#FFFFFF"> 
        <%  = objres.Fields("项目名称").Value %>
      </td>
      <td valign="middle" align=center bgcolor="#FFFFFF"> 
        <%  = objres.Fields("单位名称").Value %>
      </td>
      <td valign="middle" align=center bgcolor="#FFFFFF"> 
        <%  = objres.Fields("主导产业").Value %>
        ;</td>
      <td valign="middle" align=center bgcolor="#FFFFFF"> 
        <%  = objres.Fields("管理处室").Value %>
      </td>
      <td valign="middle" bgcolor="#FFFFFF" align="center"> 
        <%  = objres.Fields("备注1").Value %>
      </td>
      <td valign="middle" bgcolor="#FFFFFF" align="center"> 
        <%  = objres.Fields("备注2").Value %>
      </td>
      <td valign="middle" bgcolor="#FFFFFF" align="center"> 
        <%  = objres.Fields("备注3").Value %>
      </td>
      <td valign="middle" bgcolor="#FFFFFF" align="center"> 
        <div align="center"><a href="projectXQ_edit.asp?projectname=<% = objres.Fields("项目名称").Value %>&danweiname=<% =objres.Fields("单位名称").Value %>&zhudaochanye=<% =objres.Fields("主导产业").Value %>&guanlichushi=<% =objres.Fields("管理处室").Value %>&strsql=<%=server.URLEncode(strsql)%>&page=<%=curpage%>&edit=edit"><img src="../public/images/edit.gif" width="19" height="17" border="0"></a></div>
      </td>
      <td valign="middle" bgcolor="#FFFFFF" align="center"> 
        <div align="center"><a href="vbscript:check_onclick(<%=i%>,<% =thispagerecords%>)"><img src="../public/images/del1.gif" width="19" height="17" border="0"></a></div>
      </td>
    </tr>
    <%
     objres.MoveNext 
       next
    %>
    <tr> 
      <td colspan="11" height="20" valign="top" bgcolor="#6699CC"> 
        <div align="right"> 
          <%
 
    if   curpage>1 then  Response.Write ("<a href="+"projectXQ_EditList.asp?page=1"+"&strsql="+server.URLEncode(strsql)+"> 首页</a>"+" | ") else Response.Write "首页 | "
    if   recordcode>pagesize then   Response.Write ("<a href="+"projectXQ_EditList.asp?page="+cstr(curpage-1)+"&strsql="+server.URLEncode(strsql)+"> 上一页</a>"+" | ") else Response.Write "上一页 | "
    if   recordcode<objres.RecordCount  then   Response.Write ("<a href="+"projectXQ_EditList.asp?page="+cstr(curpage+1)+"&strsql="+server.URLEncode(strsql)+"> 下一页</a>"+" | ") else Response.Write "下一页 | "
    if    recordcode<objres.RecordCount  then   Response.Write ("<a href="+"projectXQ_EditList.asp?page="+cstr (pagesum)+"&strsql="+server.URLEncode(strsql)+"> 末页</a>"+"  ") else Response.Write "末页  "
     %>
            第 <%=curpage %> 页/共 
          <% =pagesum  %>
          页/共 
          <% =objres.RecordCount %>
          条记录  </div>
      </td>
    </tr>
  </table>
</form>
<br>
</body>
</html>

⌨️ 快捷键说明

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