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

📄 addnewuser.asp

📁 办公自动化系统
💻 ASP
字号:
<%@ Language=VBScript %>
<!--#include file="conn.asp"-->
<%
'判断用户是否登录以及具有系统管理员身份
if isempty(Session("ID")) or Session("IsSystemManager")=false then
Response.Redirect "../index.asp"
end if
'连接系统数据库

set RSDepartments = conn.Execute("select  DepartmentName from Departments " _
              & "order by DepartmentName")
set EmployeeInformation = conn.Execute(" select * from UserInfo order by Name ")
'添加新用户
if not IsEmpty(Request.Form("Add")) then
TheLoginID=Request.Form("LoginID")
TheName=Request.Form("Name")
TheEmailAddress=Request.Form("EmailAddress")
ThePassword=Request.Form("Password")
TheDepartment=Request.Form("Department") 
ThePosition=Request.Form("Position") 
TheInternalPhone=Request.Form("InternalPhone")
TheHomePhone=Request.Form("HomePhone")
TheMobilePhone=Request.Form("MobilePhone")
TheQQ=Request.Form("QQ") 
TheHomeAddress=Request.Form("HomeAddress")
TheIsSystemManager=Request.Form("IsSystemManager")
TheBirthday=Request.Form("BirthdayYear") & "-" _
& Request.Form("BirthdayMonth") & "-" & Request.Form("BirthdayDay")
TheIsFinancialManager=Request.Form("IsFinancialManager")
  '对用户输入进行校验,合格则添加新用户信息
if len(ThePassword)=0 or len(TheName)=0 or len(TheLoginID)=0 then
TheMessage="登录名,姓名,密码不能为空,无法添加新用户"
else
conn.Execute  " insert into UserInfo (LoginID, Name, Password, EmailAddress, " _
                        & "Department, Position, Birthday, HomePhone, QQ, HomeAddress,"  _
                        & "InternalPhone, MobilePhone, IsSystemManager, IsFinancialManager) values ("  _
                        & "'" & TheLoginID &"', "  _
                        & "'" & TheName &"', "  _
                        & "'" & ThePassword &"', "  _
                        & "'" & TheEmailAddress &"', "  _
                        & "'" & TheDepartment &"', "  _
                        & "'" & ThePosition &"', "  _
                        & "'" & TheBirthday &"', "  _
                        & "'" & TheHomePhone &"', "  _
                        & "'" & TheQQ &"', "  _
                        & "'" & TheHomeAddress &"', "  _
                        & "'" & TheInternalPhone &"', "  _
						 & "'" & TheMobilePhone  &"', "  _
						   & "'" & theIsSystemManager  &"', "  _
                        & "'" & TheIsFinancialManager & "') "
TheMessage="新用户添加成功"                       
end if
else              
TheMessage = "请在下面添加新用户"              
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</HEAD>

<BODY BGCOLOR="">

<table width=800 border=0 bgcolor=#9966FF cellspacing=1 cellpadding=2 align=center>
<tr bgcolor=white><td height="63"    valign=center bgcolor="#9966FF" ><div align="center"><font color="#FFFFFF" size="4"><strong>企业办公自动化系统</strong></font></div></td>
</tr>
</table>
<table WIDTH=800  border=0 bgcolor=#9966FF cellspacing=1 cellpadding=2 align=center>
<tr bgcolor="#99CCFF"><td colspan=3>
<P ALIGN="CENTER"><font color="#9966FF">员工信息查询->系统管理员->增加新员工当前用户:
  <% response.write Session("Name") %>
