📄 adduser1.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file=data/conn.asp-->
<!--#include file=connfig.asp-->
<!--#include file=inc/yan.asp-->
<%
call case10
set rs2=server.CreateObject("adodb.recordset")
sql2="select * from users where id="&request("id")
rs2.open sql2,conn,1,1
if request("post")=1 then
if request("username")="" or request("userpwd")="" then
response.Write("<script language=JavaScript>" & "alert('用户名或者密码不能为空!');" & "history.back()" & "</script>")
else
if request("user")=0 then
call wr1
else
call wr2
end if
end if
end if
function wr1
if session("na")="" then
na=rs2("name")
else
na=session("na")
end if
username=trim(replace(request("username"),"'",""))
userpwd=trim(replace(request("userpwd"),"'",""))
for i=1 to len(username)
user=mid(username,i,1)
if user="'" or user="%" or user="<" or user=">" or user="&" or user="|" then
response.write "<script language=JavaScript>" & "alert('您的用户名含有非法字符,请重新输入!');" & "history.back()" & "</script>"
response.end
end if
next
for i=1 to len(userpwd)
pass=mid(userpwd,i,1)
if pass="'" or pass="%" or pass="<" or pass=">" or pass="&" or pass="|" then
response.write "<script language=JavaScript>" & "alert('您的密码含有非法字符,请重新输入!');" & "history.back()" & "</script>"
response.end
end if
next
set rs=server.CreateObject("adodb.recordset")
sql="select * from users where id="&session("id")
rs.open sql,conn,1,3
rs("username")=request("username")
rs("userpwd")=request("userpwd")
rs("shenhe")=request("shenhe")
rs("huiyi")=request("huiyi")
rs("gonggong")=request("gonggong")
rs("geren")=request("geren")
rs("huibao")=request("huibao")
rs("caigou")=request("caigou")
rs("kucun")=request("kucun")
rs("shangbao")=request("shangbao")
rs("caigoushen")=request("caigoushen")
rs("renshi")=request("renshi")
rs("name")=na
rs("chaoji")=0
rs.update
rs.close
response.Write("<script language=JavaScript>" & "alert('修改成功!');" & "history.back()" & "</script>")
end function
function wr2
if session("na")="" then
na=rs2("name")
else
na=session("na")
end if
username=trim(replace(request("username"),"'",""))
userpwd=trim(replace(request("userpwd"),"'",""))
for i=1 to len(username)
user=mid(username,i,1)
if user="'" or user="%" or user="<" or user=">" or user="&" or user="|" then
response.write "<script language=JavaScript>" & "alert('您的用户名含有非法字符,请重新输入!');" & "history.back()" & "</script>"
response.end
end if
next
for i=1 to len(userpwd)
pass=mid(userpwd,i,1)
if pass="'" or pass="%" or pass="<" or pass=">" or pass="&" or pass="|" then
response.write "<script language=JavaScript>" & "alert('您的密码含有非法字符,请重新输入!');" & "history.back()" & "</script>"
response.end
end if
next
set rs=server.CreateObject("adodb.recordset")
sql="select * from users where id="&session("id")
rs.open sql,conn,1,3
rs("username")=request("username")
rs("userpwd")=request("userpwd")
rs("name")=na
rs("chaoji")=1
rs.update
rs.close
response.Write("<script language=JavaScript>" & "alert('修改成功!');" & "history.back()" & "</script>")
end function
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
body {
background-color: #ffffff;
}
.style3 {color: #000000}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<form name="form1" method="post" action="">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<table width="610" border="0" align="center" cellspacing="1" bgcolor="#336699">
<tr>
<td width="110" height="34" background="images/tile_sub.gif"><div align="center" class="style3">用户名:</div></td>
<td width="199" background="images/tile_sub.gif"><div align="center" class="style3">
<input name="username" type="text" id="username" value="<%=rs2("username")%>" size="20" readonly="true">
<input name="post" type="hidden" id="post" value="1">
</div></td>
<td width="86" background="images/tile_sub.gif"><div align="center" class="style3">密 码:</div></td>
<td width="202" colspan="3" background="images/tile_sub.gif"><div align="center" class="style3">
<input name="userpwd" type="password" id="userpwd" value="<%=rs2("userpwd")%>" size="20">
</div></td>
</tr>
<tr>
<td rowspan="2" bgcolor="#FFFFFF"><div align="center">权 限:</div></td>
<td colspan="5" valign="middle" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0">
<tr>
<td width="9%" valign="top">
<select name="menu1" size="3" onChange="MM_jumpMenu('nei',this,0)">
<%
set rs3=server.CreateObject("adodb.recordset")
sql3="select * from renshi"
rs3.open sql3,conn,1,1
if not rs3.eof then
for i=1 to rs3.recordcount and not rs3.eof
if rs2("name")=rs3("name") then
%>
<option value=nei.asp?id=<%=rs3("id")%> selected><%=rs3("name")%></option>
<% Else %>
<option value=nei.asp?id=<%=rs3("id")%> ><%=rs3("name")%></option>
<%
end if
rs3.movenext
if rs3.eof then exit for
next
else
response.Write("<option value='没有用户'>没有用户</option>")
end if
%>
</select>
</td>
<td width="91%" height="50"><iframe src="nei.asp" width="400" height="52" name=nei scrolling="no" frameborder="no"></iframe></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="5" valign="middle" bgcolor="#FFFFFF"><%if rs2("chaoji")=1 then%>
<input name="user" type="radio" onClick="im1.style.display='block';" value="0">
<%else%>
<input name="user" type="radio" onClick="im1.style.display='block';" value="0" checked>
<%end if%>
普通用户
<%if rs2("chaoji")=1 then%>
<input type="radio" name="user" value="1" onClick="im1.style.display ='none';" checked>
<%else%>
<input type="radio" name="user" value="1" onClick="im1.style.display ='none';">
<%end if%>
超级用户
<table width="448" border="0" id="im1" style="display:none ">
<tr>
<td>
<% If rs2("shenhe")=1 Then %>
<input name="shenhe" type="checkbox" id="shenhe" value="1" checked>
<% Else %>
<input name="shenhe" type="checkbox" id="shenhe" value="1">
<% End If %>
批示功能</td>
<td>
<% If rs2("huiyi")=1 Then %>
<input name="huiyi" type="checkbox" id="huiyi" value="1" checked>
<% Else %>
<input name="huiyi" type="checkbox" id="huiyi" value="1">
<% End If %>
会议管理</td>
<td>
<% If rs2("gonggong")=1 Then %>
<input name="gonggong" type="checkbox" id="gonggong" value="1" checked>
<% Else %>
<input name="gonggong" type="checkbox" id="gonggong" value="1">
<% End If %>
公共信息管理 </td>
<td>
<% If rs2("geren")=1 Then %>
<input name="geren" type="checkbox" id="geren" value="1" checked>
<% Else %>
<input name="geren" type="checkbox" id="geren" value="1">
<% End If %>
审核个人登记活动 </td>
</tr>
<tr>
<td height="11">
<% If rs2("huibao")=1 Then %>
<input name="huibao" type="checkbox" id="huibao" value="1" checked>
<% Else %>
<input name="huibao" type="checkbox" id="huibao" value="1">
<% End If %>
汇总功能</td>
<td>
<% If rs2("caigou")=1 Then %>
<input name="caigou" type="checkbox" id="caigou" value="1" checked>
<% Else %>
<input name="caigou" type="checkbox" id="caigou" value="1">
<% End If %>
采购功能</td>
<td>
<% If rs2("kucun")=1 Then %>
<input name="kucun" type="checkbox" id="kucun" value="1" checked>
<% Else %>
<input name="kucun" type="checkbox" id="kucun" value="1">
<% End If %>
提报库存功能</td>
<td><% If rs2("shangbao")=1 Then %>
<input name="shangbao" type="checkbox" id="shangbao" value="1" checked>
<% Else %>
<input name="shangbao" type="checkbox" id="shangbao" value="1">
<% End If %>
下达/完成情况上报</td>
</tr>
<tr>
<td height="12" colspan="2"><% If rs2("caigoushen")=1 Then %>
<input name="caigoushen" type="checkbox" id="caigoushen" value="1" checked>
<% Else %>
<input name="caigoushen" type="checkbox" id="caigoushen" value="1">
<% End If %>
采购审核功能</td>
<td height="12" colspan="2"><% If rs2("renshi")=1 Then %>
<input name="renshi" type="checkbox" id="renshi" value="1" checked>
<% Else %>
<input name="renshi" type="checkbox" id="renshi" value="1">
<% End If %>
人事添加员工</td>
</tr>
</table></td>
</tr>
<tr bgcolor="#F3F3F3">
<td height="23" colspan="6"><div align="center">
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</div></td>
</tr>
</table>
<div align="center"></div>
</form>
</body>
</html>
<%session("id")=rs2("id")%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -