mteacher.asp
来自「(1)管理员能够实现会员管理 (2)教师管理 (3)资料管理及资料显示等操作」· ASP 代码 · 共 243 行
ASP
243 行
<% Response.Buffer=True %>
<!--#include file="dbconn.inc"-->
<% dim key,w
key=trim(request("key"))
w=request("w")
%>
<% if request("del")<>"" then
conn.Execute("delete * from teacher where id="&request("del"))
end if %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<link rel="stylesheet" href="../inc/index.css" type="text/css">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>远程教育网—>管理页面</title>
</head>
<script language="JavaScript">
function windowOpen(loadpos)
{controlWindow=window.open(loadpos,"surveywin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=80,status=no,resizable=yes");
}
</script>
<script LANGUAGE="JavaScript">
<!--//
function check()
{
if (isNaN(go2to.page.value))
alert("请正确填写转到页数!");
else if (go2to.page.value=="")
{
alert("请输入转到页数!");
}
else
go2to.submit();
}
//-->
</script>
<script language="JavaScript" src="../inc/window.js"></script>
<body topmargin="0" leftmargin="0">
<table border="0" cellpadding="0" cellspacing="0" width="780" height="450">
<tr>
<td width="778" height="14" valign="top" colspan="3" bgcolor="#396BA5"></td>
</tr>
<tr>
<td valign="top" height="424" width="176" bgcolor="#E1E1E1">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="118" background="../images/stat-bg.GIF">
<tr>
<tr>
<td height="26">
<p align="center">
<a href="mnews.asp">
学习内容</a>
</td>
</tr>
<tr>
<td height="27">
<p align="center"><a href="mstudent.asp">管理学生</a>
</td>
</tr>
<tr>
<td height="27">
<p align="center"><a href="mteacher.asp">管理教师</a>
</td>
</tr>
<tr>
<td height="27">
<div align="center"><a href="exit.asp">退出登录</a></div>
</td>
</tr>
</table>
</center>
</div>
<p align="center">
</td>
<td valign="top" height="424" width="1" bgcolor="#396BA5">
</td>
<td valign="top" height="424" width="602">
<div align="center">
<% set rs=server.createobject("adodb.recordset")
if not isempty(request("page")) then
pagecount=cint(request("page"))
else
pagecount=1
end if
if key<>"" then
if w="tname" then
sql="select * from teacher where tname like '%"&key&"%' order by id desc"
else if w="trealname" then
sql="select * from teacher where trealname like '%"&key&"%' order by id desc"
else
sql="select * from teacher where address like '%"&key&"%' order by id desc"
end if
end if
else
sql="select * from teacher order by id desc"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write"<BR>"
response.write"=== 暂无记录 ==="
response.write"<BR><BR>"
response.write"[<a href='addkq.asp' target='_blank'><font color='#000060'>添加记录|NEWS</font></a>]"
response.end
end if
rs.pagesize=10
if pagecount>rs.pagecount or pagecount<=0 then
pagecount=1
end if
rs.AbsolutePage=pagecount %>
<table border="1" cellpadding="0" cellspacing="0" width="545" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<tr>
<td height="1" colspan="4" valign="bottom" width="541"><font color="#000000"> </font></td>
</tr>
<tr>
<% if rs.pagecount=1 then %>
<td width="541" height="6" colspan="4" valign="bottom">
<font color="#000000">共有[<font color="#ff0000"><%=rs.recordcount%></font>]条记录
以下是[<font color="red">1~<%=rs.recordcount%></font>]条</font></td>
</tr>
<tr>
<td width="541" height="7" colspan="4" valign="bottom"></td>
</tr>
<%else%>
<tr>
<td width="541" height="6" colspan="4" valign="bottom"><font color="#000000">
<% page_start=(pagecount-1)*rs.pagesize
if pagecount=1 then page_start=1
page_end=rs.pagesize*pagecount
if pagecount*rs.pagesize=>rs.recordcount then page_end=rs.recordcount end if%>
共有[<font color="#ff0000"><%=rs.recordcount%></font>]条记录
以下是[<font color="red"><%=page_start%>~<%=page_end%></font>]条</font></td>
</tr>
<tr>
<td width="541" height="6" colspan="4" valign="bottom">
<% response.write"<form name=go2to method=Post action='mkq.asp?key="+key+"'>"
response.write "<font color='#000064'>◆ </font>"
if pagecount=1 then
response.write "<font color='#000064'>首页 上一页</font> "
else
response.write "<a href=mnews.asp?page=1&key="+key+"><font color='0000BE'>首页</font></a> "
response.write "<a href=mnews.asp?page="+cstr(pagecount-1)+"&key="+key+"><font color='0000BE'>上一页</font></a> "
end if
if rs.PageCount-pagecount<1 then
response.write "<font color='#000064'>下一页 尾页</font>"
else
response.write "<a href=mnews.asp?page="+cstr(pagecount+1)+"&key="+key+"><font color='0000BE'>下一页</font></a> "
response.write "<a href=mnews.asp?page="+cstr(rs.PageCount)+"&key="+key+"><font color='0000BE'>尾页</font></a>"
end if
response.write "<font color='000064'> 页次:<font color=blue>"&pagecount&"</font>/"&rs.pagecount&"页</font>"
response.write "<font color='000064'> 转到第<input type='text' name='page' size=2 maxLength=3 style='font-size: 9pt; color:#00006A; position: relative; height: 18' value="&PageCount&">页</font> "
response.write "<input class=button type='button' value='确 定' onclick=check() style='font-family: 宋体; font-size: 9pt; color: #000073; position: relative; height: 19'>"
%>
</td>
</tr>
</form>
<%end if%>
<tr>
<td height="3" valign="top" colspan="5" bgcolor="#000000" width="541">
</td>
</tr>
<tr>
<td width="45" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center">ID</p>
</td>
<td width="159" height="18" bgcolor="#EBEEF3" valign="bottom"> 用户名</td>
<td width="120" height="18" bgcolor="#EBEEF3" valign="bottom"> 真实姓名</td>
<td height="18" bgcolor="#EBEEF3" valign="bottom" width="134"><p align="center">注册日期</p></td>
<td height="18" bgcolor="#EBEEF3" valign="bottom" width="77">
<p align="center">- 删除 -</td>
</tr>
<% do while not rs.eof %>
<tr>
<td width="45" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center"><%=rs("id")%></p>
</td>
<td width="159" height="18" bgcolor="#EBEEF3" valign="bottom"> <a href="javascript:openwin('xgteacher.asp?id=<%=rs("id")%>','top=20,left=360,width=500,height=410')"><%=rs("tname")%></a></td>
<td width="120" height="18" bgcolor="#EBEEF3" valign="bottom"> <%=rs("trealname")%></td>
<td width="134" height="18" bgcolor="#EBEEF3" valign="bottom"><p align="center">[<%=rs("tdate")%>]</p></td>
<td width="77" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center"><font color="#000046">[</font><a href="mstudent.asp?del=<%=rs("id")%>"><font color="#000046">删除</font></a><font color="#000046">]</font></td>
</tr>
<% i=i+1
rs.movenext
if i>=rs.PageSize then exit do
loop
rs.close
set rs=nothing
conn.close
set conn=nothing %>
<tr>
<td height="3" valign="top" colspan="5" bgcolor="#000000" width="541">
</td>
</tr>
<tr>
<td height="8" valign="bottom" colspan="5" width="541">
<p align="center"><br>
</td>
</tr>
</table>
<TABLE align=center width=650>
<TBODY>
<TR>
<FORM action=mteacher.asp method=get target=_blank>
<TD><IMG align=absMiddle src="../images/search.gif"> 搜索: <INPUT
class=input1 name="key" size=15> <INPUT CHECKED name=w type=radio value=tname>
帐号 <INPUT name=w type=radio value=trealname> 真实姓名 <INPUT name=w type=radio
value=address> 院系 <INPUT class=input2 type=submit value=" 搜 索 "> <INPUT class=input2 type=reset value=" 重 填 "> </TD></FORM></TR></TBODY></TABLE>
</div>
</td>
</tr>
<tr>
<td valign="top" height="12" width="780" bgcolor="#396BA5" colspan="3">
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?