⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 master_pwd.asp

📁 本系统无论是现在还是将来的升级的版本均免费。学生综合测评分也叫综合分或者纪律分
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="const.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="img/Style.css" rel="stylesheet" type="text/css" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
-->
</style>
</head>
<body>

<%
action=Request("action")
id=Session("id")
if id="" then 
Response.Write("<li>登录超时,请重新登录</li>")
Response.End()
end if

if action="update" then

		id=Request("id")
		admin=safeChar(Request("admin"))
		adminpwd=md5(safeChar(Request("pwd")),32)
		truename=safeChar(Request("truename"))
		
		
		Dim rs
		Set rs = Server.CreateObject("ADODB.Recordset")
		rs.ActiveConnection = dbconn
		rs.Source = "SELECT id FROM admin where admin='"&admin&"' and id<>"&id&""
		rs.CursorType = 0
		rs.CursorLocation = 2
		rs.LockType = 1
		rs.Open()
		if  not rs.eof then 
    		Response.Write("<script language='javascript'>alert('帐号已被占用');history.go(-1);</script>")
			response.End()
		else 
			set c = Server.CreateObject("ADODB.Command")
			c.ActiveConnection = dbconn
			c.CommandText = "update admin set admin='"&admin&"',adminpwd='"&adminpwd&"',truename='"&truename&"' where id="&id&""
			c.CommandType = 1
			c.CommandTimeout = 0
			c.Prepared = true
			c.Execute()
			Response.Write("<script language='javascript'>alert('修改成功,新帐号:"&admin&"新密码:"&safeChar(Request("pwd"))&"');</script>")
			response.Write("<br /><br /><li>新帐号:"&admin&"</li><li>新密码:"&safeChar(Request("pwd"))&"")
        end if
		
		rs.Close()
		Set rs = Nothing

%>

<%else
 Dim rs1
		Set rs1 = Server.CreateObject("ADODB.Recordset")
		rs1.ActiveConnection = dbconn
		rs1.Source = "SELECT * FROM admin where  id="&id&""
		rs1.CursorType = 0
		rs1.CursorLocation = 2
		rs1.LockType = 1
		rs1.Open()
		if rs1.eof or rs1.bof then 
		response.Write("系统错误")
		response.End()
		end if

 %>
<script language="javascript">
function chk()
{
if(document.form.admin.value=="") 
{alert('帐号不能为空');return false;}
if(document.form.pwd.value=="") 
{alert('密码不能为空');return false;}
else 
return true;
}
</script>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<form name="form" action="" method="post" onsubmit="return chk()">
<table width="80%" border="0" align="center" cellpadding="1" cellspacing="0" class="atable1">
  <tr>
    <td colspan="6" bgcolor="#333"><span class="STYLE1">&nbsp;&nbsp;管理员资料修改</span></td>
  </tr>
  <tr>
    <td width="13%" height="30" class="tdmenu"><div align="center"></div></td>
    <td width="20%" class="tdmenu"><div align="center"></div></td>
    <td width="15%" class="tdmenu"><div align="center"></div></td>
    <td width="19%" class="tdmenu"><div align="center"></div></td>
    <td width="13%" class="tdmenu"><div align="center"></div></td>
    <td width="20%" class="tdmenu"><div align="center"></div></td>
  </tr>
  <tr>
    <td class="tdmenu"><div align="center">帐号:</div></td>
    <td class="tdmenu">
      <div align="left">
        <input name="admin" type="text" class="atable1" id="admin" value="<%=rs1(1)%>" size="20" maxlength="20"  />
      </div></td>
    <td class="tdmenu"><div align="center">&nbsp;密码:</div></td>
    <td class="tdmenu"><div align="center">
      <input name="pwd" type="text" class="atable1" id="pwd" size="14" maxlength="14" />
    </div></td>
    <td class="tdmenu"><div align="center">&nbsp;真实姓名:</div></td>
    <td class="tdmenu"><div align="center">
      <input name="truename" type="text" class="atable1" id="truename" value="<%=rs1(3)%>" size="10" maxlength="10" />
    </div></td>
  </tr>
  <tr>
    <td height="30" colspan="2" class="tdmenu">&nbsp;</td>
    <td height="30" class="tdmenu">&nbsp;</td>
    <td height="30" class="tdmenu">&nbsp;</td>
    <td class="tdmenu"><div align="center"><input name="提交" type="submit" class="tdmenu" id="提交" value="提交" />
    </div></td>
    <td class="tdmenu">
      <div align="left">
        <input name="重填" type="reset" class="tdmenu" id="重填" value="重填" />
        <input type="hidden" name="action" value="update" />
        <input name="id" type="hidden" id="id" value="<%=rs1(0)%>" />
      </div></td>
  </tr>
</table>
</form>
<%
rs1.close
set rs1=nothing
end if%>
</body>
</html>
<%dbconn.close%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -