📄 方案二 diary_inspect_view.asp
字号:
<%@ Language=VBScript %>
<!--#include file= "../dbase.asp"-->
<!--#include file= "../employee/employee_function.asp"-->
<%
'========================设置查看的用户范围
if request.Form("rank")="department" then
DRstr=replace(request.Form("DepartmentContent")," ","")
DRstr="'"&replace(DRstr,",","','")&"'"
EmployeeContentArray=DepartmentNameEmployee(DRstr)
'得到所选部门的员工信息,调用函数../employee/employee_function.asp
'c_UserID, v_UserTrueName, v_DepartmentName
if not isnull(EmployeeContentArray) then
for i=0 to ubound(EmployeeContentArray,2)
if EmployeeContent="" then
EmployeeContent=EmployeeContentArray(1,i)
else
EmployeeContent=EmployeeContent&","&EmployeeContentArray(1,i)
end if
next
EmployeeContent="'"& replace(EmployeeContent,"," , "','") &"'"
else
response.Redirect("../error/Error.asp?steps=-1&errInfo=<li>您所挑选的部门没有员工</li>")
response.End()
end if
elseif request.Form("rank")="employee" then
EmployeeContent=replace(request.Form("EmployeeContent")," ","")
EmployeeContent="'"&replace(EmployeeContent,",","','")&"'"
else
response.Redirect("../error/Error.asp?steps=-1&errInfo=<li>没有员工信息无法统计</li>")
response.End()
end if
EmployeeContion=" WHERE v_UserTrueName in ("& EmployeeContent &")"
'==========================设置查看的时间范围
if request.Form("TimeWay")="yearweek" then
'TimeCondition=" and i_DiaryYear="&cint(request.Form("YearContent"))&" , i_DiaryWeek = "&cint(request.Form("WeekContent"))
t=CDate(request.Form("YearContent")&"-1-1")
t1=weekday(t)
BeginDate=DateAdd("ww", cint(request.Form("WeekContent"))-1, DateAdd("d",1-t1,t))
EndDate=DateAdd("d", 6,BeginDate)
elseif request.Form("TimeWay")="timepart" then
BeginDate=cdate(request.Form("BeginDate"))
EndDate=CDate(request.Form("EndDate"))
if datediff("d",BeginDate ,EndDate) < 0 then
response.Redirect("../error/Error.asp?steps=-1&errInfo=<li>起始日期不能大于终止日期</li>")
response.End()
end if
else
response.Redirect("../error/Error.asp?steps=-1&errInfo=<li>没有日期信息无法汇总</li>")
response.End()
end if
TimeCondition=" and d_Time between '"& BeginDate &"' and '"& EndDate &"'"
sql="SELECT * FROM hxdf_diary_content "& EmployeeContion & TimeCondition
sql=sql& " ORDER BY v_DepartmentName, v_UserTrueName, d_Time"
response.Write sql
%>
<html>
<head>
<meta name="GENERATOR" Content="Microsoft Visual Studio.NET 7.0">
</head>
<body>
<%
if request("DiaryYear")<>"" then
SearchYear=request("DiaryYear")
else
SearchYear=DatePart("y",now())
end if
if request("DiaryWeek")<>"" then
SearchWeek=request("DiaryWeek")
else
SearchWeek=DatePart("ww",now())
end if
if request("WhoseDiary")<>"" then
ObjUser=request("WhoseDiary")
else
ObjUser=Session("UserTrueName")
end if
dim rs
set rs=server.CreateObject("adodb.recordset")
sql=" SELECT n_ID, d_Time, v_Weather, t_DiaryContent, v_UserTrueName, v_State, "&_
" v_DepartmentName, i_DiaryYear, i_DiaryWeek, v_WorkAddress "&_
" FROM hxdf_diary_content "&_
" WHERE i_DiaryWeek= "& SearchWeek &" and i_DiaryYear= "&SearchYear &_
" and v_UserTrueName like '"& ObjUser &"'"
rs.Open sql,conn,1,1
%>
<div align=center style=" FONT-SIZE: 12pt; FONT-FAMILY: 黑体, 宋体; TEXT-DECORATION: underline"><%=ObjUser&" 第 "&SearchWeek&" 周日志"%></div>
<table class="DotPad" align=center ID="Table1"><tr>
<%if rs.EOF then
response.Write ("<td>没有日志纪录</td>")
response.End()
else
do while not rs.EOF
response.Write("<td bgcolor='#e6f2a3' width='120px;' title='"&rs("d_Time")&"' align='center' nowrap>"& WeekDays(rs("d_Time"))&"</td>")
rs.MoveNext
loop%>
</tr><tr>
<%rs.MoveFirst
do while not rs.EOF
response.Write("<td valign='top' width='120px;' class='DotPad'>"& rs("t_DiaryContent")&"</td>")
rs.MoveNext
loop
end if
%></td>
</tr></table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -