📄 diary_function.asp
字号:
<%
'================得到用户管理的部门名称====================
function InspectUserTime(UserTrueName,TimeCondition)
sql=" SELECT n_ID, d_Time, v_Weather, t_DiaryContent, v_UserTrueName, v_State, "&_
" v_DepartmentName, i_DiaryYear, i_DiaryWeek, v_WorkAddress, isnull(m_fee,0) as m_fee "&_
" FROM hxdf_diary_content "& TimeCondition
sql=sql& " and v_UserTrueName like '"& UserTrueName &"'"
sql=sql& " ORDER BY d_Time "
dim rs
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
temp=rs.GetRows
else
temp=null
end if
rs.close: set rs=nothing
InspectUserTime=temp
end function
'=====================得到年周的不重复数组
function YearWeek()
sql=" SELECT DISTINCT i_DiaryYear, i_DiaryWeek "&_
" FROM hxdf_diary_content "&_
" ORDER BY i_DiaryYear DESC, i_DiaryWeek DESC "
dim rs
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof then
temp=null
else
temp=rs.GetRows
end if
rs.close: set rs=nothing
YearWeek=temp
end function
'======================年的选项内容
sub YearContent(DateArray)
for i=0 to ubound(DateArray,2)
if temp<>DateArray(0,i) then
response.Write("<option value='"& DateArray(0,i) &"'>")
response.Write(DateArray(0,i)&"年度")
response.Write("</option>")
temp=DateArray(0,i)
end if
next
end sub
'======================周的选项内容
sub WeekContent(DateArray)
temp=DateArray(0,0)
for i=0 to ubound(DateArray,2)
if temp=DateArray(0,i) then
response.Write("<option value='"& DateArray(1,i) &"'>")
response.Write(DateArray(1,i))
response.Write("</option>")
end if
next
end sub
'======================得到年与周的对应数组
sub MakeYearWeek(DateArray)
m=0
n=0
temp=DateArray(0,0)
for i= 0 to ubound(DateArray,2)
if temp=DateArray(0,i) then
response.Write("group["& m &"]["& n &"]=new Option("" 第 "& DateArray(1,i) &" 周"","""& DateArray(1,i) &"""); ")
n=n+1
else
m=m+1
n=0
response.Write("group["& m &"]["& n &"]=new Option("" 第 "& DateArray(1,i) &" 周"","""& DateArray(1,i) &"""); ")
n=n+1
temp=DateArray(0,i)
end if
next
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -