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

📄 main.asp

📁 OFFICE办公自动化
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
'功能:处理提交用户信息
'参数:SelectID  用户ID  Department 用户所属部门ID
'作者:董力勤
'日期: 2003-11-29 15:18
%>

<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/const.asp"-->
<!--#include file="../inc/md5.asp"-->

<html>
<head>
<link rel="stylesheet" type="text/css" href="../CSS/main.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户帐号注册</title>
</head>
<body topmargin="10" leftmargin="10">
<%
ID=request("SelectID")
if id="" then id=0

'获取数据
dim strLoginName, strPwd, strConfirmPwd, strName, strInfo, strSelfBody, sPhoto
dim sex,department,strOfficeTel,strhometel,strpager,strMobiletel,strpostcode,stremail,straddress,strfax
if ID="0" then
	if request("cmdAdd")<>"" then
		strLoginName=replace(trim(request("LoginName")),"'","''")
		strPwd=replace(trim(request("Pwd")),"'","''")
		strConfirmPwd=replace(trim(request("ConfirmPwd")),"'","''")
		strName=replace(trim(Request("Name")),"'","''")
		strInfo=replace(trim(Request("Info")),"'","''")
		Sex=trim(Request("sex"))
		Department=trim(Request.form("Departmentkl"))
		if Department="" then Department=0
		strOfficeTel=replace(trim(Request("Officetel")),"'","''")
		strHomeTel=cRequest("HomeTel")
		strPager=cRequest("Pager")
		strMobiletel=cRequest("Mobiletel")
		strPostCode=cRequest("PostCode")
		strEmail=cRequest("Email")
		strAddress=trim(cRequest("Address"))
		strFax=trim(cRequest("Fax"))
		strSelfBody=trim(cRequest("Selfbody"))
		if strPwd="" or strPwd<>strConfirmPwd then
			response.write "口令为空或确认口令和原口令不一致!<a href=""javascript:history.back(-1);"">[返回]</a>"
			response.end
		end if

		if strLoginName<>"" and strName<>"" and (not CheckUser(strLoginName)) then
			AddUser
			set rs_id=Server.CreateObject("ADODB.RECORDSET")
			rs_id.Open "SELECT MAX(id) AS id FROM tbioaUser",oConn
			response.write "<script>opener.location.reload();</script>添加成功! <a href='#' onclick=""javascript:window.close();"">[关闭]</a> <a href=""main.asp?SelectID="&rs_id("id")&"&Department="&Department&""">[上传照片]</a>"
			rs_id.close
			response.end
		else
			strAlertInfo="用户名可能有重复,请重新输入。"
		end if
	end if
else
	if request("cmdUpdate")<>"" then
		strLoginName=replace(trim(request("LoginName")),"'","''")
		strPwd=replace(trim(request("Pwd")),"'","''")
		strConfirmPwd=replace(trim(request("ConfirmPwd")),"'","''")
		strName=replace(trim(Request("Name")),"'","''")
		strInfo=replace(trim(Request("Info")),"'","''")
		Sex=trim(Request("sex"))
		Department=trim(Request("Departmentkl"))
		if Department="" then Department=0
		strOfficeTel=trim(cRequest("Officetel"))
		strHomeTel=trim(cRequest("HomeTel"))
		strPager=trim(cRequest("Pager"))
		strMobiletel=trim(cRequest("Mobiletel"))
		strPostCode=trim(cRequest("PostCode"))
		strEmail=trim(cRequest("Email"))
		strAddress=trim(cRequest("Address"))
		strFax=trim(cRequest("Fax"))
		strSelfBody=trim(cRequest("Selfbody"))
		if lcase(strLoginName)="administrator" and lcase(Session("LoginName"))<>"administrator" then
			response.write "<script> alert('你不能修改系统管理员的资料!'); javascript:history.back()</script>"
			response.end
		end if

		if strPwd="" or strPwd<>strConfirmPwd then
			if not CheckUpdateUser (ID,strLoginName) then
				UpdateUser2 (ID)
				response.write "<script>opener.location.reload();</script>资料修改成功,但您没有输入口令,所以保留了原口令。 <a href='#' onclick=""javascript:window.close();"">[关闭]</a>"
				oConn.close
				response.end
			else
				strAlertInfo="用户名可能有重复,请重新输入。"
			end if

		else

			if strLoginName<>"" and strName<>"" and (not CheckUpdateUser (ID,strLoginName)) then
				UpdateUser (ID)
				response.write "<script>opener.location.reload();</script>数据修改成功! <a href='#' onclick=""javascript:window.close();"">[关闭]</a>"
				oConn.close
				response.end
			else
				strAlertInfo="用户名可能有重复,请重新输入。"
			end if
		end if
	end if

	GetSelectUserData (ID)
end if
if isnumeric(request.querystring("Department")) and request.querystring("Department")<>"" then Department=request.querystring("Department")
%>

<%if strAlertInfo<>"" then response.write "<script language=""Javascript"">alert("""&strAlertInfo&""")</script>"%>
<form NAME="Rightfrm" method="post">
 <table width="550" cellspacing="1" cellpadding="2" class="tab" align="center">
  <tr>
    <td width="100%" class="tdTop2">
      <table border="0" width="100%" cellspacing="0" cellpadding="0">
        <tr>
          <td class="tdTop2">
            <img border="0" src="../images/icon_title.gif" align="left">注册员工信息
          </td>
          <td width="60" class="tdTop2">
            <img border="0" src="../images/icon_return.gif" align="left">
            <a href="javascript:window.close()" class="linkTop">关闭</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td width="100%" class="td1">
      <% if word<>"" then %>
      <script>opener.location.reload();</script>
      <table border="0" width="100%" cellspacing="10" cellpadding="0">
        <tr>
          <td width="36%">
            <p align="right"><img border="0" src="../images/edit.gif" width="32" height="32">
          </td>
          <td width="64%"><p> </p>
            <%=word%>
          </td>
        </tr>
        <tr>
          <td width="100%" colspan="2">
          </td>
        </tr>
      </table>
      <% else %>
      <table border="0" cellspacing="1" cellpadding=3 width="100%">
	<tr>
          <td height="30" width="129" valign="middle" align=right><b>登录名</b><font COLOR="RED">*</font></td>
          <td height="30" valign="middle">
            <input class="input" TYPE="text"  SIZE="17" Name="LoginName" maxlength="25" <%if ID<>"0" and ID<>"0" then response.write "  value='"&strLoginName&"'"%> <%if lcase(strLoginName)="administrator" then response.write " readonly"%>>
          </td>
          <td height="30" rowspan="5" valign="middle" align="center">
            <%if sPhoto<>"" then%>
            <img src="../Photo/<%=sPhoto%>" border=1 width="130">
	            <input type="button" value="更改照片" class="button0" onmouseout=className="button0" onmouseover=className="button1" onclick="OpenWindow('PhotoUpfrm.asp?ID=<%=ID%>','PhotoWindow')">
	    <%else%>
	    	<%if ID<>"0" then%>
	            <input type="button" value="上传照片" class="button0" onmouseout=className="button0" onmouseover=className="button1" onclick="OpenWindow('PhotoUpfrm.asp?ID=<%=ID%>','PhotoWindow')">
            	<%end if%>
            <%end if%>
          </td>
        </tr>
        <tr>
          <td valign="middle" align=right width="129"><b>登录口令</b><font COLOR="RED">*</font></td>
          <td valign="middle">
            <input TYPE="password"  SIZE="17" NAME="Pwd" maxlength="40" class="input">
          </td>
        </tr>
        <tr>
          <td valign="middle" align=right width="129"><b>检验口令</b><font COLOR="RED">*</font></td>
          <td valign="middle">
            <input TYPE="password"  SIZE="17" NAME="ConfirmPwd" maxlength="40" class="input">
          </td>
        </tr>
        <tr>
          <td valign="middle" align=right width="129"><b>姓名</b><font COLOR="RED">*</font></td>
          <td valign="middle">
            <input TYPE="text" class="input" SIZE="17" NAME="Name" maxlength="30" <%if ID<>"0" then response.write "  value='"&strName&"'"%>>
          </td>
        </tr>
        <tr>
          <td align=right width="129"><b>性别</b><font COLOR="RED">*</font></td>
          <td>
            <select name="sex">
              <option value=0 <%if Sex="0" then response.write " selected"%>>男
              <option value=1 <%if Sex="1" then response.write " selected"%>>女
            </select>
          </td>
        </tr>
        <tr>
          <td VALIGN="TOP" align=right width="129"><b>部门</b> <font COLOR="RED">*</font></td>
          <td colspan="2">
            <select name=departmentkl>
              <option value="0" selected>待分配...</option>
            </select>
          </td>
        </tr>
        <tr>
          <td VALIGN="TOP"  align=right width="129"><b>E-mail</b> </td>
          <td colspan="2">
            <input   TYPE="TEXT" SIZE="30" MAXLENGTH="30" NAME="Email" value="<%=strEmail%>" class="input">
          </td>
        </tr>

⌨️ 快捷键说明

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