?? employeeinformation.asp
字號(hào):
<%@ Language=VBScript %>
<!--#include file="../conn.asp"-->
<%
'判斷用戶是否登錄
if isempty(Session("ID")) then
Response.Redirect "../login.asp"
end if
'連接系統(tǒng)數(shù)據(jù)庫(kù)
'set conn = server.createobject ("adodb.connection")
'conn.open "ASPData", "sa", ""
'判斷用戶是否提交了表單
if not IsEmpty(Request.Form("Send")) then
'如果用戶希望查詢?nèi)繂T工信息
if Request.Form("SendTo") = "AllEmployeeInformation" then
Set RSEnquiryResult = conn.Execute("select * from UserInfo order by " & Request.Form("AllOrder"))
TheMessage = "全體員工信息按" & Request.Form("AllOrder") & "排序如下"
label=true
'如果用戶希望查詢某個(gè)部門(mén)員工信息
elseif Request.Form("SendTo") = "DepartmentEmployeeInformation" then
Set RSEnquiryResult = conn.Execute("select * from UserInfo where Department = '" _
& Request.Form("DepartmentName") &"' order by Position" )
TheMessage = Request.Form("DepartmentName") & "全部員工信息如下"
label=true
'如果用戶希望進(jìn)入修改個(gè)人信息頁(yè)面
elseif Request.Form("SendTo") = "ModifyPersonalInformation" then
Response.Redirect "ModifyPersonalInformation.asp"
'如果用戶希望進(jìn)入系統(tǒng)管理員頁(yè)面
elseif Request.Form("SendTo") = "SystemManager" then
if Session("IsSystemManager")=true then
Session("SystemOrder")=Request.Form("SystemOrder")
Response.Redirect "SystemManager.asp"
else
TheMessage=" 對(duì)不起,您不是系統(tǒng)管理員,沒(méi)有此項(xiàng)權(quán)限"
Label=false
end if
'如果用戶希望查詢某個(gè)員工信息
elseif Request.Form("SendTo") = "OneEmployeeInformation" then
Label=true
if Request.Form("CheckName")="FromList" then
Set RSEnquiryResult = conn.Execute("select * from UserInfo where Name = '" _
& Request.Form("RoleName") &"' " )
TheMessage ="查詢員工 '"&Request.Form("RoleName") & "' 信息結(jié)果如下"
else
Set RSEnquiryResult = conn.Execute("select * from UserInfo where Name = '" _
& Request.Form("TypeName") &"' " )
TheMessage ="查詢員工 '"&Request.Form("TypeName") & "' 信息結(jié)果如下"
end if
'如果用戶希望查詢部門(mén)主管信息
else
Set RSEnquiryResult = conn.Execute("select * from UserInfo where Position='主管'" )
TheMessage = "各部門(mén)主管信息如下"
label=true
end if
'如果用戶是第一次進(jìn)入頁(yè)面
else
TheMessage = "請(qǐng)?jiān)谙旅孢x擇員工信息管理選項(xiàng)"
end if
set RSDepartments = conn.Execute("select DepartmentName from Departments order by DepartmentName")
set RSRoles = conn.Execute("select Name from UserInfo order by Name")
%>
<html>
<head>
<title>員工信息管理系統(tǒng)</title>
</head>
<body>
<table width=800 border=0 bgcolor=#16A84D cellspacing=1 cellpadding=2 align=center>
<tr bgcolor=white><td valign=center ><img src="../ASPLogo3.jpg" width=796 height=100></td></tr></table>
<table width="800" border="0" bordercolor="#16A84D" align="center" cellpadding="0" cellspacing="0">
<tr><td height="13"><img src=".././image/banner2.jpg" width="800" height="12"></td></tr></table>
<br>
<table width=800 border=0 bgcolor=#16A84D cellspacing=1 cellpadding=2 align=center>
<tr><td colspan=3>
<font color=white>
<P ALIGN="CENTER">公司內(nèi)部辦公信息管理系統(tǒng)->員工信息管理系統(tǒng) [當(dāng)前用戶-<% response.write Session("Name") %>]
</font></td></tr>
<tr bgcolor=white >
<td><a href=".././html/home.asp"><font color="#10AD4D">返回內(nèi)網(wǎng)主頁(yè)</font></a></td>
<td align=center> <font color="#10AD4D" ><% response.write TheMessage %></FONT></td>
<td align=right><a href=".././html/home.asp"><font color="#10AD4D">返回上一級(jí)網(wǎng)頁(yè)</font></a></td>
</tr></table>
<table width="800" border="0" bordercolor="#16A84D" align="center" cellpadding="0" cellspacing="0">
<tr><td height="13"><img src=".././image/banner2.jpg" width="800" height="12"></td></tr></table>
<table width="800" border="0" bordercolor="#16A84D" align="center" cellpadding="3" cellspacing="0">
<tr><td><br>
<form action="./EmployeeInformation.asp" method=post>
<table cellpadding=1 cellspacing=2 border=1 bordercolor="#16A84D" width=800 align=center>
<tr valign="center" align="center">
<td width=35% bgcolor=#B6EBCA><img src="../image/employee1.jpg"></td>
<td>
<table cellpadding=1 cellspacing=1 border=1 align=center width=100%>
<tr>
<td width=35%><input type="radio" checked name="SendTo" value="AllEmployeeInformation" >
<font color="#16A84D">查詢所有員工信息</font></td>
<td>
<input type="radio" checked name="AllOrder" value="Name" >按姓名排序 
<input type="radio" name="AllOrder" value="Department" >按部門(mén)排序 
<input type="radio" name="AllOrder" value="Birthday" >按生日排序
</td></tr>
<tr><td width=30%>
<input type="radio" name="SendTo" value="DepartmentEmployeeInformation" >
<font color="#16A84D">查詢某部門(mén)員工信息</font></td>
<td>
<select name="DepartmentName" >
<%
Do Until RSDepartments.EOF
%>
<option value="<% Response.Write RSDepartments("DepartmentName") %>">
<% Response.Write RSDepartments("DepartmentName") %></option>
<%
RSDepartments.Movenext
loop
%>
</select></td></tr>
<tr><td>
<input type="radio" name="SendTo" value="OneEmployeeInformation" >
<font color="#16A84D">查詢某個(gè)員工信息</font>
</td><td>
<table width=100% border=1>
<tr><td>
<input type="radio" Checked name="CheckName" value="FromList" ><font color="#16A84D">從列表中選擇</font>
</td><td>
<select name="RoleName" >
<%
Do Until RSRoles.EOF
%>
<option value="<% Response.Write RSRoles("Name") %>"><% Response.Write RSRoles("Name") %></option>
<%
RSRoles.Movenext
loop
%>
</select>
</td></tr>
<tr><td>
<input type="radio" name="CheckName" value="Type" ><font color="#16A84D">從輸入的名字查詢</font>
</td>
<td>
<input type="text" Checked name="TypeName" value="" >
</td></tr></table>
</td></tr>
<tr><td width=30%><input type="radio" name="SendTo" value="DepartmentManager" >
<font color="#16A84D">查詢部門(mén)主管信息</font></td><td> </td></tr>
<tr><td width=30%><input type="radio" name="SendTo" value="ModifyPersonalInformation" >
<font color="#16A84D">修改關(guān)于我的信息</font></td><td> </td></tr>
<tr><td width=30%><input type="radio" name="SendTo" value="SystemManager" >
<font color="#16A84D">系統(tǒng)管理員選項(xiàng)</font></td>
<td><input type="radio" name=SystemOrder value="Name" checked >以姓名排序進(jìn)入 
<input type="radio" name=SystemOrder value="Department">以部門(mén)排序進(jìn)入 <br>
<input type="radio" name=SystemOrder value="Birthday">以生日排序進(jìn)入 
<input type="radio" name=SystemOrder value="Position">以職位排序進(jìn)入 
</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellpadding=0 cellspacing=0 BORDER=1 width=800 align=center>
<tr VALIGN="top" ALIGN="center"><td width=100% align=center >
<input type="submit" name="Send" value="進(jìn)入選項(xiàng)" style="border: 1px solid #34BB66; background-color: #B6EBCA; color: #34BB66">
</td></tr></table>
<br>
<%
if not IsEmpty(Request.Form("Send")) then
Response.Write "<table width=100% border=0 bgcolor=#16A84D "_
& "cellspacing=1 cellpadding=2 align=center>"
Response.Write "<tr><td><font color=white><P ALIGN=CENTER>" & TheMessage
Response.Write "</font></td></tr>"
'如果不輸出查詢結(jié)果
if Label=false then
Response.Write "</table>"
else
'如果要輸出查詢結(jié)果
Response.write "<tr bgcolor=white ><td align=center>"
Response.write "<table width=100% bgcolor=#16A84D " _
& "border=0 cellspacing=1 cellpadding=2 align=center>"
Response.write "<tr><td><font color=white>登錄名</font></td>"
Response.write "<td><font color=white>姓名</font></td>"
Response.write "<td><font color=white>電子郵件地址</font></td>"
Response.write "<td><font color=white>部門(mén)</font></td>"
Response.write "<td><font color=white>內(nèi)部分機(jī)</font></td>"
Response.write "<td><font color=white>移動(dòng)電話</font></td>"
Response.write "<td><font color=white>家庭電話</font></td>"
Response.write "<td><font color=white>QQ號(hào)</font></td>"
Response.write "<td><font color=white>生日</font></td></tr> "
if not IsEmpty(RSenquiryResult) then
do Until RSEnquiryResult.eof
Response.write "<tr bgcolor=white>"
Response.write "<td>"& RSEnquiryResult("LoginID") &"</td>"
Response.write "<td>" & RSEnquiryResult("Name") & "</td>"
Response.write "<td><a href=mailto:" & RSEnquiryResult("EmailAddress") & ">"
Response.write "<font face=arial>" & RSEnquiryResult("EmailAddress") _
& "</font></a></td>"
Response.write "<td>" & RSEnquiryResult("Department") & "</td>"
Response.write "<td>" & RSEnquiryResult("InternalPhone") & "</td>"
Response.write "<td>" & RSEnquiryResult("MobilePhone") & "</td>"
Response.write "<td>" & RSEnquiryResult("HomePhone") & "</td>"
Response.write "<td>" & RSEnquiryResult("QQ") & "</td>"
Response.write "<td>" & RSEnquiryResult("Birthday") & "</td></tr>"
RSEnquiryResult.Movenext
Loop
end if
Response.Write "</table></td></tr></table>"
end if
end if
%>
</td></tr></table>
</form> </body></html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -