📄 reportpersonal.asp
字号:
<%
'************************************************************************************************
' 文件名: reportpersonal.asp
' Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'
' 创建人 : 蔡晓燕
' 日 期 : 2002-06-19
' 修改历史 :
' ****年**月**日 ****** 修改内容:**************************************************
' 功能描述 : 个人工作汇报的查询和新增、维护,输入查询条件(指定汇报种类,时间),列出查询结果
' 版 本 :
'************************************************************************************************
option explicit
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>
<!-- #include file="../include/config.inc" -->
<!-- #include file="../include/common.inc" -->
<!-- #include file="../include/debug.inc" -->
<!-- #include file="../include/db.inc" -->
<!-- #include file="../include/emp.inc" -->
<!-- #include file="../include/date.inc" -->
<!-- #include file="../include/datahandle.inc" -->
<!-- #include file="../include/recordlist.inc" -->
<!-- #include file="../include/security.inc" -->
<!-- #include file="../common/commonpage.inc" -->
<!-- #include file="reportpersonal.inc" -->
<%
call CheckSecurity()
'********************************************************************************************************
' 服务器端代码
'-------------------------------------------------------------------------------------------------------------------'********************************************************************************************************
' 如果是提交,则调用函数Updatereport()更新数据库
if UCase(Request.ServerVariables("REQUEST_METHOD") = "POST") and (Request.Form("formAction") <> "quetype")then
Updatereport()
end if
'------------------------------
' 分页相关的变量定义
'-------------------------------------------------------------------------------------------------------------------------------------------------
Dim sSQL, sWhere, sOrderby
Dim sFileName : sFileName = "reportpersonal.asp"
Dim iEmpSerial : iEmpserial = GetEmpSerial
Dim iTotalRecords : iTotalRecords = 0 ' 分页
Dim iRecordsPerPage : iRecordsPerPage = 5
Dim iTotalPages : iTotalPages = 0
Dim iCols : iCols = 6
Dim iCurrentPage : iCurrentPage = GetParam("Page")
Dim iSort : iSort = GetParam("Sorting")
Dim iSorted : iSorted = GetParam("Sorted")
Dim sSortParams : sSortParams = ""
Dim sFormParams : sFormParams = ""
Dim sDirection : sDirection = ""
'------------------------------------------------------------------------------------------------------------------
' frmSearchreport表单提交的查询参数,汇报种类,年份,月份,季度,默认值为当年当月月度汇报表
' frmUpdatereport表单提交的个人工作汇报参数,汇报种类,年份,月份,季度, 工作完成情况,尚未完成的工作,如何打算,自我评价,备注
'------------------------------------------------------------------------------------------------------------------
Dim iSerial : iSerial = GetParam("serial")'在更新工作汇报的时候传过来的参数,指该汇报在T_report_Detail.Serial的值。
Dim iReportSerial : iReportSerial = GetParam("report_serial")'指该汇报对应的汇报表T_Report.Serial的值
Dim iType : iType = GetParam("type")
Dim iOf_year : iOf_year = GetParam("of_year")
Dim iOf_month : iOf_month = GetParam("of_month")
Dim iOf_season : iOf_season = GetParam("of_season")
Dim sFinished: sFinished = GetParam("finished")
Dim sUnfinished: sUnfinished = GetParam("unfinished")
Dim sProject: sProject = GetParam("project")
Dim sSelf_evaluation: sSelf_evaluation = GetParam("self_evaluation")
Dim sMemo: sMemo = GetParam("memo")
Dim sAction: sAction = GetParam("formAction")'包括quetype,addtype,updtype,deltype四种
'如果NOT IsEmpty(iReportSerial),那么iType,iOf_year,iOf_month,iOf_season的值由iReportSerial得到
if (not IsEmpty(iReportSerial)) then
sSQL = "select * from T_report where serial = "&iReportSerial
dim crs : set crs = New CRecordset
dim rs : set rs = crs.open(dbLocal,sSQL)
if not rs.EOF then
iType = crs.GetValue("type")
iOf_year = crs.GetValue("of_year")
iOf_month = crs.GetValue("of_month")
iOf_season = crs.GetValue("of_season")
end if
crs.Close()
end if
'以下代码确定缺省的查询参数
if IsEmpty(iType) then iType = 1
if IsEmpty(iOf_year) then iOf_year = year(date)
if IsEmpty(iOf_month) or Isnull(iOf_month) or (iOf_month = "") then iOf_month = month(date)
if IsEmpty(iOf_season) or Isnull(iOf_season) or (iOf_season = "") then iOf_season = 1
'response.write "iserial="&iserial&"ireportserial="& ireportserial &"itype="& _
'iType&"<br>"&"iof_year="&iof_year&"<br>"&"iof_month="&iof_month&"<br>"&"season="&iof_season
'response.end
sFormParams = "type=" & iType & "&of_year=" & iOf_year & "&of_month=" & iOf_month & "&of_season=" & iOf_season & "&"
'********************************************************************************************************
' 根据查询的汇报类型不同,构造分页的SQL语句
'********************************************************************************************************
select case iType
case 1'月度个人汇报查询
sSQL = "select * from T_Report_Detail where report_serial = (select serial from T_report where type = " &_
ToSQL(iType, "Number") & " and of_year = " & ToSQL(iOf_year, "Number") & " and of_month = " & ToSQL(iOf_month, "Number") & " and person = " & ToSQL(iEmpSerial, "Number") & " and scope = 1" & ")"
case 2'季度个人汇报查询
sSQL = "select * from T_Report_Detail where report_serial = (select serial from T_report where type = " &_
ToSQL(iType, "Number") & " and of_year = " & ToSQL(iOf_year, "Number") & " and of_season = " & ToSQL(iOf_season, "Number") & " and person = " & ToSQL(iEmpSerial, "Number") & " and scope = 1" & ")"
case 3'年度个人汇报查询
sSQL = "select * from T_Report_Detail where report_serial = (select serial from T_report where type = " &_
ToSQL(iType, "Number") & " and of_year = " & ToSQL(iOf_year, "Number") & " and person = " & ToSQL(iEmpSerial, "Number") & " and scope = 1" & ")"
end select
sOrderby = " order by T_report_Detail.serial"
'********************************************************************************************************
' 分页SQL语句构造完毕,调用PrepareListData进行分页前的准备
'-------------------------------------------------------------------------------------------------------------------------------------------------
dim arrayFields(4), sDelimiter
sDelimiter = "*"
arrayFields(0) = "finished"
arrayFields(1) = "unfinished"
arrayFields(2) = "project"
arrayFields(3) = "self_evaluation"
arrayFields(4) = "memo"
call PrepareListData(sSQL & sWhere & sOrderBy, Join(arrayFields, sDelimiter), sDelimiter)
'********************************************************************************************************
%>
<html>
<head>
<title>上海信息大楼 Shanghai Information Tower</title>
<meta http-equiv="finished-Type" finished="text/html; charset=gb2312">
<link rel="stylesheet" href="../common/common.css" type="text/css">
<script language="VBScript" src="../common/validate.vbs"></script>
<script language="VBScript" src="reporttypechange.vbs"></script>
<script language="VBScript">
Sub btnSearch_OnClick()
document.all.frmSearchReport.submit()
End Sub
Sub btnUpdate_OnClick()
dim sError
sError = ValidateText("document.all.frmUpdateReport.finished", "工作完成情况", true, 64)
if sError <> "" then
msgbox sError
exit sub
end if
sError = ValidateText("document.all.frmUpdateReport.unfinished", "尚未完成的工作", false, 64)
if sError <> "" then
msgbox sError
exit sub
end if
sError = ValidateText("document.all.frmUpdateReport.project", "如何打算", false, 64)
if sError <> "" then
msgbox sError
exit sub
end if
sError = ValidateText("document.all.frmUpdateReport.self_evaluation", "自我评价", false, 64)
if sError <> "" then
msgbox sError
exit sub
end if
sError = ValidateText("document.all.frmUpdateReport.memo", "备注", false, 64)
if sError <> "" then
msgbox sError
exit sub
end if
document.all.frmUpdateReport.formAction.value = "updtype"
document.all.frmUpdateReport.submit()
End Sub
Sub btnDelete_OnClick()
if DeleteConfirm("这条工作汇报") then
document.all.frmUpdateReport.formAction.value = "deltype"
document.all.frmUpdateReport.submit()
end if
End Sub
Sub btnAdd_OnClick()
dim sError
sError = ValidateText("document.all.frmUpdateReport.finished", "工作完成情况", true, 64)
if sError <> "" then
msgbox sError
exit sub
end if
sError = ValidateText("document.all.frmUpdateReport.unfinished", "尚未完成的工作", false, 64)
if sError <> "" then
msgbox sError
exit sub
end if
sError = ValidateText("document.all.frmUpdateReport.project", "如何打算", false, 64)
if sError <> "" then
msgbox sError
exit sub
end if
sError = ValidateText("document.all.frmUpdateReport.self_evaluation", "自我评价", false, 64)
if sError <> "" then
msgbox sError
exit sub
end if
sError = ValidateText("document.all.frmUpdateReport.memo", "备注", false, 64)
if sError <> "" then
msgbox sError
exit sub
end if
document.all.frmUpdateReport.formAction.value = "addtype"
document.all.frmUpdateReport.submit()
End Sub
Sub btnReset_OnClick()
document.all.frmUpdateReport.reset()
End Sub
Sub btnClear_OnClick()
document.all.frmUpdateReport.reset()
End Sub
Sub btnCancel_OnClick()
document.all.frmUpdateReport.formAction.value = "cancel"
document.all.frmUpdateReport.submit()
End Sub
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="../images/bg/bg0.jpg">
<br>
<%
Response.Write OuterTableHeader
Response.Write HeaderWithMenu
Response.Write InnerTableHeader
'********************************************************************************************************
' 主体从这里开始
'-------------------------------------------------------------------------------------------------------------------------------------------------
Response.Write TableSearch
select case iType
case 1
Response.Write MonthTableHeader
case 2
Response.Write SeasonTableHeader
case 3
Response.Write YearTableHeader
end select
Response.Write TableRecords(sSQL & sWhere & sOrderby, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams )
Response.Write FormUpdateReport
Response.Write TableLink()
'-------------------------------------------------------------------------------------------------------------------------------------------------
' 主体到这里结束
'********************************************************************************************************
Response.Write InnerTableTailer
Response.Write Footer
Response.Write OuterTableTailer
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -