?? topdepart_editlist.asp
字號:
<!--#include file="../Include/TimeOut.asp"-->
<%modulecode="0201"%>
<!--#include file="../Include/ModuleUserCheck.asp"-->
<!--#include file="../Include/online.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 ("確定要?jiǎng)h除這些記錄嗎?", vbYesNo, "提示信息")
if msgzh=vbyes then document.ConList.submit()
end function
function check_onclick(i,tpr)
msgsindel= MsgBox ("確定要?jiǎng)h除這條記錄嗎?", 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">
<%
dim objrec 'recordset對象
dim strsql 'sql語句
if Request.QueryString("muldel")="muldel"then '從刪除轉(zhuǎn)來, 刪除相應(yīng)記錄
for each item in Request.Form("checkCon")
code=Item
set adocom=server.CreateObject("ADODB.Command")
adocom.ActiveConnection=conn
adocom.CommandType=4
adocom.CommandText="PR_XT_UserDelete"
set paramenter1=adocom.CreateParameter("chrUserCode",200,1,40,code)
adocom.Parameters.Append paramenter1
adocom.Execute
set adocom=nothing
next
end if
if Request.QueryString("edit")="edit"then
dim name1
dim code1
name1=request("TopDepartName")
code1=request("TopDepartCode")
strsql="update XT_TC_User set 用戶姓名="+"'"+name1+"'"+" where 用戶編碼="+"'"+code1+"'"
conn.Execute strsql,1,adcmdtext
end if
if not Request.QueryString("strsql")="" then
select case Request.QueryString("strsql")
case "query" '由查詢轉(zhuǎn)來
dim code
dim name
dim TopDepartType
dim strQueryType
dim strSQLWhere
code=trim(Request.Form("TopDepartCode"))
name=trim(Request.Form("TopDepartName"))
TopDepartType=trim(Request.Form("TopDepartType"))
'復(fù)選框選中時(shí),strQueryType="%"
if Request.Form("checkbox").Count=1 then
strQueryType="%"
else
strQueryType=""
end if
'無任何where選項(xiàng)時(shí)
strsql="select * from XT_TC_User where len(用戶編碼)=3 and 用戶編碼<>'kjj'"
'按查詢界面各輸入框生成多條件where選項(xiàng)
if not code="" then
strSQLWhere=strSQLWhere+" and 用戶編碼 like '"+strQueryType+code+strQueryType+"'"
end if
if not name="" then
strSQLWhere=strSQLWhere+" and 用戶姓名 like '"+strQueryType+name+strQueryType+"'"
end if
if not TopDepartType="" then
strSQLWhere=strSQLWhere+" and 主管部門類別 like '"+strQueryType+TopDepartType+strQueryType+"'"
end if
strSQL=strSQL+StrSQLWhere
case else '各頁間轉(zhuǎn)換
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 '頁數(shù)
dim thispagerecords '當(dāng)前頁記錄條數(shù)
dim recordcode '記錄序號
dim curpage '當(dāng)前頁碼
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 '轉(zhuǎn)換成整數(shù)格式時(shí)必須的,大量實(shí)驗(yàn)已經(jīng)證明
end if
%>
<% if not Request.QueryString("strsql")="" then %>
<form name=ConList method="post" action="TopDepart_EditList.asp?muldel=muldel&strsql=<%=server.URLEncode(strsql)%>&page=<%=curpage%>">
<% else %>
<form name=ConList method="post" action="TopDepart_EditList.asp">
<%
end if
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="457"><img src="images/title_TopDepart.gif" width="227" height="38"></td>
<td width="50">
<div align="center"><a href="TopDepart_Query.asp?query=query"><img src="../public/images/query.gif" width="24" height="18" border="0"><br>
</a> <font color="#003399">查詢</font></div>
</td>
<td width="50">
<div align="center"><a href="TopDepart_edit.asp?strsql=<%=server.URLEncode (strsql)%>&page=<% =curpage%>"><img src="../public/images/new.gif" width="19" height="23" border="0"></a><br>
<font color="#003399">新增</font> </div>
</td>
<td width="50">
<div align="center"><a href="vbscript:msgzh()"><img src="../public/images/del.gif" width="23" height="20" border="0"></a><br>
<font color="#003399">刪除</font> </div>
</td>
<td width="50">
<div align="center"><a href="#"><img src="../public/images/print.gif" width="23" height="20" border="0"></a><br>
<font color="#003399">打印</font></div>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0" bordercolor="#0099FF" align="center" bgcolor="#006699">
<tr bordercolor="#0099FF">
<td width="41" height="26" bgcolor="#6699CC">
<div align="center"><a href="#">
<input type="checkbox" name="SelAll" onclick ="SelAll_onclick()"value="checkbox">
</a></div>
</td>
<td width="62" height="26" align="center" bgcolor="#6699CC">
<div align="center"><font color="#FFFFFF">序號</font></div>
</td>
<td width="112" height="26" bgcolor="#6699CC">
<div align="center"><font color="#FFFFFF">主管部門編碼</font></div>
</td>
<td width="218" height="26" bgcolor="#6699CC">
<div align="center"><font color="#FFFFFF">主管部門名稱</font></div>
</td>
<td width="168" height="26" bgcolor="#6699CC" align="center"><font color="#FFFFFF">主管部門類別</font></td>
<td width="76" height="26" bgcolor="#6699CC">
<div align="center"><font color="#FFFFFF">修改</font></div>
</td>
<td width="78" height="26" bgcolor="#6699CC">
<div align="center"><font color="#FFFFFF">刪除</font></div>
</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 bgcolor="#FFFFFF">
<td colspan="7"> 對不起,沒有符合要求的記錄! </td>
</tr>
.
<%
Response.End
end if
for i=1 to thispagerecords
recordcode=recordcode+1
%>
<tr bgcolor="#FFFFFF">
<td width="41" height="26">
<div align="center">
<input type="checkbox" name="checkCon"onclick="checkCon_onclick()" value=<% =objres.Fields("用戶編碼").Value %>>
</div>
</td>
<td width="62" align="center" height="26">
<% =recordcode%>
</td>
<td width="112" height="26">
<% = objres.Fields("用戶編碼").Value %>
</td>
<td width="218" height="26">
<% = objres.Fields("用戶姓名").Value %>
</td>
<td width="168" height="26">
<% = objres.Fields("主管部門類別").Value %>
</td>
<td width="76" height="26">
<div align="center"><a href="TopDepart_edit.asp?code=<% = objres.Fields("用戶編碼").Value %>&name=<% =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 width="78" height="26">
<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 bgcolor="#6699CC">
<td colspan="7" height="20">
<div align="right">
<%
if curpage>1 then Response.Write ("<a href="+"TopDepart_EditList.asp?page=1"+"&strsql="+server.URLEncode(strsql)+"> 首頁</a>"+" | ") else Response.Write "首頁 | "
if recordcode>pagesize then Response.Write ("<a href="+"TopDepart_EditList.asp?page="+cstr(curpage-1)+"&strsql="+server.URLEncode(strsql)+"> 上一頁</a>"+" | ") else Response.Write "上一頁 | "
if recordcode<objres.RecordCount then Response.Write ("<a href="+"TopDepart_EditList.asp?page="+cstr(curpage+1)+"&strsql="+server.URLEncode(strsql)+"> 下一頁</a>"+" | ") else Response.Write "下一頁 | "
if recordcode<objres.RecordCount then Response.Write ("<a href="+"TopDepart_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>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -