?? admin_user.asp
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include file="connsf.asp" -->
<!--#include file="md5.inc" -->
<!--#include file="checkstr.asp" -->
<!--#include file="config.asp" -->
<%'檢驗用戶
user=checkstr(session("user"))
pass1=ucase(md5(session("pass")))
str="select 姓名,用戶類別 from user_teacher where 用戶名='"&user&"' and 密碼='"&pass1&"'"
set rs=conn.execute(str)
if rs.eof or rs("用戶類別")<>"管理員" then
response.redirect("user_login.asp")
else
user_name=rs("姓名")
user_class=rs("用戶類別")
end if
rs.close
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用戶管理</title>
<!--#include file="css.css" -->
<script LANGUAGE="javascript">
<!--
function formadd_onsubmit() {
var i, n;
if (document.formadd.in_user.value=="")
{
alert("對不起,請輸入用戶名!")
document.formadd.in_user.focus()
return false
}
else if (document.formadd.in_name.value=="")
{
alert("對不起,請輸入用戶姓名!")
document.formadd.in_name.focus()
return false
}
else if (document.formadd.in_pass1.value.length < 5)
{
alert("對不起,新密碼須不少于6位!")
document.formadd.in_pass1.focus()
return false
}
else if (document.formadd.in_pass1.value.length > 20)
{
alert("對不起,新密碼須不多于20位!")
document.formadd.new_pass1.focus()
return false
}
else if (document.formadd.in_pass1.value != document.formadd.in_pass2.value)
{
alert("對不起,二次密碼不一致!")
document.formadd.in_pass1.focus()
return false
}
}
//Function to open pop up window
function openWin(theURL,winName,features) {
window.open(theURL,winName,features);
}
//-->
</script>
<script LANGUAGE="javascript">
<!--
function formpass_onsubmit() {
var i, n;
if (document.formpass.new_pass1.value.length < 5)
{
alert("對不起,新密碼須不少于6位!")
document.formpass.new_pass1.focus()
return false
}
else if (document.formpass.new_pass1.value.length > 20)
{
alert("對不起,新密碼須不多于20位!")
document.formpass.new_pass1.focus()
return false
}
else if (document.formpass.new_pass1.value != document.formpass.new_pass2.value)
{
alert("對不起,二次密碼不一致!")
document.formpass.new_pass1.focus()
return false
}
}
//Function to open pop up window
function openWin(theURL,winName,features) {
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<%doing=Trim(Request.QueryString("doing"))
work=Trim(Request.QueryString("work"))
pageno=request("pageno")
edit_id=cint(Request.QueryString("edit_id"))%>
<%'增加新用戶
if work="insert" and user_class="管理員" then
in_user=Trim(Request.Form("in_user"))
in_user=checkstr(in_user)
in_name=Trim(Request.Form("in_name"))
in_name=checkstr(in_name)
str="select id from user_teacher where 用戶名='"&in_user&"' or 姓名='"&in_name&"'"
set rs=conn.execute(str)
if not rs.eof then
msg1="該用戶名或姓名已存在,請換之!"
else
in_pass=ucase(md5(Trim(Request.Form("in_pass1"))))
in_class=Trim(Request.Form("in_class"))
in_bumen=Request.Form("in_bumen")
in_zhiwu=Request.Form("in_zhiwu")
in_zhiwu=replace(in_zhiwu," ","")
if in_zhiwu="" then in_zhiwu="無職務"
in_zhiwu="|"&in_zhiwu&"|"
str="insert into user_teacher (部門,職務,用戶名,姓名,密碼,用戶類別) values ('"&in_bumen&"','"&in_zhiwu&"','"&in_user&"','"&in_name&"','"&in_pass&"','"&in_class&"')"
conn.execute(str)
end if
rs.close
end if
%>
<%'管理員刪除其他用戶
if work="dele_user" and user_class="管理員" then
response.write "<div align=center class=fontsize20><font color=#FF0000>免費版無此功能!</font></div>"
end if
%>
<%'管理員修改其它用戶密碼
if doing="edit_user" and work="doing" and user_class="管理員" then
response.write "<div align=center class=fontsize20><font color=#FF0000>免費版無此功能!</font></div>"
end if
%>
<%'管理員修改其它用戶資料
if doing="change_user" and work="doing" and user_class="管理員" then
response.write "<div align=center class=fontsize20><font color=#FF0000>免費版無此功能!</font></div>"
end if
%>
<body topmargin="1" oncontextmenu="return false">
<div align="center">
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tabletblg">
<tr>
<td><!--#include file="top.asp" --></td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td height="30" bgcolor="#6699FF">
<!--#include file="admin_menu.asp" -->
</td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td height="30" bgcolor="#6699FF" class="fontsize14"> <%=user_name%>,你好!你現在可以管理已有用戶和增加新用戶。</td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<%if doing="insert_user" then%>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td width="757" bgcolor="#6699FF">
<form name="formadd" LANGUAGE="javascript" onsubmit="return formadd_onsubmit()" method="post" action="admin_user.asp?doing=insert_user&work=insert">
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fontsize10"> </td>
</tr>
</table>
<table width="740" border="1" align="center" cellpadding="2" cellspacing="0" borderColorLight="#000000" borderColorDark="#ffffff" bgcolor="#99CCFF">
<tr bgcolor="#66CCFF">
<td height="30" colspan="2">
<div align="center"><a href="admin_user.asp?doing=list_user" class="fontsize14wu">已有用戶</a><span class="fontsize14wu"> </span><span class="fontsize14">增加用戶</span></div></td>
</tr>
<tr class="fontsize12wu">
<td width="32%" height="26"> <div align="center">用 戶 名:</div></td>
<td width="68%" height="26">
<input name="in_user" type="text" class="inputtext" id="in_user"></td>
</tr>
<tr class="fontsize12wu">
<td height="26"> <div align="center">用戶姓名:</div></td>
<td height="26">
<input name="in_name" type="text" class="inputtext" id="in_name"></td>
</tr>
<tr class="fontsize12wu">
<td height="26"><div align="center">用戶密碼:</div></td>
<td height="26">
<input name="in_pass1" type="password" class="inputtext" id="in_pass1"></td>
</tr>
<tr class="fontsize12wu">
<td height="26"><div align="center">驗證密碼:</div></td>
<td height="26">
<input name="in_pass2" type="password" class="inputtext" id="in_pass2"></td>
</tr>
<tr class="fontsize12wu">
<td height="26"><div align="center">所在部門:</div></td>
<td height="26">
<%str="select * from woa_bumeng"
set rs=conn.execute(str)
if not rs.eof then%>
<select name="in_bumen" class="inputbox" id="in_bumen">
<%do while not rs.eof%>
<option value="<%=rs("部門")%>"><%=rs("部門")%></option>
<%rs.movenext
loop%>
</select>
<%end if
rs.close%>
</td>
</tr>
<tr class="fontsize12wu">
<td height="26"><div align="center">擔任職務:</div></td>
<td height="26">
<table width="96%" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<%str="select * from woa_zhuwu"
set rs=conn.execute(str)
if not rs.eof then
m=0
do while not rs.eof%>
<td width="25%">
<input name="in_zhiwu" type="checkbox" id="in_zhiwu" value="<%=rs("職務")%>"><span class="fontsize12wu"><%=rs("職務")%></span></td>
<% rs.movenext
m=m+1
if m mod 4=0 then response.write "</tr><tr>"
loop
end if
rs.close%>
</tr>
</table></td>
</tr>
<tr class="fontsize12wu">
<td height="26"><div align="center">用戶類別:</div></td>
<td height="26">
<select name="in_class" class="inputbox" id="in_class">
<option value="一般用戶" selected>一般用戶</option>
<option value="管理員">管 理 員</option>
</select></td>
</tr>
<tr class="fontsize12wu">
<td height="30" colspan="2"><div align="center">
<input name="Submit" type="submit" class="inputbox" value="增加用戶">
<span class="fontsize14wu"> </span>
<input name="Submit2" type="reset" class="inputbox" value="重填信息">
</div></td>
</tr>
<%if msg1<>"" then%>
<tr bgcolor="#FF9999" class="fontsize12wu">
<td height="30" colspan="2"><div align="center" class="fontsize14"><strong><font color="#0000FF"><%=msg1%></font></strong></div></td>
</tr>
<%end if%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -