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

📄 reportpersonal.inc

📁 物业管理和办公自动化系统
💻 INC
📖 第 1 页 / 共 2 页
字号:
' 日 期 : 2002-06-19
' 版 本 : 
'************************************************************************************************
Function SeasonTableHeader()
'-----------------------------------------------------------------------------
'季度工作汇报表的表头
'------------------------------------------------------------------------------
	Response.Write TableTitle(iOf_year & "年第" & iOf_season & "季度" &"的季度工作汇报表", 600, "", "#0040a0")
	SeasonTableHeader = _
		"<table cellspacing=0 cellpadding=0 width=600 align=center class=tablelist style=""table-layout:fixed"">" & _
		"<tr>" & _
		"<td class=tdHead width=50 align =center><img src=""../images/bg/ar-y.gif"" width=8 height=8>&nbsp;序号</td>" & _
		"<td class=tdHead width=180>&nbsp;" & TableHeaderField(sFileName, "finished", "本季度工作完成情况", sFormParams, iSort, iSorted) & "</td>" & _
		"<td class=tdHead width=160>&nbsp;" & TableHeaderField(sFileName, "unfinished", "未完成的工作及原因", sFormParams, iSort, iSorted) & "</td>" & _
		"<td class=tdHead width=80	>&nbsp;" & TableHeaderField(sFileName, "project", "如何打算", sFormParams, iSort, iSorted) & "</td>" & _
		"<td class=tdHead width=80 valign=middle >&nbsp;" & TableHeaderField(sFileName, "self_evaluation", "自我评价", sFormParams, iSort, iSorted) & "</td>" & _
		"<td class=tdHead width=50>&nbsp;" & TableHeaderField(sFileName, "memo", "备注", sFormParams, iSort, iSorted) & "</td>" & _
		"</tr>"		
End Function

'************************************************************************************************
' 函数名 : TableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, 
'			sFileName, sFormParams, sSortParams)
' 输 入 : 查询语句,栏目数量,每页记录条数,总记录条数,当前页码,总页数,文件名,查询表单参数,排序参数
' 输 出 : 一张工作计划表的内容部分
' 功能描述: 
' 调用模块: reportpersonal.asp
' 作 者 : 蔡晓燕
' 日 期 : 2002-06-19
' 版 本 : 
'************************************************************************************************
Function TableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
	dim sTemp	: sTemp = ""	' 临时字符串变量
	dim j					' 临时循环变量

	'------------------------------------
	' 分页所需的变量定义
	'------------------------------------
	Dim iCounter		: iCounter = 1
	Dim iPrevPage, iNextPage
	
	'------------------------------------
	' 获取数据库连接
	'------------------------------------
	dim crs	: set crs = New CRecordset
	dim rs	: set rs = crs.open(dbLocal,sSQL)
	dim sFinished, sUnfinished, sProject, sSelf_evaluation, sMemo, iSerial, ireportSerial
	dim iTemp : iTemp = 0
	
	' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
	if Not rs.EOF then
'		response.write iCurrentPage & "*" & iRecordsPerPage & "<br>" : response.end
		rs.Move (iCurrentPage - 1) * iRecordsPerPage
		iTemp = (iCurrentPage - 1) * iRecordsPerPage
	end if
	while not rs.EOF and iCounter <= iRecordsPerPage
		sFinished			= crs.GetValue("finished")
		sUnfinished 			= crs.GetValue("unfinished")
		sProject   		= crs.GetValue("project")
		sSelf_evaluation			= crs.GetValue("self_evaluation")
		sMemo				= crs.GetValue("memo")
		iSerial				= crs.GetValue("serial")
		ireportSerial			= crs.GetValue("report_serial")
		iTemp = iTemp + 1
		sTemp = sTemp & "<tr>" & _
				"<td class=tdlist align=center style=""cursor:hand""><a href=reportpersonal.asp?formaction=updtype&serial=" & iserial & "&report_serial=" & iReportSerial &"&page=" & iCurrentPage & "><img border=0 src=""../images/bg/ar-g.gif"" width=8 height=8>&nbsp;" & iTemp & "</td>" & _
				"<td class=tdlist nowrap title="""& ToHTML(sFinished) & """ >&nbsp;" & ToHTML(sFinished) & "&nbsp;</td>" & _
				"<td class=tdlist nowrap title="""& ToHTML(sUnfinished) & """ >&nbsp;" & ToHTML(sUnfinished) & "&nbsp;</td>" & _
				"<td class=tdlist nowrap title="""& ToHTML(sProject) & """ >&nbsp;" & ToHTML(sProject) & "</td>" & _
				"<td class=tdlist nowrap title="""& ToHTML(sSelf_evaluation) & """ >&nbsp;" & ToHTML(sSelf_evaluation)& "&nbsp;</td>" & _
				"<td class=tdlist nowrap title="""& ToHTML(sMemo) & """ >&nbsp;" & ToHTML(sMemo) & "&nbsp;</td>" & _	
				"</tr>"
		iCounter = iCounter + 1			
		rs.movenext
	wend
	crs.Close()

	' 填补空白行
	sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage)

	' 首页、前页、后页、尾页等分页信息
	sTemp = sTemp & "<tr><td class=tdlist colspan=" & iCols & " align=right>" & _
				Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & _
				"&nbsp;</td></tr>"
	TableRecords = sTemp
End Function

'************************************************************************************************
' 函数名 : UpdateReport()
' 输 入 : 
' 输 出 : 更新计划表的内容
' 功能描述: 用于新添、更新、删除、发布工作计划表
' 调用模块: reportpersonal.asp
' 作 者 : 蔡晓燕
' 日 期 : 2002-06-19
' 版 本 : 
'************************************************************************************************
Sub UpdateReport()
	dim sSQL, iSerial, iType, iOf_year, iOf_month, iOf_season, sAction, sError
	dim sFinished, sUnfinished, sProject, sSelf_evaluation, sMemo, iEmpserial, iPage
	iPage = GetParam("page")
	iType = GetParam("type")
	iOf_year = GetParam("of_year")
	iOf_month = GetParam("of_month")
	iOf_season = GetParam("of_season")
	sAction = GetParam("formAction")
	iSerial = GetParam("serial")
	sUnfinished = GetParam("unfinished")
	sFinished = GetParam("finished")
	sProject = GetParam("project")
	sSelf_evaluation = GetParam("self_evaluation")
	sMemo = GetParam("memo")
	iEmpSerial = GetEmpSerial

	sAction = LCase(sAction)
	select case sAction
	case "addtype"
		'---------------------------------------------------------------------------------
		'新添工作汇报
		'---------------------------------------------------------------------------------
		'先判断该类型的工作汇报表在T_report中是否已经存在,
		'如果存在,则取出serial值,然后在T_report_Detail中添加汇报内容,report_serial = serial
		'如果不存在,则先在T_report中添加一条新纪录,然后取该记录的serial,
		'在T_report_Detail中添加汇报内容,report_serial = serial
		'----------------------------------------------------------------------------------------------------------
		'********************************************************************************************************
		' 根据查询的汇报类型不同,构造分页的SQL语句
		'********************************************************************************************************
		select case iType 
		case 1'月度个人汇报查询
			iSerial = DLookUp(dbLocal, "T_report", "serial", "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'季度个人汇报查询
			iSerial = DLookUp(dbLocal, "T_report", "serial", "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'年度个人汇报查询
			iSerial = DLookUp(dbLocal, "T_report", "serial", "type = " & ToSQL(iType,"Number") &  "and of_year = " & ToSQL(iOf_year, "Number") & "and person = " & ToSQL(iEmpSerial, "Number") & "and scope = 1" )
		end select

		if iSerial = "" then'如果在T_report中没有找到相应的工作汇报表,则先加T_report,后加T_report_Detail
			select case iType
			case 1'添加月度工作汇报表
				sSQL = "insert into T_report(type, of_year, of_month, person, scope) " & _
				" values(" & ToSQL(iType,"Number") & ", " & ToSQL(iOf_year,"Number") & "," & ToSQL(iOf_month,"Number") & "," & ToSQL(iEmpSerial,"Number") & "," & 1 &")"
			case 2'添加季度工作汇报表
				sSQL = "insert into T_report(type, of_year, of_season, person, scope) " & _
				" values(" & ToSQL(iType,"Number") & ", " & ToSQL(iOf_year,"Number") & "," & ToSQL(iOf_season,"Number") & "," & ToSQL(iEmpSerial,"Number") & "," & 1 &")"
			case 3'添加年度工作汇报表
				sSQL = "insert into T_report(type, of_year, person, scope) " & _
				" values(" & ToSQL(iType,"Number") & ", " & ToSQL(iOf_year,"Number") & ","  & ToSQL(iEmpSerial,"Number") & "," & 1 &")"
			end select
'			response.write sSQL
'			response.end
			sError  = ExecuteSQL(dbLocal, sSQL)
			if sError <> "" then
				Response.Write "<script language=""javascript"">alert('对不起,新增汇报表失败!')</script>"
			else'如果T_report添加成功,再添加T_report_Detail
				dim crs, rs
				sSQL = "select max(serial) as m_serial from T_report "
				set crs = New CRecordset
				set rs = crs.open(dbLocal,sSQL)
				iSerial = crs.GetValue("m_serial")
				crs.Close()
				sSQL = "insert into T_report_Detail(report_serial, finished, unfinished, project, self_evaluation, memo)" & _
				"values("& ToSQL(iSerial,"Number") & "," & ToSQL(sFinished,"Text") & "," & _
				ToSQL(sUnfinished,"Text") & "," & ToSQL(sProject,"Text") & "," & ToSQL(sSelf_evaluation,"Text") & _
				"," & ToSQL(sMemo,"Text") & ")"  
				sError  = ExecuteSQL(dbLocal, sSQL)
				if sError <> "" then
					Response.Write "<script language=""javascript"">alert('对不起,新增工作汇报失败!')</script>"
				end if
			end if

		else'如果在T_report中已经存在相应的工作汇报表,则直接在T_report_Detail中添加汇报内容
			sSQL = "insert into T_report_Detail(report_serial, finished, unfinished, project, self_evaluation, memo)" & _
			"values("& ToSQL(iSerial,"Number") & "," & ToSQL(sFinished,"Text") & "," & _
			ToSQL(sUnfinished,"Text") & "," & ToSQL(sProject,"Text") & "," & ToSQL(sSelf_evaluation,"Text") & _
			"," & ToSQL(sMemo,"Text") & ")"  
			sError  = ExecuteSQL(dbLocal, sSQL)
			if sError <> "" then
				Response.Write "<script language=""javascript"">alert('对不起,新增工作汇报失败!')</script>"
			end if
		end if
	case "updtype"
	'-----------------------------------------------------------------------------------------------------
	'更新工作汇报
	'------------------------------------------------------------------------------------------------------
		sSQL = "update T_report_Detail" & _
		" set finished = " & ToSQL(sFinished, "Text") & ", unfinished = " & ToSQL(sUnfinished,"Text") & _
		" , project = " & ToSQL(sProject,"Text") & ", self_evaluation = "& ToSQL(sSelf_evaluation,"Text") & _
		", memo = "&ToSQL(sMemo,"Text") & " where serial = " & ToSQL(iSerial,"Number")
		sError  = ExecuteSQL(dbLocal, sSQL)
		if sError <> "" then
			Response.Write "<script language=""javascript"">alert('对不起,更新工作汇报失败!')</script>"
		end if
	case "deltype"
	'-----------------------------------------------------------------------------------------------------
	'删除工作汇报
	'------------------------------------------------------------------------------------------------------
		sSQL = "delete from T_report_Detail where serial = " & ToSQL(iSerial,"Number")
		sError  = ExecuteSQL(dbLocal, sSQL)
		if sError <> "" then
			Response.Write "<script language=""javascript"">alert('对不起,删除工作汇报失败!')</script>"
		end if
	case "cancel"
	'-----------------------------------------------------------------------
	'取消操作
	'--------------------------------------------------------------------------
		response.write "<script language=vbscript>window.navigate(""reportpersonal.asp?type="&_
		iType&"&of_year="&iOf_year&"&of_month="&iOf_month&"&of_season="&iOf_season&"&page="&iPage&"&"")</script>"
	end select
End Sub


'************************************************************************************************
' 函数名 : TableLink()
' 输 入 : 
' 输 出 : 显示提供相应的链接的表
' 功能描述: 
' 调用模块: reportpersonal.asp
' 作 者 : 蔡晓燕
' 日 期 : 2002-06-19
' 版 本 : 
'************************************************************************************************
Function TableLink()
	TableLink = _
		"<table width=600 cellspacing=0 cellpadding=0 border=0 align=center>" & _
		"<tr height=10>" & _ 
		"	<td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & _
		"</tr>" & _
		"<tr height=20>" & _
		"	<td width=600>&nbsp;" & _
		"		<img src=""../images/goto.gif"" width=11 height=11>&nbsp;<a href=""reportpersonal.asp?"&sFormParams&"page="&iCurrentPage&""">个人工作汇报登记</a>" & _
		"		&nbsp;&nbsp;&nbsp;" & _
		"</tr>" & _
		"</table>"
End Function
%>

⌨️ 快捷键说明

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