📄 adminadd.asp
字号:
<%@language="vbscript" codepage="936"%>
<%response.buffer = true%>
<%
Public HOME_PATH:HOME_PATH = "../"
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
%>
<!--#include file="../db.asp"-->
<!--#include file="../inc/function.asp"-->
<%
Public title:title = "添加管理员"
if isLogin = false then
Response.Write viewinfo("LoginC","","")
Response.end
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><%=title%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<link href="<%=HOME_PATH%>css/style01.css" rel="stylesheet" type="text/css">
<script type = 'text/javascript' src = '<%=HOME_PATH%>js/layer00.js'></script>
<script type = 'text/javascript' src = '<%=HOME_PATH%>js/dateselect.js'></script>
<style>
html{min-width: 776px;}
fieldset {padding:3px;}
</style>
<script type = 'text/javascript'>
<!--
rv = Array("returnValue","parent.right") ;
window.returnValue = rv[1] ;
//-->
</script>
<base target = '_self'>
</head>
<body style = 'border-style:none;margin:0px;background-color:buttonface;'>
<div style = 'text-align:center;'>
<table border = '0' style = 'width:100%;height:95%;' cellspacing = '0' cellpadding = '3'>
<tr>
<form method='post' action="" name = 'form'>
<input name = 'Options' type = 'hidden'/>
<td style = 'width:100%;vertical-align:top;'><table border = '0' style = 'width:100%;' cellspacing = '0' cellpadding = '0'>
<tr>
<td style = 'text-align:center;'><fieldset>
<legend></legend>
<table border = '0' width = '98%' cellspacing = '0' cellpadding = '1'>
<tr>
<td style = 'width:55px;text-align:right;'>登陆帐号</td>
<td><table border = '0' width = '100%' cellspacing = '0' cellpadding = '0'>
<tr>
<td><input type="text" name="Loginid" style = 'width:100%;'/></td>
<td style = 'width:60px;text-align:right;'>登陆密码 </td>
<td><input type="password" name="LoginPassWord" style = 'width:100%;'/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td style = 'width:55px;text-align:right;'>姓 名</td>
<td><table border = '0' width = '100%' cellspacing = '0' cellpadding = '0'>
<tr>
<td><input type="text" name="TrueName" style = 'width:100%;'/></td>
<td style = 'width:60px;text-align:right;'>电脑编号 </td>
<td><input type="text" name="PcNum" style = 'width:100%;'/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td style = 'width:55px;text-align:right;'>职 位</td>
<td><table border = '0' width = '100%' cellspacing = '0' cellpadding = '0'>
<tr>
<td><input type="text" name="Place" style = 'width:100%;'/></td>
<td style = 'width:60px;text-align:right;'>入职时间 </td>
<td><input type="text" name="Regtime" style = 'width:100%;' onfocus="setday(this);"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td style = 'width:55px;text-align:right;'>序 号</td>
<td><input type="text" name="" style = 'width:55px;' value = '自动编号' readonly/> <%=now()%></td>
</tr>
</table>
</fieldset></td>
</tr>
<tr><td style = 'height:5px;line-height:5px;'> </td></tr>
<tr>
<td style = 'text-align:center;'><fieldset>
<legend></legend>
<table border = '0' width = '98%' cellspacing = '0' cellpadding = '1'>
<tr>
<td style = 'width:55px;text-align:right;'>联系电话</td>
<td><input type="text" name="Phone" style = 'width:100%;'/></td>
<td style = 'width:60px;text-align:right;'>E-mail </td>
<td><input type="text" name="Email" style = 'width:100%;'/></td>
</tr>
<tr>
<td style = 'width:55px;text-align:right;'>移动电话</td>
<td><input type="text" name="MobileTelephone" style = 'width:100%;'/></td>
<td style = 'text-align:right;'>个人网址 </td>
<td><input type="text" name="Website" style = 'width:100%;'/></td>
</tr>
<tr>
<td style = 'width:55px;text-align:right;'>地 址</td>
<td><input type="text" name="Address" style = 'width:100%;'/></td>
<td style = 'text-align:right;'>邮 编 </td>
<td><input type="text" name="Zip" style = 'width:100%;'/></td>
</tr>
</table>
</fieldset></td>
</tr>
<tr><td style = 'height:5px;line-height:5px;'> </td></tr>
<tr>
<td style = 'text-align:center;'><fieldset>
<legend></legend>
<table border = '0' width = '98%' cellspacing = '0' cellpadding = '1' style='table-layout:fixed; word-break:break-all;'>
<tr>
<td style = 'width:55px;text-align:right;'>身份证号</td>
<td style = 'width:125px;text-align:left;'><input type="text" name="IdCard" style = 'width:100%;'/></td>
<td style = 'width:40px;text-align:right;'>籍贯</td>
<td style = 'width:125px;text-align:left;'><input type="text" name="NativePlace" style = 'width:100%;'/></td>
<td style = 'width:40px;text-align:right;'>民族</td>
<td><input type="text" name="Folk" style = 'width:100%;'/></td>
</tr>
<tr>
<td style = 'text-align:right;'>出生年月</td>
<td><input type="text" name="Birthday" style = 'width:100%;'/></td>
<td style = 'text-align:right;'>婚否</td>
<td>
<table style = 'width:100%;' cellspacing = '0' cellpadding= '0' border = '0'>
<tr>
<td style = 'width:50px;'>
<select name = 'Marital' size = '1'>
<option value = '0'>已婚</option>
<option value = '1'>未婚</option>
<option value = '2'>保密</option>
</select></td>
<td style = 'text-align:right;width:40px;'>姓别 </td>
<td style = 'text-align:left;width:auto;'>
<select name = 'Sex' size = '1'>
<option value = '0'>女</option>
<option value = '1'>男</option>
<option value = '2'>密</option>
</select></td>
</tr>
</table></td>
<td style = 'text-align:right;'>学位</td>
<td><input type="text" name="PassDegree" style = 'width:100%;'/></td>
</tr>
<tr>
<td style = 'text-align:right;'>备 注</td>
<td colspan = '5'><textarea name="Remark" style = 'width:100%;height:50px;overflow-x:hidden;overflow-y:auto;'></textarea></td>
</tr>
<tr>
<td style = 'text-align:right;'>是否可用</td>
<td colspan = '5'>
<table border = '0' style = 'width:100%;' cellspacing = '0' cellpadding = '0'>
<tr>
<td style = 'width:60px;'>
<select style = 'width:50px;' name = 'disabled'>
<option value = '1'>可用</option>
<option value = '0'>禁用</option>
</select></td>
<td style = 'width:70px;text-align:left;'> 注册到部门</td>
<td style = 'text-align:left;width:auto;'>
<%SQL = "select * from admintype where ATypeSelect = 0"%>
<%Call admintypeSub(SQL,Radmintypeid,boxWidth,"ATypeSelect",ATypeALL)%>
</td>
</tr>
</table></td>
</tr>
</table>
</fieldset></td>
</tr>
<tr>
<td><input type="checkbox" name="repetition" value = 'YES' style = 'border-style:none;' checked = 'checked'/>检查注册名是否重复</td>
</tr>
</table></td>
</tr>
<tr>
<td style = 'text-align:center;'>
<input type="submit" value = ' 确定 ' onclick = "javascript:form.Options.value = 'Reg';if(replace_(form.Loginid.value,' ','')==''){alert('请输入登陆名!');form.Loginid.focus();return false;}else if(replace_(form.LoginPassWord.value,' ','')==''){alert('请输入登陆密码!');form.LoginPassWord.focus();return false;}else if(form.ATypeSelect.value==''){alert('请选择注册子部门!');document.form.ATypeSelect.focus();return false;}"/><input type="reset" value = ' 重置 '/><input type="button" value = ' 关闭 ' onclick = "javascript:window.close();"/>
</td>
</tr>
</form>
</table>
<%
Options = trim(Request.Form("Options"))
if Options = "Reg" then
Loginid = Replace(GetText("Loginid","P","Str",1,110,""),"'","")
BadStr = " [][`~!@#$%^&*()_-+=|\ <>/?'"""
viewBadStr = " [][`~!@#$%^&*()_-+=|\ 〈〉/?’”"
Loginid = Check(BadStr,Request.Form("Loginid"),"^","1")
LoginPassWord = Check(BadStr,Request.Form("LoginPassWord"),"^","1")'
if Loginid = "" or LoginPassWord = "" then
Response.Write viewinfo("alertBack","请输入登陆帐号和密码!","")
Response.end
end if
if inStr(Loginid,"^") > 0 or inStr(LoginPassWord,"^") then
Response.Write viewinfo("alertBack","登陆帐号和密码不要包含有(" & viewBadStr & ")等字符和空格!","")
Response.end
end if
Atypeid_ = GetText("ATypeSelect","P","number",1,10,0)'
Atypeid_ = SelectZD("select Atypeid from admintype where Atypeid = " & Atypeid_ & "",0)
if Atypeid_ = 0 then
Response.Write viewinfo("alertBack","请选好注册子部门!","")
Response.end
end if
if trim(Request.Form("repetition")) = "YES" then
if not Conn.Execute("select Loginid from admins where Loginid = '" & Loginid & "'").eof then
Response.Write viewinfo("alertBack","已经存在(" & Loginid & ")这个管理帐号了!请起另一个帐号","")
Response.end
end if
end if
SQL = "select * from admins where (aid is null)"
Rs.Open(SQL),Conn,1,3
Rs.addnew
Rs("Atypeid") = Atypeid_
Rs("Loginid") = htmlencode(Loginid,"Y")'登陆名
Rs("LoginPassWord") = htmlencode(LoginPassWord,"Y")'登陆密码
Rs("TrueName") = htmlencode(GetText("TrueName","P","Str",1,110,"none"),"Y")'真名
Rs("PcNum") = htmlencode(GetText("PcNum","P","Str",1,250,"none"),"Y")'电脑编号
Rs("Place") = htmlencode(GetText("Place","P","Str",1,250,"none"),"Y")'职位
Rs("Phone") = htmlencode(GetText("Phone","P","Str",1,250,"none"),"Y")'联系电话
Rs("MobileTelephone") = htmlencode(GetText("MobileTelephone","P","Str",1,250,"none"),"Y")'移动电话
Rs("Website") = htmlencode(GetText("Website","P","Str",1,250,"none"),"Y")'网址
Rs("Email") = htmlencode(GetText("Email","P","Str",1,250,"none"),"Y")'Email
Rs("Zip") = GetText("Zip","P","Str",1,250,"none")'邮编
Rs("IdCard") = htmlencode(GetText("IdCard","P","Str",1,250,"none"),"Y")'身份证
Rs("Birthday") = htmlencode(GetText("Birthday","P","Str",1,250,"none"),"Y")'生日
Rs("NativePlace") = htmlencode(GetText("NativePlace","P","Str",1,250,"none"),"Y")'籍贯
Rs("Folk") = htmlencode(GetText("Folk","P","Str",1,250,"none"),"Y")'民族
Rs("Sex") = htmlencode(GetText("Sex","P","number",1,10,2),"Y")'
Rs("Marital") = htmlencode(GetText("Marital","P","number",1,10,2),"Y")'婚姻否
Rs("PassDegree") = htmlencode(GetText("PassDegree","P","Str",1,250,"none"),"Y")'学位
Rs("Flag") = htmlencode(GetText("Flag","P","Str",1,250,"none"),"Y")'权限
Rs("Rank") = GetText("Rank","P","number",1,10,1000)'等级
Rs("Address") = htmlencode(GetText("Address","P","Str",1,250,"none"),"Y")'详细地址
Rs("disabled") = GetText("disabled","P","number",1,10,0)'是否可用
Rs("Regtime") = now
Rs("lasttime") = now
Rs("Remark") = htmlencode(GetText("Remark","P","Str",1,2000,"none"),"Y")'备注
Response.Write viewinfo("alertClose","管理员添加成功!",SELVAR("FN",""))
Rs.update
Rs.Close
end if
ConnClose()
%>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -