📄 txl_index.asp
字号:
<!--#include file="conn.asp"-->
<%
'声明
'版权没有,随便修改,如需定制,QQ联系:182808000
dim password
password="admin" '后台管理密码
dim action
action=replacebadchar(request("action"))
if action="" then
call main()
call closeconn()
response.end
end if
if action="showuser" then
call showuser()
call closeconn()
response.end
end if
if action="login" then
call login()
call closeconn()
response.end
end if
if action="checklogin" then
call checklogin()
call closeconn()
response.end
end if
if session("login")=false then
session("errmsg")="错误.你还没有登陆"
call writeerrmsg()
response.end
end if
if action="adduser" then
call adduser()
call closeconn()
response.end
end if
if action="loginout" then
call loginout()
call closeconn()
response.end
end if
if action="mainlei" then
call mainlei()
call closeconn()
response.end
end if
if action="addlei" then
call addlei()
call closeconn()
response.end
end if
if action="dellei" then
call dellei()
call closeconn()
response.end
end if
if action="deluser" then
call deluser()
call closeconn()
response.end
end if
if action="saveadd" then
call saveadd()
call closeconn()
response.end
end if
'退出管理
sub loginout()
session("login")=false
response.redirect"txl_index.asp"
end sub
'保存添加用户函数
sub saveadd()
if trim(request("xingming"))="" or trim(request("danwei"))="" or trim(request("bumen"))="" or trim(request("dianhua"))="" or trim(request("email"))=""then
session("errmsg")="信息填写不完整"
call writeerrmsg()
exit sub
end if
dim sql,rs
sql="select * from bm_user"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("xingming")=replacebadchar(request("xingming"))
rs("danwei")=replacebadchar(request("danwei"))
rs("qq")=replacebadchar(request("qq"))
rs("bumen")=replacebadchar(request("bumen"))
rs("dianhua")=replacebadchar(request("dianhua"))
rs("email")=replacebadchar(request("email"))
rs("shouji")=replacebadchar(request("shouji"))
rs("fenji")=replacebadchar(request("fenji"))
rs("dizhi")=replacebadchar(request("dizhi"))
rs("chuanzhen")=replacebadchar(request("chuanzhen"))
rs("youzheng")=replacebadchar(request("youzheng"))
rs("beizhu")=replacebadchar(request("beizhu"))
rs.update
rs.close
set rs=nothing
response.redirect"txl_index.asp"
end sub
'删除用户函数
sub deluser()
if trim(request("userid"))<>"" then
conn.execute("delete from [bm_user] where id="&clng(request("userid"))&"")
end if
response.redirect"txl_index.asp"
end sub
'验证登陆
sub checklogin
if replacebadchar(request("password"))="" then
session("login")=false
response.redirect"txl_index.asp"
exit sub
end if
if password=replacebadchar(request("password")) then
session("login")=true
else
session("login")=false
end if
response.redirect"txl_index.asp"
end sub
'显示登陆窗口
sub login
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Admin_STYLE.CSS" rel="stylesheet" type="text/css">
<title>通讯录-管理登陆</title>
</head>
<div align=center>
<body class="bgcolor">
<table border="0" width="500" cellspacing="0" cellpadding="0" class="border">
<form action=?action=checklogin method=post>
<tr><td class=tgbg align=center><input type=password name=password><input type=submit value=登陆></td></tr>
</form>
</table>
</body></div></html>
<%
end sub
'删除分类函数
sub dellei()
conn.execute("delete from bm_lei where id="&clng(request("jplei"))&"")
session("href")="txl_index.asp?action=mainlei"
call writesuccessmsg("删除分类成功.")
end sub
'保存分类管理
sub addlei()
dim jplei,rs,sql
jplei=replacebadchar(request("jplei"))
if jplei="" then
sql="select * from bm_lei"
else
sql="select * from bm_lei where id="&clng(jplei)
end if
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if jplei="" then
rs.addnew
end if
rs("name")=trim(replacebadchar(request("name")))
rs.update
rs.close
set rs=nothing
session("href")="txl_index.asp?action=mainlei"
if jplei="" then
call writesuccessmsg("添加分类成功.")
else
call writesuccessmsg("修改分类成功.")
end if
end sub
'添加用户信息
sub adduser()
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Admin_STYLE.CSS" rel="stylesheet" type="text/css">
<title>通讯录-添加用户</title>
<script language='JavaScript' type='text/JavaScript'>
function IsDigit()
{
return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
</script>
</head>
<div align=center>
<body class="bgcolor">
<table border="0" width="500" cellspacing="0" cellpadding="0" class="border">
<form action=txl_index.asp?action=saveadd method=post>
<tr><td class="title" height="25" align="center"><b>通讯录</b>--<a href="txl_index.asp">返回</a>--<a href="txl_index.asp?action=mainlei">部门分类管理</a></td></tr>
<tr><td class="tdbg" height="25" align=center>
<table border="0" width="460" cellspacing="0" cellpadding="0">
<tr><td colspan="4"><hr></td></tr>
<tr>
<td class="tdbg" width="90">姓名:*</td>
<td class="tdbg" width="150"><input type=text name=xingming></td>
<td class="tdbg" width="90">QQ号:</td>
<td class="tdbg" width="150"><input type=text name=qq onKeyPress="event.returnValue=IsDigit();"></td>
</tr>
<tr>
<td class="tdbg" width="90">单位:*</td>
<td class="tdbg" width="150"><input type=text name=danwei></td>
<td class="tdbg" width="90">部门:*</td>
<td class="tdbg" width="150">
<select name=bumen size=1>
<%dim rs
set rs=conn.execute("select name from bm_lei order by id desc")
if not rs.eof then
do while not rs.eof
response.write"<option value="&rs(0)&">"&rs(0)&"</option>"
rs.movenext
loop
end if
rs.close
set rs=nothing%>
</select></td>
</tr>
<tr>
<td class="tdbg" width="90">单位电话:*</td>
<td class="tdbg" width="150"><input type=text name=dianhua onKeyPress="event.returnValue=IsDigit();"></td>
<td class="tdbg" width="90">手机:</td>
<td class="tdbg" width="150"><input type=text name=shouji onKeyPress="event.returnValue=IsDigit();"></td>
</tr>
<tr>
<td class="tdbg" width="90">电子邮件:*</td>
<td class="tdbg" width="150"><input type=text name=email></td>
<td class="tdbg" width="90">分机:</td>
<td class="tdbg" width="150"><input type=text name=fenji></td>
</tr>
<tr>
<td class="tdbg" width="90">邮政地址:</td>
<td class="tdbg" width="150"><input type=text name=dizhi></td>
<td class="tdbg" width="90">传真:</td>
<td class="tdbg" width="150"><input type=text name=chuanzhen onKeyPress="event.returnValue=IsDigit();"></td>
</tr>
<td class="tdbg" width="90">邮政编码:</td>
<td class="tdbg" colspan="3"><input type=text name=youzheng onKeyPress="event.returnValue=IsDigit();"></td>
</tr>
<tr>
<td class="tdbg" width="90" height="40">备注:</td>
<td class="tdbg" colspan="3"><textarea name=beizhu rows="4" cols="49"></textarea></td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr><td colspan="4" align=center><input type=submit value=添加></td></tr>
</table>
</td></tr>
</form>
</table>
</body></div></html>
<%
end sub
'显示用户详细信息
sub showuser
dim rs
if trim(request("userid"))="" then
session("errmsg")="没有这个用户"
call writeerrmsg()
exit sub
end if
set rs=conn.execute("select * from [bm_user] where id="&clng(request("userid"))&"")
if rs.eof then
response.write"没有这个用户"
exit sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -