<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/plus_check.asp"-->
<!--#include file="Plus_ForumOffice_Const.Asp"-->

<%
XiaoLu.UserLeave()
Dim ErrCodes,Rs,SQL
Dim Page,MaxRows,Endpage,CountNum,i
	XiaoLu.PlusInfo()
	If XiaoLu.Setting(0) = 1 Then
			ErrCodes=ErrCodes + "<li>" + ""&XiaoLu.Setting(2)&""
			Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
	Else

		If (Dvbbs.UserGroupID=2 Or Dvbbs.UserGroupID=3) then
			Set Rs=Dvbbs.Plus_Execute("Select top 1 * from [Dv_LuZiOffice_User] where UserName='"&XiaoLu.UserName&"' order by UserId desc")

			If Rs.Eof Then
				ErrCodes=ErrCodes + "<li>" + "您的记录不存在，请与管理员联系"
				Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
			Else
				Call Main()
			End If
		ElseIf Cint(Dvbbs.UserGroupID)=1 then
			ErrCodes=ErrCodes + "<li>" + "您是管理员，无须考核，所以无法进入办公室大厅。"
			Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

		Else
			ErrCodes=ErrCodes + "<li>" + "这里不是你来的地方，一边凉快去...."
			Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
		End If
	End If
Sub Main()
	Dv_Plus.Name = "Plus_ForumOffice"
	Select Case request("Action")

		Case "Save_Const" '签到提交
			Save_Const()

		Case "MyModify"  '签名修改
			MyModify()

		Case "SignIn" '签到
			SignIn()

		Case "Finance" '日值
			Finance()

		Case "PayDoubt" '工资疑问
			PayDoubt()

		Case "PayDoubtSave" '工资疑问提交
			PayDoubtSave()

		Case "Payment"
			Payment()
		
		Case "OnLeave"
			OnLeave()

		Case "SignInLog"
			SignInLog()

		Case "Suggestion"
			Suggestion()

		Case "Resign"
			Resign()
		
		Case "Revert"
			Revert()

		Case "RevertSave"
			RevertSave()
		
		Case "LeaveSave"
			LeaveSave()

		Case "SignInAdmin"
			SignInAdmin()
		
		Case "SignIn_Save"
			SignIn_Save()

		Case "ResignSave"
			ResignSave()


		Case Else		
			Main_Index()

	End Select
		Dvbbs.footer()

End Sub

Sub Main_Index()
	Dvbbs.stats="大厅"
	Dvbbs.LoadTemplates("")
	Dvbbs.Nav()
	Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"
	XiaoLu.Channel()
	'Response.Write "<br />"
	Response.Write "<table width="&Dvbbs.mainsetting(0)&" border=0 align=center cellpadding=3 cellspacing=1>"
	Response.Write "<tr>"	'左边开始
	Response.Write "<td width=220 valign=top class=TableBody1>"
	XiaoLu.UserInfo()

'下面此句已修改完成，表格太长，撑开
	Response.Write "<table width=220 border=0 align=center cellpadding=3 cellspacing=1>"
	Response.Write "<tr><td class=tablebody1></td></tr></table>"

	'//签到记录列表
	Response.Write "<table border=0 cellpadding=3 cellspacing=1 align=center class=Tableborder1 Style=""Width:100%"">"
	Response.Write "<tr><th align=left>签到列表</th></tr>"
	Response.Write "<tr><td Valign=top class=tablebody1 Style=""line-height:22px"">"
	
	Set Rs=Dvbbs.Plus_Execute("Select top 15 * from [Dv_LuZiOffice_SignIn] order by ID desc")

	If rs.eof then
		Response.write "<Li>暂无信息!</Li>"
	Else 
		do while not rs.eof

		Response.Write ""&Trim(Rs("ID"))&" 期 "

		if len(Rs("SignInTitle")) > 15 then

			If Int(XiaoLu.Checkstr(Trim(Rs("SignInClass")))) = 0 Then
				Response.write "<Font Color=Red>"&left(XiaoLu.Checkstr(Trim(Rs("SignInTitle"))),7)&"...."&right(XiaoLu.Checkstr(Trim(Rs("SignInTitle"))),4)&"</Font>[长]"
			Else
				Response.write ""&left(XiaoLu.Checkstr(Trim(Rs("SignInTitle"))),7)&"...."&right(XiaoLu.Checkstr(Trim(Rs("SignInTitle"))),4)&"[长]"
			End If
				
		Else
			If Int(XiaoLu.Checkstr(Trim(Rs("SignInClass")))) = 0 Then
				Response.write "<Font Color=Red>"&XiaoLu.Checkstr(Trim(Rs("SignInTitle")))&"</Font>"
			Else
				Response.Write ""&XiaoLu.Checkstr(Trim(Rs("SignInTitle")))&""
			End If
		End If

		Response.Write "<br />"
	rs.movenext 
	loop
	rs.close 
	set rs=nothing
	End If

	Response.Write "</td></tr></table>"

	Response.Write "</td>"
	Response.Write "<td width=* valign=top class=TableBody1>"
	'-------------- 右边开始 --------

	Response.Write "<table border=0 cellpadding=3 cellspacing=1 align=center class=Tableborder1 Style=""Width:100%"">"
	Response.Write "<tr><th>详细说明 "

		If XiaoLu.Setting(1) = XiaoLu.UserName Then
			Response.Write "[<A Href=?Action=SignInAdmin Title=管理入口><Font Color=red><B>管理入口</B></Font></A>]"
		End If

	Response.Write "</th></tr><tr>"
	Response.Write "<td class=tablebody1 height=185 Valign=top Style=""line-height:22px"">"
	Response.Write "欢迎您 "&XiaoLu.UserName&" "
	
	If Int(XiaoLu.UserSex) = 0 Then

		Response.Write "小姐"

	Else

		Response.Write "同志"

	End IF

	Response.Write " 进入办公大厅，您当前等级为:"&XiaoLu.UserClass&"<br />在上任期间共被会员投诉 <b>"&XiaoLu.UserAppeal&"</B> 次,请假 "&XiaoLu.UserOnLeave&" 次.共收到 <Font Color=red>"&XiaoLu.UserPay&"</Font> 工资和奖励 "&XiaoLu.UserEg&" 个金币,<u>由于投诉,违规等原因被扣除 "&XiaoLu.UserPg&" 个金币</u>;<br />您从上任到现在减去被扣除的,共得到 "&Cint(XiaoLu.UserPay) + Cint(XiaoLu.UserEg) - Cint(XiaoLu.UserPg)&" 个金币"
	Response.Write "<div class=info></div>"
	Response.Write ""&XiaoLu.HTMLCode(XiaoLu.Checkstr(XiaoLu.Setting(3)))&""

	Response.Write "</td></tr></table>"

'下面此句已修改完成，表格太长，撑开
	Response.Write "<table class=Tableborder1 Style=""Width:100%"" border=0 align=center cellpadding=3 cellspacing=0>"
	Response.Write "<tr><td class=tablebody1></td></tr></table>"

			Response.Write "<table border=0 align=center cellpadding=3 cellspacing=1 class=Tableborder1 Style=""Width:100%"">"
			Response.Write "<form action=""?Action=MyModify"" method=""post"">"
			Response.Write "<tr><th align=left>修改我团队资料的签名内容</th></tr>"
			Response.Write "<tr><td class=tablebody1 align=center><textarea name=UserResume cols=""100%"" rows=3>"&XiaoLu.Checkstr(XiaoLu.UserResume)&"</textarea></td></tr>"
			Response.Write "<tr><td class=tablebody2 height=25 align=center><input type=submit name=Submit1 value="" 填写完毕 , 提交"" /></td></tr>"
			Response.Write "</Form></table>"

'下面此句已修改完成，表格太长，撑开
	Response.Write "<table class=Tableborder1 Style=""Width:100%"" border=0 align=center cellpadding=3 cellspacing=0>"
	Response.Write "<tr><td class=tablebody1></td></tr></table>"




	Set Rs=Dvbbs.Plus_Execute("Select top 2 * from [Dv_LuZiPlus_Log] where ClassId=1 And UserName='"&XiaoLu.UserName&"' order by ID desc")


	If rs.eof then
		Response.write "<Li>暂无信息!</Li>"
	Else 
		
	Response.Write "<table border=0 align=center cellpadding=3 cellspacing=1 class=Tableborder1 Style=""Width:100%"">"
	Response.Write "<tr><td class=tablebody1 height=25><Font Color=Red>我的最新两期签到内容：</Font></td></tr></table>"


	do while Not Rs.Eof

			Response.Write "<table border=0 align=center cellpadding=3 cellspacing=1 class=Tableborder1 Style=""Width:100%"">"
			Response.Write "<tr><th class=tablebody1>"

			Response.Write "<table width=""100%"" border=0 align=center cellpadding=0 cellspacing=0>"
			Response.Write "<tr><td width=*><Font Color=#FFFFFF><B>ID："&Rs("ID")&"&nbsp;&nbsp;&nbsp;Name："&Trim(Rs("UserName"))&"&nbsp;&nbsp;&nbsp;SignInId："&Rs("SignInId")&"</B></Font></td>"
			Response.Write "<td width=""33%""><Font Color=#FFFFFF><B>Time："&Rs("NewTime")&"</B></Font></td>"
			
			Response.Write "</tr></table>"

			Response.Write "</th></tr>"
			Response.Write "<tr><td class=tablebody1 Style=""line-height:22px"">MyAttitude：<br />"
			Response.Write "<div style=""overflow : auto ;padding:4px 5px 4px 5px;height:50px;line-height:20px;text-align : left;border:1px inset;background-color: #fff;"">"

	
				if len(XiaoLu.Checkstr(Rs("UserAction"))) > 150 then
					Response.write ""&left(XiaoLu.HTMLCode(XiaoLu.Checkstr(Trim(Rs("UserAction")))),120)&"........."&right(XiaoLu.Checkstr(Trim(Rs("UserAction"))),10)&"[长] [<a href=?Action=SignIn_Info&Id="&Trim(Rs("ID"))&" Title=MyAttitude：["&Trim(Rs("UserAction"))&"]>查看</A>]"
				Else
					Response.Write ""&XiaoLu.HTMLCode(XiaoLu.Checkstr(Trim(Rs("UserAction"))))&""
				End If

			Response.Write "</div></td></tr></table>"
'下面此句已修改完成，表格太长，撑开
			Response.Write "<table  class=Tableborder1 Style=""Width:100%"" border=0 align=center cellpadding=3 cellspacing=0>"

			Response.Write "<tr><td height=5 class=tablebody1></td></tr></table>"

		Rs.MoveNext 
		Loop
		Rs.Close 
		Set Rs=NoThing

	End If

	'-------------- 右边结束 --------
	Response.Write "</td>"
	Response.Write "</tr></table>"

End Sub

Sub SignIn()

	Dvbbs.stats="签到"
	Dvbbs.LoadTemplates("")
	Dvbbs.Nav()
	Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"

	XiaoLu.Channel()

	Response.Write "<table width="&Dvbbs.mainsetting(0)&" border=0 align=center cellpadding=3 cellspacing=1>"
	Response.Write "<tr>"	'左边开始
	Response.Write "<td width=220 valign=top class=TableBody1>"

	XiaoLu.UserInfo()

	Response.Write "</td>"
	Response.Write "<td width=* valign=top class=TableBody1>"
	'-------------- 右边开始 --------
	Response.Write "<table align=center cellpadding=3 cellspacing=1 class=tableBorder1 Style=""Width:100%"">"

	Response.Write "<tr><th height=25 align=left>第	"&XiaoLu.ID&" 期版主签到</th></tr>"

	Response.Write "<tr><td height=25 class=TableBody1>"
	Response.Write "<table width=""100%"" border=0 cellspacing=0 cellpadding=0>"
	Response.Write "<tr><td width=""6%""></td>"

	Response.Write "<td width=""94%"">本期主题："&XiaoLu.Checkstr(XiaoLu.SignInTitle)&""

	Response.Write "</td></tr></table></td></tr><tr>"
	Response.Write "<td height=25 class=TableBody2><font color=#FF0000>通告：</font><br />"&XiaoLu.HTMLCode(XiaoLu.Checkstr(XiaoLu.SignInAction))&""
	Response.Write "</td></tr></table><br />"

	If Int(XiaoLu.UserSignInId) = Int(XiaoLu.ID) Then

		'//已签到后提示信息
		Response.Write "<table align=center cellpadding=3 cellspacing=1 class=tableBorder1 Style=""Width:100%"">"
		Response.Write "<tr><th height=25 align=left>友情提示</th></tr><tr>"
		Response.Write "<td Class=TableBody1 Style=""line-height:22px""><li>在数据库内无法找到最新的签到纪录；</li><br /><li>或您已经在本期签过到了，请您老下期再来~!现在可以灌水去了;</li></td></tr></table><br />"
		'//已签到后提示信息  End

	Else

		Call SignIn_Info()
		Call Save_P()

	End If

	'-------------- 右边结束 --------
	Response.Write "</td>"
	Response.Write "</tr></table>"

End Sub

'//上期签到内容
Sub SignIn_Info()
	Set Rs=Dvbbs.Plus_Execute("Select top 1 * from [Dv_LuZiPlus_Log] where ClassId=1 and UserName='"&XiaoLu.UserName&"' order by ID desc")

	If rs.eof then
		'Response.write "<Li>暂无信息!</Li>"
	Else 
		Response.Write "<table align=center cellpadding=3 cellspacing=1 class=tableBorder1 Style=""Width:100%"">"
		Response.Write "<tr><th height=25 align=left>"&XiaoLu.UserName&" 在上一期的签到记录</th></tr>"

		Response.Write "<tr><td height=25 class=TableBody1>"
		Response.Write "<u>MyAttitude</u>："&XiaoLu.Checkstr(Trim(Rs("UserAction")))&""
		Response.Write "<div class=info align=Right>"
		Response.Write "签到ID:"&Trim(Rs("ID"))&" 签到时间:"&Trim(Rs("NewTime"))&"</div>"

		Response.Write "</td></tr></table><br />"

	End If

End Sub

'//签到填写
Sub Save_P()
		'Response.Write "<br />"
		Response.Write "<table align=center cellpadding=3 cellspacing=1 class=tableBorder1 Style=""Width:100%"">"
		Response.Write "<form name=SignIn method=post action=""?Action=Save_Const"">"
		Response.Write "<tr><th height=25 colspan=2 align=left>我还没签，我要签到</th></tr><tr>"
		Response.Write "<td width=""50%"" height=25 class=TableBody2><u>本期签到ID</u></td>"
		Response.Write "<td width=""50%"" class=TableBody2>"

		Response.Write "<input name=SignInId type=hidden value="&XiaoLu.ID&" />" '记录签到ID
		Response.Write "ID: <b>"&XiaoLu.ID&"</b>"

		Response.Write "</td></tr><tr>"
		Response.Write "<td height=25 class=TableBody1><u>签到用户ID</u></td>"
		Response.Write "<td class=TableBody1>"
		Response.Write "<input name=UserName type=hidden value="&XiaoLu.UserName&" />"  '记录签到用户名称
		Response.Write ""&XiaoLu.UserName&" ["&XiaoLu.UserClass&"] "
		Response.Write "</td></tr><tr>"
		Response.Write "<td height=25 class=TableBody2><u>当前时间</u></td>"
		Response.Write "<td class=TableBody2>"&Now()&"</td></tr><tr>"
		Response.Write "<td height=25 valign=top class=TableBody1><u>我有话说</u><br />给管理员提点我的个人建议以及本期的工作汇报....</td>"
		Response.Write "<td class=TableBody1>"
		Response.Write "<textarea name=UserAction cols=50 rows=4></textarea>"
		Response.Write "</td></tr>"
		
		Response.Write "<input type=""hidden"" name=""ClassId"" value=1>" 'Log分类
		Response.Write "<input type=""hidden"" name=""UserIp"" value="&XiaoLu.UserIp&">"
		Response.Write "<input name=""UserSignIn"" type=""hidden"" value="&XiaoLu.UserSignIn+Int(1)&" />" '用户增加一次签到
		
		Response.Write "<tr>"
		Response.Write "<td height=25 class=TableBody2></td>"
		Response.Write "<td class=TableBody2>"
		Response.Write "<input type=submit name=Submit value="" OK , 我现在就签 "" />"
		Response.Write "</td></tr></form></table>"
End Sub

'//签到提交页
Sub Save_Const()

	If Int(XiaoLu.UserSignInId) = Int(XiaoLu.ID) Then

		ErrCodes=ErrCodes + "<li>" + "亲爱的 "&XiaoLu.UserName&" 同志，你已成功签到，乖，灌水去吧，别在这里胡闹了...."
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

	Else
		if Request("UserAction")="" then
				ErrCodes=ErrCodes + "<li>" + "嘿嘿，做人不要太懒，[我有话说] 没填你就想走？态度决定一切哦...."
				Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
			Else
				'新建用户签到纪录
				Set Rs=Dvbbs.Plus_Execute("insert into [Dv_LuZiPlus_Log](UserIp,SignInId,UserName,ClassId,UserAction) Values('"&request("UserIp")&"','"&request("SignInId")&"','"&request("UserName")&"','"&request("ClassId")&"','"&request("UserAction")&"')")
				
				'更新用户签到信息
				Set Rs=Dvbbs.Plus_Execute("UpDate [Dv_LuZiOffice_User] Set UserSignIn='" & Request.Form("UserSignIn") & "' where UserId="&XiaoLu.UserId&"")
				
				Dvbbs.stats="签到"
				Dvbbs.LoadTemplates("")
				Dvbbs.Nav()
				Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"
				Dvbbs.Dvbbs_Suc("<li>签到成功，可以放心去灌水了......</li>")
		End If
	End If
End Sub

Sub MyModify()

		Dvbbs.stats="修改我的团队资料"
		Dvbbs.LoadTemplates("")
		Dvbbs.Nav()
		Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"

		'更新用户团队签名资料
		Set Rs=Dvbbs.Plus_Execute("UpDate [Dv_LuZiOffice_User] Set UserResume='" & Request.Form("UserResume") & "' where UserId="&XiaoLu.UserId&"")

		Dvbbs.Dvbbs_Suc("<li>您的团队签名资料已修改成功。</li>")
End Sub

Sub Finance()

	XiaoLu.PageConst(Cint(Dvbbs.Forum_Setting(11)))
	Dvbbs.stats="财政日志"
	Dvbbs.LoadTemplates("")
	Dvbbs.Nav()
	Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"
	XiaoLu.Channel()

	Response.Write "<table border=0 cellpadding=3 cellspacing=1 align=center class=Tableborder1>"

	Response.Write "<tr>"
	Response.Write "<td Width=""12%"" Height=25 class=TableBody2 align=center><b>操作者</b></td>"
	Response.Write "<td Width=""8%"" class=TableBody2 align=center><b>所属类别</b></td>"
	Response.Write "<td Width=* class=TableBody2 align=center><b>操作原由</b></td>"
	Response.Write "<td Width=""8%"" class=TableBody2 align=center><b>涉及金币</b></td>"
	Response.Write "<td Width=""15%"" class=TableBody2 align=center><b>最后更新</b></td>"

	
	SQL="Select * from [Dv_LuZiPlus_Log] Where UserName='"&XiaoLu.UserName&"' and ClassId=5 or ClassId=8 or ClassId=15 order by NewTime desc"
	Set Rs = Server.CreateObject ("adodb.recordset")
	If Cint(Dvbbs.Forum_Setting(92))=1 Then
		If Not IsObject(Plus_Conn) Then Plus_ConnectionDatabase
		Rs.Open Sql,Plus_Conn,1,1
	Else
		If Not IsObject(Conn) Then ConnectionDatabase
		Rs.Open Sql,conn,1,1
	End If 


	If Not (Rs.Eof And Rs.Bof) Then
		CountNum = Rs.RecordCount
			If CountNum Mod MaxRows=0 Then
				Endpage = CountNum \ MaxRows
			Else
				Endpage = CountNum \ MaxRows+1
			End If
		Rs.MoveFirst
		If Page > Endpage Then Page = Endpage
			If Page < 1 Then Page = 1
				If Page >1 Then 				
					Rs.Move (Page-1) * MaxRows
				End if
			SQL=Rs.GetRows(MaxRows)
	For i=0 To Ubound(SQL,2)

	'循环部分
	Response.Write "</tr>"
	Response.Write "<tr>"
	Response.Write "<td Height=25 class=TableBody1 align=center>"

		If Cint(SQL(9,i)) = 1 Then
			Response.Write ""&SQL(10,i)&""
		Else
			Response.Write "[<Font Color=#999999>已被保密</Font>]"
		End If

	Response.Write "</td>"
	Response.Write "<td class=TableBody1 align=center>"
		
		If Cint(SQL(6,i)) = 5 Then
			Response.Write "<Font Color=Blue>金币奖励</Font>"
		ElseIf Cint(SQL(6,i)) = 8 Then
			Response.Write "<Font Color=Red>金币扣除</Font>"
		ElseIf Cint(SQL(6,i)) = 15 Then
			Response.Write "<Font Color=purple>请假扣除</Font>"
		End If

	Response.Write "</td>"
	Response.Write "<td class=TableBody1>"
		Response.Write "<div style=""overflow : auto ;padding:4px 5px 4px 5px;height:30px;line-height:20px;text-align : left;border:1px inset;background-color: #fff;"">"
		Response.Write ""&SQL(2,i)&"</div></td>"
	Response.Write "<td class=TableBody1 align=center>"&SQL(8,i)&"</td>"
	Response.Write "<td class=TableBody1 align=center>"&SQL(5,i)&"</td>"
	Response.Write "</tr>"
	'循环结束

		Next
			Response.Write "<SCRIPT>PageList("&Page&",10,"&MaxRows&","&CountNum&",""Action=Finance"",1);</SCRIPT>"
		Else
			Response.Write "<tr><td class=TableBody1 Height=25 colspan=5 align=center><Font Color=red>数据库内暂时无法找到您需要的日志</Font></td></tr>"
		End If
			Rs.Close
		Set Rs=Nothing


	Response.Write "</Table>"
End Sub

Sub Payment()

	XiaoLu.PageConst(15)

	Dvbbs.stats="工资列表"
	Dvbbs.LoadTemplates("")
	Dvbbs.Nav()
	Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"
	XiaoLu.Channel()

	Response.Write "<table border=0 cellpadding=3 cellspacing=1 align=center class=Tableborder1>"

	Response.Write "<tr>"
	Response.Write "<td Width=""8%"" Height=25 class=TableBody2 align=center><b>基本工资</b></td>"
	Response.Write "<td Width=* class=TableBody2 align=center><b>工资说明</b></td>"
	Response.Write "<td Width=""8%"" class=TableBody2 align=center><b>附加奖励值</b></th>"
	Response.Write "<td Width=""8%"" class=TableBody2 align=center><b>附加处罚值</b></td>"
	Response.Write "<td Width=""8%"" class=TableBody2 align=center><b>奖金</b></td>"
	Response.Write "<td Width=""8%"" class=TableBody2 align=center><b>工资扣除</b></td>"
	Response.Write "</tr>"
	
	SQL="Select * from [Dv_LuZiOffice_Pay] Where PayName='"&XiaoLu.UserName&"' order by PayTime desc"
	Set Rs = Server.CreateObject ("adodb.recordset")
	If Cint(Dvbbs.Forum_Setting(92))=1 Then
		If Not IsObject(Plus_Conn) Then Plus_ConnectionDatabase
		Rs.Open Sql,Plus_Conn,1,1
	Else
		If Not IsObject(Conn) Then ConnectionDatabase
		Rs.Open Sql,conn,1,1
	End If 


	If Not (Rs.Eof And Rs.Bof) Then
		CountNum = Rs.RecordCount
			If CountNum Mod MaxRows=0 Then
				Endpage = CountNum \ MaxRows
			Else
				Endpage = CountNum \ MaxRows+1
			End If
		Rs.MoveFirst
		If Page > Endpage Then Page = Endpage
			If Page < 1 Then Page = 1
				If Page >1 Then 				
					Rs.Move (Page-1) * MaxRows
				End if
			SQL=Rs.GetRows(MaxRows)
	For i=0 To Ubound(SQL,2)


	'//循环开始
	Response.Write "<tr>"
	Response.Write "<td align=left colspan=6 class=TableBody1>"
	Response.Write "<table border=0 cellpadding=0 cellspacing=0 align=center width=""100%"">"
	Response.Write "<tr>"
	Response.Write "<td width=*>"
	Response.Write "<u>"&SQL(14,i)&" 工资情况</u>"
	Response.Write "</td><td width=""30%"" align=Right>"
	Response.Write "[<a href=?Action=PayDoubt&PayId="&SQL(0,i)&" Title=我对本期工资有疑义><Font Color=red>我对本期工资有疑义</Font></a>]</td>"
	Response.Write "</tr></table></td></tr>"

		Response.Write "<tr>"
	Response.Write "<td Height=25 class=TableBody1 align=center>"&SQL(2,i)&"</td>"
	Response.Write "<td class=TableBody1 align=center>"
	Response.Write "<div style=""overflow : auto ;padding:4px 5px 4px 5px;height:30px;line-height:20px;text-align : left;border:1px inset;background-color: #fff;"">"
	Response.Write ""&SQL(12,i)&"</div></td>"
	Response.Write "<td class=TableBody1 align=center>"&SQL(3,i)&"</th>"
	
	Response.Write "<td class=TableBody1 align=center>"
		
			Response.Write ""&SQL(4,i)&""
	Response.Write "</td>"
	Response.Write "<td class=TableBody1 align=center>"&SQL(5,i)&"</td>"
	Response.Write "<td class=TableBody1 align=center>"

		If Cint(SQL(6,i)) = 0 Then
			Response.Write "<Font Color=Blue>-</Font>"
		Else			
			Response.Write "<Font Color=Red>"&SQL(6,i)&"</Font>"
		End If

	Response.Write "</td>"

	Response.Write "</tr>"

	If Len(SQL(13,i)) <= 2 Then
	Else
		Response.Write "<tr>"
		Response.Write "<td colspan=6 class=TableBody1>"
		Response.Write "<Font Color=Blue>"&XiaoLu.Checkstr(SQL(13,i))&"</Font>"
		Response.Write "</td>"
		Response.Write "</tr>"
	End If

	Response.Write "<tr>"
	Response.Write "<td height=5 align=left colspan=6 class=TableBody2></td>"
	Response.Write "</tr>"
	'循环结束

		Next
			Response.Write "<SCRIPT>PageList("&Page&",10,"&MaxRows&","&CountNum&",""Action=Payment"",1);</SCRIPT>"
		Else
			Response.Write "<tr><td class=TableBody1 Height=25 colspan=6 align=center><Font Color=red>管理员暂时没有发工资给您.</Font></td></tr>"
		End If
			Rs.Close
		Set Rs=Nothing


	Response.Write "</Table>"

End Sub

Sub OnLeave()

	Dvbbs.stats="有事请假"
	Dvbbs.LoadTemplates("")
	Dvbbs.Nav()
	Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"
	XiaoLu.Channel()

	
			Response.Write "<table border=0 cellpadding=3 cellspacing=1 align=center class=Tableborder1>"
			Response.Write "<tr><th height=25 colspan=2 align=left>请假说明</th></tr>"
			Response.Write "<tr>"
			Response.Write "<td height=25 colspan=2 class=tablebody1 Style=""line-height:22px"">"
			Response.Write ""&XiaoLu.HTMLCode(XiaoLu.Checkstr(XiaoLu.Setting(13)))&""
			Response.Write "</td></tr>"
	Response.Write "<form name=LeaveSave method=post action=""?Action=LeaveSave"">"
	Response.Write "<tr><th height=25 class=tablebody2 colspan=2>我的请假条"
	Response.Write "</th></tr><tr>"
	Response.Write "<td height=25 class=tablebody1 width=""50%"" Valign=top><u>请假天数</u><br />请写清您的请假天数，以便管理员安排，建议不要超过规定的 <b>"&XiaoLu.Setting(6)&"</b> 天"
	Response.Write "</td>"
	Response.Write "<td height=25 class=tablebody1 width=""50%""><input name=UserRemark type=text size=4 /> 天"
	Response.Write "</td>"
	Response.Write "</tr><tr><td height=25 class=tablebody2 Valign=top><u>请假事由</u><br />您的请假原因，已经请假后您的版主工作的安排"
	Response.Write "</td>"
	Response.Write "<td height=25 class=tablebody2><textarea name=UserAction cols=45 rows=3></textarea>"
	Response.Write "</td>"
	Response.Write "</tr><tr><td height=25 class=tablebody1 Valign=top><u>是否交代</u><br />是否将您请假的事情交代给了某个管理员，请详细管理员在论坛注册的名称."
	Response.Write "</td>"
	Response.Write "<td height=25 class=tablebody1><input name=UserTitle type=text size=25 value=0 /><br /><b>注：若无请别填</b>"
	Response.Write "</td>"
	Response.Write "</tr><tr><td height=25 class=tablebody2>"
	Response.Write "</td>"
	Response.Write "<input name=""UserFettle"" type=""hidden"" value=1 />"
		Set Rs=Dvbbs.Plus_Execute("Select UserOnLeave from [Dv_LuZiOffice_User] Where UserName='"&XiaoLu.UserName&"'")

	Response.Write "<input name=""UserOnLeave"" type=""hidden"" value="&Cint(Rs("UserOnLeave")) + 1&" />"
	Response.Write "<input name=""UserName"" type=""hidden"" value="&XiaoLu.UserName&" />"
	Response.Write "<input name=""AdminName"" type=""hidden"" value="&XiaoLu.Setting(17)&" />"
	Response.Write "<input name=""ClassId"" type=""hidden"" value=2 />"
	Response.Write "<td height=25 class=tablebody2><input type=submit name=Submit1 value="" 填写完毕 , 提交"" />"
	Response.Write "</td>"
	Response.Write "</tr></Form></table>"

End Sub

Sub LeaveSave()
		Dvbbs.stats="请假提交"
		Dvbbs.LoadTemplates("")
		Dvbbs.Nav()
		Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.Asp"

	If Not (isNumeric(Request("UserRemark"))) Then

		ErrCodes=ErrCodes + "<li>" + "输入的请假天数值必须是数字"
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

	Elseif Instr(Request("UserRemark"),".") then

		ErrCodes=ErrCodes + "<li>" + "输入的请假天数值必须必须是整数,不能包含小数点"
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

	ElseIf Clng(Request("UserRemark")) <= 0 Then

		ErrCodes=ErrCodes + "<li>" + "输入的请假天数必须大于 0 "
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

	ElseIf Clng(Request("UserRemark")) > Clng(XiaoLu.Setting(6)) Then

		ErrCodes=ErrCodes + "<li>" + "输入的请假天数已超过系统设置的要求,请返回重新填写."
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

	ElseIf Request("UserAction") = "" Then

		ErrCodes=ErrCodes + "<li>" + "连[请假事由]不填就想请假?你允许,系统还不允许呢,回去写过的."
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
	
	ElseIf Request("UserTitle") = "" Then

		ErrCodes=ErrCodes + "<li>" + "[是否交代]不能为空,否则系统不允许提交."
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

	Else

		'新建用户请假纪录
		Set Rs=Dvbbs.Plus_Execute("insert into [Dv_LuZiPlus_Log](UserName,UserRemark,UserTitle,ClassId,UserAction) Values('"&request("UserName")&"','"&request("UserRemark")&"','"&request("UserTitle")&"','"&request("ClassId")&"','"&request("UserAction")&"')")

		Set Rs=Dvbbs.Plus_Execute("update [Dv_LuZiOffice_User] set UserFettle='" & Request.Form("UserFettle") & "' , UserOnLeave='" & Request.Form("UserOnLeave") & "' Where UserName='"&XiaoLu.UserName&"'")
		
		'//请假短信

		Set Rs=Dvbbs.Execute("insert into dv_message(sender,incept,title,content,sendtime,issend) values('办公室' , '"&Request("AdminName")&"' , '"&XiaoLu.UserName&"的请假条' ,  '"&XiaoLu.UserName&"已请假，请注意安排工作，版主的请假日志在后台可以看到。' , '"&now()&"' , '1')")
		
		Dvbbs.Dvbbs_Suc("<li>请假提交成功,可以放心去做您的事情了,论坛的事情就交给我们了.</li>")
	End If
End Sub

Sub SignInLog()
	XiaoLu.PageConst(5)
	Dvbbs.stats="我的签到记录"
	Dvbbs.LoadTemplates("")
	Dvbbs.Nav()
	Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"
	XiaoLu.Channel()

	SQL="Select * from [Dv_LuZiPlus_Log] Where UserName='"&XiaoLu.UserName&"' And ClassId=1 order by ID desc"
	Set Rs = Server.CreateObject ("adodb.recordset")
		If Cint(Dvbbs.Forum_Setting(92))=1 Then
			If Not IsObject(Plus_Conn) Then Plus_ConnectionDatabase
			Rs.Open Sql,Plus_Conn,1,1
		Else
			If Not IsObject(Conn) Then ConnectionDatabase
			Rs.Open Sql,conn,1,1
		End If 
		
	Response.Write "<table border=0 align=center cellpadding=3 cellspacing=1 class=Tableborder1>"

	If Not (Rs.Eof And Rs.Bof) Then
		CountNum = Rs.RecordCount
			If CountNum Mod MaxRows=0 Then
				Endpage = CountNum \ MaxRows
			Else
				Endpage = CountNum \ MaxRows+1
			End If
		Rs.MoveFirst
		If Page > Endpage Then Page = Endpage
			If Page < 1 Then Page = 1
				If Page >1 Then 				
					Rs.Move (Page-1) * MaxRows
				End if
			SQL=Rs.GetRows(MaxRows)
	For i=0 To Ubound(SQL,2)


			Response.Write "<tr><th class=tablebody1>"

			Response.Write "<table width=""100%"" border=0 align=center cellpadding=0 cellspacing=0>"
			Response.Write "<tr><td width=*><Font Color=#FFFFFF><B>ID："&SQL(0,i)&"&nbsp;&nbsp;&nbsp;Name："&Trim(SQL(1,i))&"&nbsp;&nbsp;&nbsp;SignInId："&Cint(SQL(3,i))&"</B></Font></td>"
			Response.Write "<td width=""33%""><Font Color=#FFFFFF><B>Time："&SQL(5,i)&"</B></Font></td>"
			
			Response.Write "</tr></table>"

			Response.Write "</th></tr>"
			Response.Write "<tr><td class=tablebody1 Style=""line-height:22px"">MyAttitude：<br />"
			Response.Write "<div style=""overflow : auto ;padding:4px 5px 4px 5px;height:50px;line-height:20px;text-align : left;border:1px inset;background-color: #fff;"">"

	
				if len(XiaoLu.Checkstr(SQL(2,i))) > 150 then
					Response.write ""&left(XiaoLu.HTMLCode(XiaoLu.Checkstr(Trim(SQL(2,i)))),120)&"........."&right(XiaoLu.Checkstr(Trim(SQL(2,i))),10)&"[长] [<a href=?Action=SignIn_Info&Id="&Cint(SQL(0,i))&" Title=MyAttitude：["&Trim(SQL(2,i))&"]>查看</A>]"
				Else
					Response.Write ""&XiaoLu.HTMLCode(XiaoLu.Checkstr(Trim(SQL(2,i))))&""
				End If

			Response.Write "</div></td></tr></table>"
			Response.Write "<table width="&Dvbbs.mainsetting(0)&" border=0 align=center cellpadding=3 cellspacing=1>"
			Response.Write "<tr><td height=5 class=tablebody1></td></tr>"
		
		Next
			Response.Write "<SCRIPT>PageList("&Page&",10,"&MaxRows&","&CountNum&",""Action=SignInLog"",1);</SCRIPT>"
		Else
			Response.Write "<tr><td class=TableBody1 Height=25 colspan=6 align=center><Font Color=red>系统无法找到您的签到纪录.</Font></td></tr>"
		End If
			Rs.Close
		Set Rs=Nothing
		Response.Write "</table>"
End Sub

Sub Suggestion()

	XiaoLu.PageConst(5)
	Dvbbs.stats="我的留言本"
	Dvbbs.LoadTemplates("")
	Dvbbs.Nav()
	Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"
	XiaoLu.Channel()
	Response.Write "<table border=0 cellpadding=3 cellspacing=1 align=center class=Tableborder1>"

	
	SQL="Select * from [Dv_LuZiPlus_Log] Where UserName='"&XiaoLu.UserName&"' and ClassId=10 or UserName='"&XiaoLu.UserName&"' and ClassId=11 order by ID desc"
	Set Rs = Server.CreateObject ("adodb.recordset")
	If Cint(Dvbbs.Forum_Setting(92))=1 Then
		If Not IsObject(Plus_Conn) Then Plus_ConnectionDatabase
		Rs.Open Sql,Plus_Conn,1,1
	Else
		If Not IsObject(Conn) Then ConnectionDatabase
		Rs.Open Sql,conn,1,1
	End If 


	If Not (Rs.Eof And Rs.Bof) Then
		CountNum = Rs.RecordCount
			If CountNum Mod MaxRows=0 Then
				Endpage = CountNum \ MaxRows
			Else
				Endpage = CountNum \ MaxRows+1
			End If
		Rs.MoveFirst
		If Page > Endpage Then Page = Endpage
			If Page < 1 Then Page = 1
				If Page >1 Then 				
					Rs.Move (Page-1) * MaxRows
				End if
			SQL=Rs.GetRows(MaxRows)
	For i=0 To Ubound(SQL,2)


	Response.Write "<tr><td height=25 class=tablebody2>"

	Response.Write "<table width=""100%"" border=0 cellpadding=0 cellspacing=0>"
	Response.Write "<tr>"
	Response.Write "<td Width=*>标题：<u>"
	
		if Len(SQL(11,i)) > 50 Then
			Response.write ""&left(XiaoLu.Checkstr(Trim(SQL(11,i))),30)&" ....... "&Right(XiaoLu.Checkstr(Trim(SQL(11,i))),8)&"[长]"
		Else
			Response.Write ""&SQL(11,i)&""
		End If

	Response.Write "</u></td>"
	Response.Write "<td Width=""30%"" align=Right>"
	Dim RClassId

	RClassId = ""&SQL(6,i)&""

	If RClassId = 10 Then

	Response.Write "[<A Href=?Action=Revert&LogId="&CInt(SQL(0,i))&" Title=《"&SQL(10,i)&"》><Font Color=Red>回复留言</Font></A>]"
	End If

	Response.Write "</td></tr></table>"
	
	

	Response.Write "</td></tr>"

	Response.Write "<tr><td height=25 class=tablebody1>"
	
	Response.Write "<div style=""overflow : auto ;padding:4px 20px 4px 20px;height:50px;line-height:20px;text-align : left;border:1px inset;background-color: #fff;"">"
	Response.Write ""&XiaoLu.Checkstr(Trim(SQL(2,i)))&""
	Response.Write "</Div>"
		
		If Len(XiaoLu.Checkstr(Trim(SQL(12,i)))) => 2 Then
			Response.Write "<div style=""overflow : auto ;padding:4px 20px 4px 20px;height:40px;line-height:20px;text-align : left;border:1px inset;background-color: #fff;"">"
			Response.Write "<Font Color=Red>我的回复:"&XiaoLu.HTMLCode(XiaoLu.Checkstr(Trim(SQL(12,i))))&"</Font>"
			Response.Write "</Div>"
		End If
	

	Response.Write "<div class=info Align=Right>编号："&SQL(0,i)&" 作者："
	
		If Cint(SQL(9,i)) = 1 Then
			Response.Write ""&SQL(10,i)&""
		Else
			Response.Write "[已被保密]"
		End If

	Response.Write " 留言时间："&SQL(5,i)&"</div>"

	Response.Write "<tr><th height=5></th></tr>"

		Next
			Response.Write "<SCRIPT>PageList("&Page&",10,"&MaxRows&","&CountNum&",""Action=Suggestion"",1);</SCRIPT>"
		Else
			Response.Write "<tr><td class=TableBody1 Height=25 align=center><Font Color=red>暂时没有人给您留言,请节哀吧.</Font></td></tr>"
		End If
			Rs.Close
		Set Rs=Nothing


	Response.Write "</Table>"

End Sub

Sub Revert()

	Set Rs=Dvbbs.Plus_Execute("Select * from [Dv_LuZiPlus_Log] Where ID="&CStr(Request("LogId"))&"")

	Dvbbs.stats="回复留言"
	Dvbbs.LoadTemplates("")
	Dvbbs.Nav()
	Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"
	dim RClassId
	
	RClassId = ""&Rs("ClassId")&""

	If RClassId = 11 Then

		ErrCodes=ErrCodes + "<li>" + "这条消息您已回复了，请不要在闯进来。"
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
	Else

	XiaoLu.Channel()

	Response.Write "<table border=0 cellpadding=3 cellspacing=1 align=center class=Tableborder1>"
	Response.Write "<form action=?Action=RevertSave method=post>"
	Response.Write "<tr><td height=25 class=tablebody2 colspan=3>"
	Response.Write "回复：（"&Rs("Manipulator")&"）"

		if Len(XiaoLu.Checkstr(Trim(Rs("UserTitle")))) > 50 Then
			Response.write ""&left(XiaoLu.Checkstr(Trim(Rs("UserTitle"))),30)&" ....... "&Right(XiaoLu.Checkstr(Trim(Rs("UserTitle"))),8)&"[长]"
		Else
			Response.Write ""&XiaoLu.Checkstr(Trim(Rs("UserTitle")))&""
		End If

	Response.Write "</td></tr>"

	Response.Write "<tr><td class=tablebody1 colspan=3>留言内容："
	Response.Write "<div style=""overflow : auto ;padding:4px 20px 4px 20px;height:30px;line-height:20px;text-align : left;border:1px inset;background-color: #fff;"">"
	Response.Write ""&XiaoLu.Checkstr(Trim(Rs("UserAction")))&""
	Response.Write "</div>"
	Response.Write "</td></tr>"

	Response.Write "<tr><td class=tablebody1 width=""50%"" Valign=top><u>回复内容</u><br />请详细填写清楚留言内容."
	Response.Write "</td>"
	Response.Write "<td class=tablebody1 width=""50%""><textarea name=UserRevert cols=45 rows=3></textarea>"
	Response.Write "</td></tr>"

	Response.Write "<tr><td class=tablebody2>"
	Response.Write "</td>"
	response.write "<input type=hidden name=ClassId value=11>"
	response.write "<input type=hidden name=id value="&CStr(Request("LogId"))&">"
	Response.Write "<td class=tablebody2><input type=submit name=Submit1 value="" 填写完毕 , 提交"" />"
	Response.Write "</td>"
	Response.Write "</tr></Form></Table>"
End If
End Sub


Sub RevertSave()

	Set Rs=Dvbbs.Plus_Execute("Select * from [Dv_LuZiPlus_Log] Where ID="&CStr(Request("Id"))&"")

	dim RClassId,UserName
	
	RClassId = ""&Rs("ClassId")&""
	UserName = ""&Rs("Manipulator")&""


	If RClassId = 11 Then
		
		ErrCodes=ErrCodes + "<li>" + "这条消息您已回复了，请勿在此刷新，否则......"
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
	Else

	If Request("UserRevert") = "" Then

		ErrCodes=ErrCodes + "<li>" + "[回复内容] 不能为空,否则系统不允许提交"
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

	Else

		Dvbbs.stats="留言回复"
		Dvbbs.LoadTemplates("")
		Dvbbs.Nav()
		Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.Asp"
		
		Set Rs=Dvbbs.Plus_Execute("update [Dv_LuZiPlus_Log] set UserRevert='" & Request.Form("UserRevert") & "',ClassId='" & Request.Form("ClassId") & "' Where ID="&CStr(Request("Id"))&"")
		
		Set Rs=Dvbbs.Execute("insert into dv_message(sender,incept,title,content,sendtime,issend) values('办公室' , '"&UserName&"' , '留言回复' ,  '"&UserName&"，您的留言信息已回复，请点击： [URL=Plus_ForumOffice_Team.asp?Action=WordEnd]查看留言[/URL] 查看。' , '"&now()&"' , '1')")

	Response.Write "<table border=0 cellpadding=3 cellspacing=1 align=center class=Tableborder1 Style=""Width:75%"">"
	Response.Write "<tr><th height=25 class=tablebody2>友情提示"
	Response.Write "</th></tr>"
	Response.Write "<tr><td height=30 class=tablebody1><li><Font Color=red>您已成功回复留言</font></td></tr>"

	Response.Write "<tr><td class=tablebody2 align=center><a href=?Action=Suggestion>返回上一页</a></td></tr>"
	Response.Write "</table>"
	End If
End If
End Sub

Sub Resign()
Set Rs=Dvbbs.Plus_Execute("Select top 1 * from [Dv_LuZiPlus_Log] Where UserName='"&XiaoLu.UserName&"' and ClassId=12")
	
	If Rs.Eof Then

		Dvbbs.stats="我的辞职信"
		Dvbbs.LoadTemplates("")
		Dvbbs.Nav()
		Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"
		XiaoLu.Channel()
			Response.Write "<table border=0 cellpadding=3 cellspacing=1 align=center class=Tableborder1>"
			Response.Write "<tr><th height=25 colspan=2 align=left>辞职说明</th></tr>"
			Response.Write "<tr>"
			Response.Write "<td height=25 colspan=2 class=tablebody1 Style=""line-height:22px"">"
			Response.Write ""&XiaoLu.HTMLCode(XiaoLu.Checkstr(XiaoLu.Setting(14)))&""
			Response.Write "</td></tr>"
		Response.Write "<form name=LeaveSave method=post action=""?Action=ResignSave"">"
		Response.Write "<tr><th height=25 class=tablebody2 colspan=2>我的辞职信"
		Response.Write "</th></tr>"
		Response.Write "<tr><td height=25 class=tablebody2 Valign=top width=""50%""><u>辞职原因</u><br />请写清辞职原因."
		Response.Write "</td>"
		Response.Write "<td height=25 class=tablebody2 width=""50%""><textarea name=UserAction cols=50 rows=6></textarea>"
		Response.Write "</td></tr>"
		Response.Write "<tr><td height=25 class=tablebody1 Valign=top><u>推荐斑竹</u><br />您觉得谁可以上任你的工作(可不填)."
		Response.Write "</td>"
		Response.Write "<td height=25 class=tablebody1><input name=UserTitle type=text size=25 value=0 />"
		Response.Write "</td></tr>"
		Response.Write "<tr><td height=25 class=tablebody2>"
		Response.Write "</td>"

		Response.Write "<input name=""UserName"" type=""hidden"" value="&XiaoLu.UserName&" />"
		Response.Write "<input name=""ClassId"" type=""hidden"" value=12 />"
		Response.Write "<input name=""AdminName"" type=""hidden"" value="&XiaoLu.Setting(17)&" />"

		Response.Write "<td height=25 class=tablebody2><input type=submit name=Submit1 value="" 填写完毕 , 提交"" />"
		Response.Write "</td>"
		Response.Write "</tr></Form></table>"
	Else

		ErrCodes=ErrCodes + "<li>" + "您已提交过辞职报告,只有管理员批复后才允许再重复提交."
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
	End If
	
End Sub

Sub ResignSave()

Set Rs=Dvbbs.Plus_Execute("Select top 1 * from [Dv_LuZiPlus_Log] Where UserName='"&XiaoLu.UserName&"' and ClassId=12")
	
	If Rs.Eof Then

	If Request("UserAction") = "" Then

		ErrCodes=ErrCodes + "<li>" + "[辞职原由]不能为空,否则系统不允许提交."
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

	Else

		Dvbbs.stats="辞职信提交"
		Dvbbs.LoadTemplates("")
		Dvbbs.Nav()
		Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.Asp"

		Set Rs=Dvbbs.Plus_Execute("insert into [Dv_LuZiPlus_Log](UserName,UserTitle,ClassId,UserAction) Values('"&request("UserName")&"','"&request("UserTitle")&"','"&request("ClassId")&"','"&request("UserAction")&"')")
	
		
		Set Rs=Dvbbs.Execute("insert into dv_message(sender,incept,title,content,sendtime,issend) values('办公室' , '"&XiaoLu.Setting(17)&"' , '"&XiaoLu.UserName&"的辞职信' ,  '"&XiaoLu.UserName&"已申请辞职，请到后台大厅进行参考辞职信的内容。' , '"&now()&"' , '1')")

		Dvbbs.Dvbbs_Suc("<li>辞职申请提交成功,待管理员审批.</li>")
	End If
	Else

		ErrCodes=ErrCodes + "<li>" + "您已提交过辞职报告,只有管理员批复后才允许再重复提交."
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
	End If
End Sub

Sub PayDoubt()

Set Rs=Dvbbs.Plus_Execute("Select top 1 * from [Dv_LuZiPlus_Log] Where UserName='"&XiaoLu.UserName&"' and ClassId=16 Or UserName='"&XiaoLu.UserName&"' and ClassId=17 ")

	If Rs.Eof Then

Set Rs=Dvbbs.Plus_Execute("Select * from [Dv_LuZiOffice_Pay] Where PayId="&CStr(Request("PayId"))&" ")

	Dim T
	T = Rs(14)

		Dvbbs.stats="我的工资有问题"
		Dvbbs.LoadTemplates("")
		Dvbbs.Nav()
		Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"
		XiaoLu.Channel()
			Response.Write "<table border=0 cellpadding=3 cellspacing=1 align=center class=Tableborder1>"
			Response.Write "<tr><th height=25 colspan=2 align=left>工资疑问申请表</th></tr>"

		Response.Write "<form name=LeaveSave method=post action=""?Action=PayDoubtSave"">"
		Response.Write "<tr><td height=25 class=tablebody2 Valign=top width=""50%""><u>工资问题</u><br />请写清本期工资的疑问，否则管理员不给予审核."
		Response.Write "</td>"
		Response.Write "<td height=25 class=tablebody2 width=""50%""><textarea name=UserAction cols=50 rows=6></textarea>"
		Response.Write "</td></tr>"
		Response.Write "<tr><td height=25 class=tablebody1 Valign=top><u>希望补给</u><br />您希望管理员再不给您多少金币。"
		Response.Write "</td>"
		Response.Write "<td height=25 class=tablebody1><input name=UserG type=text size=25 value=0 />"
		Response.Write "</td></tr>"
		Response.Write "<tr><td height=25 class=tablebody2>"
		Response.Write "</td>"

		Response.Write "<input name=""UserName"" type=""hidden"" value="&XiaoLu.UserName&" />"
		Response.Write "<input name=""ClassId"" type=""hidden"" value=16 />"
		Response.Write "<input name=""NewTime"" type=""hidden"" value="&T&" />"

		Response.Write "<td height=25 class=tablebody2><input type=submit name=Submit1 value="" 填写完毕 , 提交"" />"
		Response.Write "</td>"
		Response.Write "</tr></Form></table>"
	Else

		ErrCodes=ErrCodes + "<li>" + "本期工资的疑问您已提交，请误重复提交。"
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
	End If
	
End Sub