</font>
</font></td></tr>
<tr bgcolor=white >
<td><a href="../html/home.asp"><font color="#9C65FF">返回主页</font></a></td>
<td  align=center> <font color="#9966FF" ><% response.write TheMessage %></FONT></td>
<td  align=right><a href="SystemManager.asp"><font color="#9C65FF">返回上页</font></a></td>
</tr>                            
</table> 
<FORM ACTION="AddNewUser.asp"  METHOD=POST>    
                         <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=1 bordercolor="#9999FF" WIDTH=800 align=center>   
                          <TR VALIGN="center" ALIGN="center">
             	          <TD WIDTH=30% bgcolor=#99CCFF><img src="../image/HomepagePicture1.jpg" width="250" height="188"></td>
	          <td>
	                  <br>
	                  <table width=100% BORDER=1 align=center CELLPADDING=0 CELLSPACING=1 bordercolor="#99CCFF">
	                  <tr><td width=30%><font color="#9966FF">登录名</font></td>
	                  <td width="70%"><INPUT TYPE="text" NAME="LoginID" VALUE="" SIZE=50 MAXLENGTH=50 ></td></tr>
	                  <tr><td width=30%><font color="#9933CC">姓名</font></td>
	                  <td><INPUT TYPE="text" NAME="Name" VALUE="" SIZE=50 MAXLENGTH=50 ></td></tr>
	                  <tr><td width=30%><font color="#9933FF">输入新密码</font></td>
	                  <td><INPUT TYPE="text" NAME="Password" VALUE=""  SIZE=50 MAXLENGTH=50 ></td></tr>
	                  <tr><td width=30%><font color="#9933FF">部门</font></td>
	                  <td>
	                        <div align="left">
	                          <SELECT NAME="Department" size=1 width=10 >
                                          <%
                                        Do Until RSDepartments.EOF
                                        %>	
	                                        <OPTION VALUE="<% Response.Write RSDepartments("DepartmentName") %>">
	                                        <% Response.Write RSDepartments("DepartmentName") %>
	                                 </OPTION>
                                          <%
	                        RSDepartments.Movenext
                                        loop
                                       %>		
	                            </SELECT>
	                          </div></td></tr>
	                  <tr><td width=30%><font color="#9966FF">职位</font></td>
	                  <td>
	                    <div align="left">
	                      <select name="Position" size=1>
	                        <option value="普通">普通</option>
	                        <option value="主管">主管</option>
	                        <option value="经理">经理</option>
	                        </select>
	                      </div></td></tr>
	                  <tr><td width=30%><font color="#9966FF">电子邮件地址</font></td>
	                  <td><INPUT TYPE="text" NAME="EmailAddress" VALUE=""  SIZE=50 MAXLENGTH=50 ></td></tr>
	                  <tr><td width=30%><font color="#9933FF">内部分机电话</font></td>
	                  <td><INPUT TYPE="text" NAME="InternalPhone" VALUE="" SIZE=50 MAXLENGTH=50 ></td></tr>
	                  <tr><td width=30%><font color="#9900FF">移动电话</font></td>
	                  <td><INPUT TYPE="text" NAME="MobilePhone" VALUE=""  SIZE=50 MAXLENGTH=50 ></td></tr>
	                  <tr><td width=30%><font color="#9966FF">家庭电话</font></td>
	                  <td><INPUT TYPE="text" NAME="HomePhone" VALUE=""  SIZE=50 MAXLENGTH=50 ></td></tr>
	                  <tr><td width=30%><font color="#9966FF">QQ号</font></td>
	                  <td><INPUT TYPE="text" NAME="QQ" VALUE=""  SIZE=50 MAXLENGTH=50 ></td></tr>
	                  <tr><td width=30%><font color="#9933FF">家庭住址</font></td>
	                  <td><INPUT TYPE="text" NAME="HomeAddress" VALUE=""  SIZE=50 MAXLENGTH=50 ></td></tr>
	                  <tr><td width=30%><font color="#9933FF">是否系统管理员</font></td>
	                  <td>
	                    <div align="left">
	                      <select name="IsSystemManager" size=1>
	                        <option value="0">否</option>
	                        <option value="1">是</option>
	                        </select>	                  
	                      </div></td></tr>
	                  <tr><td width=30%><font color="#9966FF">生日</font></td>
	                        <td>
  	                          <div align="left">
  <select name="BirthdayYear" size=1>
                  <%
  	                        YearCounter = 2000
  	                        Do until YearCounter <=1900
  	                        %>
                       <OPTION VALUE="<% Response.Write YearCounter %>">
                       <% Response.Write YearCounter %>
                       </OPTION>
                  <%
  	                        YearCounter = YearCounter-1
  	                        loop
  	                        %>
                  </select>
  <select name="BirthdayMonth" size=1>
                  <%
  	                        MonthCounter = 1
  	                        Do until MonthCounter >12
  	                        %>
                       <OPTION VALUE="<% Response.Write MonthCounter %>">
                       <% Response.Write MonthCounter %>
                       </OPTION>
                  <%
  	                        MonthCounter = MonthCounter+1
  	                        loop
  	                        %>
                  </select>
  <select name="BirthdayDay" size=1>
                  <%
  	                        DayCounter = 1
  	                        Do until DayCounter >31
  	                        %>
                       <OPTION VALUE="<% Response.Write DayCounter %>">
                       <% Response.Write DayCounter %>
                     </OPTION>
                  <%
  	                        DayCounter = DayCounter+1
  	                        loop
  	                        %>
                  </select>
  日 </div></td></tr>
	                  <tr><td width=30%><font color="#9966FF">是否财务管理员</font></td>
	                  <td>
	                  <select name="IsFinancialManager" size=1>
	                  <option value="0">否</option>	                  
	                  <option value="1">是</option>
	                  </select>	                  
	                  </td></tr>
                </table>
	                  <br>
                          </td>  
                          </TR>
  </table>
                          
                          <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=1 WIDTH=800 align=center>
                          <TR VALIGN="top" ALIGN="center">
	          <TD WIDTH=100% height="44" align=center valign="middle" >
	          <INPUT TYPE="submit" NAME="Add" VALUE="添加新用户信息"></TD>	
                          
                          </TR>
                          </table>    
                          
</form>
</body>
</html>                          

⌨️ 快捷键说明

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