Sub PayDoubtSave()
Set Rs=Dvbbs.Plus_Execute("Select top 1 * from [Dv_LuZiPlus_Log] Where UserName='"&XiaoLu.UserName&"' and ClassId=16 Or UserName='"&XiaoLu.UserName&"' and ClassId=17")

	If Rs.Eof Then
		If Request("UserAction") = "" Then

			ErrCodes=ErrCodes + "<li>" + "[工资问题]不能为空,否则系统不允许提交."
			Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

		Else

			Dvbbs.stats="我的工资有问题提交"
			Dvbbs.LoadTemplates("")
			Dvbbs.Nav()
			Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.Asp"

			Set Rs=Dvbbs.Plus_Execute("insert into [Dv_LuZiPlus_Log](UserName,UserG,ClassId,UserAction) Values('"&request("UserName")&"','"&request("UserG")&"','"&request("ClassId")&"','"&request("UserAction")&"')")
		
			
			Set Rs=Dvbbs.Execute("insert into dv_message(sender,incept,title,content,sendtime,issend) values('办公室' , '"&XiaoLu.Setting(17)&"' , '"&XiaoLu.UserName&"工资疑问' ,  '"&XiaoLu.UserName&"提出他的 《"&request("NewTime")&"期》工资有问题，请给予审核' , '"&now()&"' , '1')")

			Dvbbs.Dvbbs_Suc("<li>提交成功,待管理员审批.</li>")
		End If
	Else

		ErrCodes=ErrCodes + "<li>" + "本期工资的疑问您已提交，请误重复提交。"
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
	End If
End Sub

Sub SignInAdmin()
	Dvbbs.stats="管理大厅"
	Dvbbs.LoadTemplates("")
	Dvbbs.Nav()
	Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"
	XiaoLu.Channel()
Dim LuRs,SignInDate

	Set Rs=Dvbbs.Plus_Execute("Select top 1 * from [Dv_LuZiOffice_SignIn] order by ID desc")

	If Rs.Eof Then
		SignInDate = Cint(XiaoLu.Setting(9))
	Else
		SignInDate = DateDiff("d", Rs(4), Now())
		
	End If

Rs.Close
Set Rs = Nothing

	If Cint(SignInDate) < Cint(XiaoLu.Setting(9)) Then

		ErrCodes=ErrCodes + "<li>" + "相隔 "&XiaoLu.Setting(9)&" 天才能创建一次签到记录，你现在又来了，想捣乱？兄弟们,放狗咬人....."
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
		Response.End()

	Else
%>
<table width="95%" border="0"  align=center cellpadding="3" cellspacing="1" class=Tableborder1>
<form name="SignIn_Save" method="post" action="?Action=SignIn_Save">
  <tr>
    <th height="25" colspan="2" align="left" valign="middle">增加新一轮签到记录</th>
  </tr>
  <tr>
<%
Set Rs=Dvbbs.Plus_Execute("Select top 1 * from [Dv_LuZiOffice_SignIn] order by ID desc")

	If Rs.Eof Then
	Response.Write "<td width=""50%"" height=25 class=tablebody2><u>第 <b>1</b> 期签到记录标题</u><br />"
	Else
	Response.Write "<td width=""50%"" height=25 class=tablebody2><u>第 <b>"&Trim(Rs("ID"))+1&"</b> 期签到记录标题</u><br />"
	End If
	Response.Write "上一期标题："

		If Rs.Eof Then
			Response.Write "<font color=red>无法找到上期签到记录，Sorry~``!</font>"
		Else
			Response.Write "<Font Title="&XiaoLu.Checkstr(Trim(Rs("SignInTitle")))&">"
			if len(XiaoLu.Checkstr(rs("SignInTitle"))) > 30 then
				Response.write ""&left(XiaoLu.Checkstr(Trim(rs("SignInTitle"))),13)&"....."&Right(XiaoLu.Checkstr(Trim(rs("SignInTitle"))),4)&"[长]"
			Else
				Response.write ""&XiaoLu.Checkstr(Trim(Rs("SignInTitle")))&""
			End If
			Response.Write "</Font>"
		End If
		If Rs.Eof Then
			'Response.Write "<font color=red>无法找到上期签到记录，Sorry~``!</font>"
		Else
	Response.Write " <U>上期发布时间："&Year(Rs("SignInTime"))&"-"&month(Rs("SignInTime"))&"-"&day(Rs("SignInTime"))&"</U>"
		End If

%></td>
    <td width="50%" class=tablebody2><input name="SignInTitle" type="text" size="50" /></td>
  </tr>
  <tr>
    <td valign="top" class=tablebody1><u>本期通告</u><br />显示在签到页的标题下方。
	</td>
    <td class=tablebody1><textarea name="SignInAction" cols="55" rows="5"></textarea></td>
  </tr>
<input name="SignInClass" type="hidden" value=1 />
<input name="System" type="hidden" value=1 />
<input name="UserName" type="hidden" value=<%=XiaoLu.UserName%> />
  <tr>
    <td height="25" class=tablebody2></td>
    <td class=tablebody2><input type="submit" name="Submit4" value=" 填写完成 , 提交 " /></td>
  </tr>
</form>
</table>
<%
End If
End Sub

Sub SignIn_Save()
	Dvbbs.stats="提交"
	Dvbbs.LoadTemplates("")
	Dvbbs.Nav()
	Dvbbs.Head_var 0,0,"我的办公室","Plus_ForumOffice_Index.asp"
	XiaoLu.Channel()

Dim LuRs,SignInDate

	Set Rs=Dvbbs.Plus_Execute("Select top 1 * from [Dv_LuZiOffice_SignIn] order by ID desc")

	If Rs.Eof Then
		SignInDate = Cint(XiaoLu.Setting(9))
	Else
		SignInDate = DateDiff("d", Rs(4), Now())
		
	End If

Rs.Close
Set Rs = Nothing

	If Cint(SignInDate) < Cint(XiaoLu.Setting(9)) Then

		ErrCodes=ErrCodes + "<li>" + "相隔 "&XiaoLu.Setting(9)&" 天才能创建一次签到记录，你现在又来了，想捣乱？兄弟们,放狗咬人....."
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"
		Response.End()

	Else
		if request("SignInTitle")="" then

		ErrCodes=ErrCodes + "<li>" + "[记录标题]不能为空！"
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

		Elseif request("SignInAction")="" then

		ErrCodes=ErrCodes + "<li>" + "[本期通告]不能为空，做人不要太懒哦！"
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

		Elseif request("SignInAction")="" then

		ErrCodes=ErrCodes + "<li>" + " [本期通告]不能为空，做人不要太懒哦！"
		Response.redirect "showerr.asp?ErrCodes="&ErrCodes&"&action=OtherErr"

		Else

	Set Rs=Dvbbs.Plus_Execute("Select top 1 * from [Dv_LuZiOffice_SignIn] order by ID desc")

		If Rs.eof then
		Else

			Dim ID
			ID=Rs(0)
			Set Rs=Dvbbs.Plus_Execute("update [Dv_LuZiOffice_SignIn] set SignInClass='" & Request.Form("SignInClass") & "' Where ID="&ID&"")
		
		End If

			Set Rs=Dvbbs.Plus_Execute("insert into [Dv_LuZiOffice_SignIn](UserName,System,SignInTitle,SignInAction) Values('"&request("UserName")&"',"&request("System")&",'"&request("SignInTitle")&"','"&request("SignInAction")&"')")
			XiaoLu.SignInMessage()

			Dvbbs.Dvbbs_Suc("新一条斑竹记录发布成功，恭喜您老。")
		End If
	End If
End Sub

%>