<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"--><script src="../HXinclude/HX_Function.js"></script><%
if WS_S.MemberPriv("WS_ManpowerResourceWageMonthView")<>1 then HX_GoBack "对不起,您的权限不够!",""
action=request("action"):WS_Uid=request("WS_Uid"):yyyy=request("yyyy")
if (WS_Uid<>"" and not isnumeric(WS_Uid)) or WS_Uid="" or isnull(WS_Uid) then HX_GoBack "参数错误",""
ColumnName="":Tablename="HX_Wageinfo":Orderby=" where WS_Uid="&WS_Uid
set urs=WS_S.HX_SetRSD(ColumnName,"HX_CompanyUser",Orderby)
if urs.recordcount>0 then  Truename=urs("WS_name")
if yyyy="" then  yyyy=year(date) else  Orderby=Orderby&" and year(WS_dotime)="&yyyy&""
WS_id=request("WS_id")
if WS_id<>"" and isnumeric(WS_id) then  Orderby=Orderby&" and WS_id="&WS_id
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
select case action
  case "addWage"
   if WS_S.MemberPriv("WS_ManpowerResourceWageMonthAdd")<>1 then HX_GoBack "对不起,您的权限不够!","" 
     if conn.execute("select * from HX_Wageinfo where WS_Uid="&WS_Uid&" and WS_dotime=#"&request("yy")&"-"&request("mm")&"-"&"15"&"#").eof then
     rs.addnew:WS_M.HX_WageWSOASCOM
   else
     Call HX_GoBack(request("yy")&"年"&request("mm")&"月份的工资已添加！","")
   end if
 case "editWage"
  if WS_S.MemberPriv("WS_ManpowerResourceWageMonthEdit")<>1 then HX_GoBack "对不起,您的权限不够!","" 
  WS_M.HX_WageWSOASCOM:HX_GoBack request("yy")&"年"&request("mm")&"月份的工资修改成功！","wagelist.asp?WS_Uid="&WS_Uid 
end select
response.Write "<head><title>工资信息</title><link rel=stylesheet type=text/css href='../HXinclude/HX_Style.css'><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><script src='../HXinclude/HX_Function.js'></script></head><body topmargin='20' leftmargin='0' bottommargin='20'><table width='609'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td width='609' colspan='2' bgcolor=FFFBE8><table width='609'  border='0' cellspacing='0' cellpadding='0'><tr><td width='609' height='25' background='../hximages/titleline.gif'><font class='fontmenu'>工资信息</font></td></tr></table><table width='100%' cellspacing cellpadding><tr><td width='100%'><table width='100%' border='0' cellspacing='1' cellpadding='0' bgcolor='#613c25' height='100%'>"
select case action
 case "add"
   if WS_S.MemberPriv("WS_ManpowerResourceWageMonthAdd")<>1 then HX_GoBack "对不起,您的权限不够!","" 
	response.Write "<tr><td bgcolor=FFFBE8><table width='100%' border='0' cellpadding='3' cellspacing='1' bgcolor=BF9B73><form method='post' action='wagelist.asp' name='form1'><tr><td colspan='4'>员工管理&gt;&gt;&gt;新增员工 [ <font color='#CC0000'>"&Truename&"</font> ]<select name='yy'>"
	for i=year(date)-20 to year(date)+1
	 response.Write "<option value='"&i&"'"
	  if i=year(date) then response.Write " selected"
	  response.Write ">"&i&"</option>"
	next
	response.Write "</select> 年 <select name='mm'>"
	for i=1 to 12 
	  response.write "<option value='"&i&"'"
	  if i=month(date) then response.Write" selected"
	  response.Write ">"&i&"</option>"
	next
	response.Write "</select> 月工资信息表&nbsp;单位：<font color='#CC0000'>元</font></td></tr><tr bgcolor='#FFFBE8'><td width='79'>基本工资</td><td width='224'><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_wage' maxlength='20' size='20' onChange=""return jg_onchange()"" value='0'></td><td width='79'>提成工资</td><td width='193'><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_pay' maxlength='20' size='20' onChange=""return jg_onchange()"" value='0'></td></tr><tr><td colspan='4' bgcolor='#FFFBE8'><b>其 它 应 得 款</b></td></tr><tr bgcolor='#FFFBE8'><td width='79'>住房补贴</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_house' maxlength='20' size='20' onChange=""return jg_onchange()"" value='0'></td><td width='79'>餐费补贴</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_lunch' maxlength='20' size='20' onChange=""return jg_onchange()"" value='0'></td></tr><tr bgcolor='#FFFBE8'><td width='79'>出差补贴</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_outpay' maxlength='20' size='20' onChange=""return jg_onchange()"" value='0'></td><td width='79'>其它</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_bonus' maxlength='20' size='20' onChange=""return jg_onchange()"" value='0'></td></tr><tr><td colspan='4' bgcolor='#FFFBE8'><b>应 扣 款 项</b></td></tr><tr bgcolor='#FFFBE8'><td width='79'>考勤扣款</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_card' maxlength='20' size='20' onChange=""return jg_onchange()"" value='0'></td><td width='79'>所得税扣款</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_ratal' maxlength='20' size='20' onChange=""return jg_onchange()"" value='0'></td></tr><tr bgcolor='#FFFBE8'><td width='79'>保险扣款</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_safe' maxlength='20' size='20' onChange=""return jg_onchange()"" value='0'></td><td width='79'>其它</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_other' maxlength='20' size='20' onChange=""return jg_onchange()"" value='0'></td></tr><tr><td width='79' bgcolor='#FFFBE8'>实发薪资</td><td colspan='3' bgcolor='#FFFBE8'><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_lastmoney' maxlength='20' size='20' onChange=""return jg_onchange()"" value='0' readonly></td></tr><tr><td width='79' bgcolor='#FFFBE8'>备注</td><td colspan='3' bgcolor='#FFFBE8'><textarea name='WS_brief' cols='50' rows='5'></textarea></td></tr><tr><td width='79' bgcolor='#FFFBE8'>发放时间</td><td colspan='3' bgcolor='#FFFBE8'><select name='byy'>"
	for i=year(date)-20 to year(date)+1 
	 response.Write "<option value='"&i&"'"
      if month(date)=12 then  nnn=1 else nnn=0 
      if i=year(date)+nnn then response.Write " selected"
	 response.Write ">"&i&"</option>"
    next
	 response.Write"</select> 年<select name='bmm'>"
    for i=1 to 12
	 response.Write "<option value='"&i&"'"
     if month(date)=12 then mmm=1 else mmm=month(date)+1
      if i=mmm then response.Write" selected"
	  response.Write ">"&i&"</option>"
	next
	response.Write"</select> 月<select name='bdd'>"
   for i=1 to 31
    response.Write "<option value='"&i&"'"
	if i=1 then response.Write " selected"
	response.Write ">"&i&"</option>"
   next
   response.Write "</select> 日 </td></tr><tr align='right' bgcolor='#FFFBE8'><td colspan=4><input type='submit' name='提交' value='添加工资信息'><input type='hidden' name='action' value='addWage'><input type='hidden' name='WS_Uid' value='"&WS_Uid&"'></td></tr></form></table></td></tr>"
   
   case "view"
      response.write "<tr><td bgcolor=FFFBE8><table width='100%' border='0' cellpadding='3' cellspacing='1' bgcolor=BF9B73><tr><td colspan='4' class=td4>员工<font color='#CC0000'>"&Truename&"</font>"&year(rs("WS_dotime"))&"年"&month(rs("WS_dotime"))&"月工资信息表&nbsp;<a href='wagelist.asp?action=add&WS_Uid="&WS_Uid&"'><font color='#0000FF'>新增</font></a> &nbsp;"
	  if datediff("d",date,rs("WS_givetime"))>0 then response.write "<a href='wagelist.asp?action=edit&WS_id="&WS_id&"&WS_Uid="&WS_Uid&"'><font color='#0000FF'>编辑</font></a>"
	   response.write "&nbsp;<a href='wagelist.asp?WS_Uid="&WS_Uid&"'><font color='#0000FF'>查询</font></a>&nbsp;&nbsp;<a href='wagemonth.asp?mmmm="&rs("WS_dotime")&"'><font color='#0000FF'>当月工资报表</font></a></td></tr><tr bgcolor='#FFFBE8'><td width='83'>基本工资</td><td width='189'>"&rs("WS_wage")&"&nbsp;</td><td width='108'>提成工资</td><td width='195'>"&rs("WS_pay")&"&nbsp;</td></tr><tr bgcolor='#FFFBE8'><td colspan='4'><b>其 它 应 得 款</b></td></tr><tr bgcolor='#FFFBE8'><td width='83'>住房补贴</td><td width='189'>"&rs("WS_house")&"&nbsp;</td><td width='108'>餐费补贴</td><td width='195'>"&rs("WS_lunch")&"&nbsp;</td></tr><tr bgcolor='#FFFBE8'><td width='83'>出差补贴</td><td width='189'>"&rs("WS_outpay")&"&nbsp;</td><td width='108'>其它</td><td width='195'>"&rs("WS_bonus")&"&nbsp;</td></tr><tr bgcolor='#FFFBE8'><td colspan='4' align=left><b>应 扣 款 项</b></td></tr><tr bgcolor='#FFFBE8'><td width='83'>考勤扣款</td><td width='189'>"&rs("WS_card")&"&nbsp;</td><td width='108'>所得税扣款</td><td width='195'>"&rs("WS_ratal")&"&nbsp;</td></tr><tr bgcolor='#FFFBE8'><td width='83'>保险扣款</td><td width='189'>"&rs("WS_safe")&"&nbsp;</td><td width='108'>其它</td><td width='195'>"&rs("WS_other")&"&nbsp;</td></tr><tr bgcolor='#FFFBE8'><td width='83'>实发薪资</td><td colspan='3'>"&rs("WS_lastmoney")&"&nbsp;</td></tr><tr bgcolor='#FFFBE8'><td width='83'>备注</td><td colspan='3'>"&rs("WS_brief")&"&nbsp;</td></tr><tr bgcolor='#FFFBE8'><td width='83'>发放时间</td><td colspan='3'>"&WS_S.Format_Time(rs("WS_givetime"),5)&"&nbsp;</td></tr></table></td></tr>"
   
   case "edit"
   if WS_S.MemberPriv("WS_ManpowerResourceWageMonthEdit")<>1 then HX_GoBack "对不起,您的权限不够!",""
     response.Write "<tr><td bgcolor=FFFBE8><table width='100%' border='0' cellpadding='3' cellspacing='1' bgcolor=BF9B73><form method='post' action='wagelist.asp' name='form1'><tr><td colspan='4'>员工管理&gt;&gt;&gt;修改员工 [ <font color='#CC0000'>"&Truename&"</font> ]<select name='yy'>"
	 for i=year(date)-20 to year(date)+1
	   response.Write "<option value='"&i&"'"
	   if i=year(date) then response.Write" selected"
	   response.Write ">"&i&"</option>"
	 next
	 response.Write "</select>年 <select name='mm'>"
	 for i=1 to 12&"<option value='"&i&"'"
	   if i=month(date) then response.Write" selected"
	    response.Write ">"&i&"</option>"
	next
	response.Write "</select>月工资信息表&nbsp;单位：<font color='#CC0000'>元</font></td></tr><tr bgcolor='#FFFBE8'><td width='79'>基本工资</td><td width='224'><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_wage' maxlength='20' size='20' onChange=""return jg_onchange()"" value='"&rs("WS_wage")&"'></td><td width='79'>提成工资</td><td width='193'><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_pay' maxlength='20' size='20' onChange=""return jg_onchange()"" value='"&rs("WS_pay")&"'></td></tr><tr><td colspan='4' bgcolor='#FFFBE8'><b>其 它 应 得 款</b></td></tr><tr bgcolor='#FFFBE8'><td width='79'>住房补贴</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_house' maxlength='20' size='20' onChange=""return jg_onchange()"" value='"&rs("WS_house")&"'></td><td width='79'>餐费补贴</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_lunch' maxlength='20' size='20' onChange=""return jg_onchange()"" value='"&rs("WS_lunch")&"'></td></tr><tr bgcolor='#FFFBE8'><td width='79'>出差补贴</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_outpay' maxlength='20' size='20' onChange=""return jg_onchange()"" value='"&rs("WS_outpay")&"'></td><td width='79'>其它</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_bonus' maxlength='20' size='20' onChange=""return jg_onchange()"" value='"&rs("WS_bonus")&"'></td></tr><tr><td colspan='4' bgcolor='#FFFBE8'><b>应 扣 款 项</b></td></tr><tr bgcolor='#FFFBE8'><td width='79'>考勤扣款</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_card' maxlength='20' size='20' onChange=""return jg_onchange()"" value='"&rs("WS_card")&"'></td><td width='79'>所得税扣款</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_ratal' maxlength='20' size='20' onChange=""return jg_onchange()"" value='"&rs("WS_ratal")&"'></td></tr><tr bgcolor='#FFFBE8'><td width='79'>保险扣款</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_safe' maxlength='20' size='20' onChange=""return jg_onchange()"" value='"&rs("WS_safe")&"'></td><td width='79'>其它</td><td><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_other' maxlength='20' size='20' onChange=""return jg_onchange()"" value='"&rs("WS_other")&"'></td></tr><tr><td width='79' bgcolor='#FFFBE8'>实发薪资</td><td colspan='3' bgcolor='#FFFBE8'><input style='ime-mode:disabled' onKeyPress='event.returnValue=IsDigit();' type='text' name='WS_lastmoney' maxlength='20' size='20' onChange=""return jg_onchange()"" value='"&rs("WS_lastmoney")&"' readonly></td></tr><tr><td width='79' bgcolor='#FFFBE8'>备注</td><td colspan='3' bgcolor='#FFFBE8'><textarea name='WS_brief' cols='50' rows='5'></textarea></td></tr><tr><td width='79' bgcolor='#FFFBE8'>发放时间</td><td colspan='3' bgcolor='#FFFBE8'><select name='byy'>"
	for i=year(date)-20 to year(date)+1 
	response.Write"<option value='"&i&"'"
       if month(date)=12 then nnn=1 else nnn=0 
          if i=year(date)+nnn then response.Write " selected"
	   response.Write ">"&i&"</option>"
	 next
	 response.Write "</select>年  <select name='bmm'>"
	 for i=1 to 12
	 response.Write "<option value='"&i&"' "
       if month(date)=12 then mmm=1 else mmm=month(date)+1
        if i=mmm then response.Write " selected"
		response.Write ">"&i&"</option>"
	 next
	 response.Write "</select>月 <select name='bdd'>"
	 for i=1 to 31
	 response.Write "<option value='"&i&"'"
	   if i=1 then respone.write " selected"
	 response.Write ">"&i&"</option>"
	 next
	   response.Write"</select>日 </td></tr><tr align='right' bgcolor='#FFFBE8'><td colspan=4><input type='submit' name='提交' value='修改工资信息'><input type='hidden' name='action' value='editWage'><input type='hidden' name='WS_Uid' value='"&WS_Uid&"'><input type='hidden' name='WS_id' value='"&WS_id&"'></td></tr></form></table></td></tr>"
  case else
     response.Write "<tr><td height='27' bgcolor=FFFBE8>&nbsp;员工管理&gt;&gt;&gt;员工[ <font color='#CC0000'>"&Truename&"</font> ]<select name='yy' onChange=""window.location='wagelist.asp?WS_Uid="&WS_Uid&"&yyyy='+this.value"">"
	 for i=year(date)-20 to year(date)+1
	 response.Write "<option value='"&i&"'"
	   if i=cint(yyyy) then response.Write " selected"
		response.Write ">"&i&"</option>"
	 next
	 response.Write "</select>年工资信息表 &nbsp;<a href='wagelist.asp?action=add&WS_Uid="&WS_Uid&"'><font color='#0000FF'>新增</font></a> &nbsp; &nbsp;<a href='wagelist.asp?WS_Uid="&WS_Uid&"'><font color='#0000FF'>查询</font></a></span></td></tr>"
     if rs.recordcount>0 then
       response.Write "<tr><td bgcolor=FFFBE8><table width='100%' border='0' cellpadding='3' cellspacing='1' bgcolor=BF9B73><tr bgcolor='BF9B73' class=td34><td>月份</td><td>基本薪资</td><td>提成工资</td><td colspan='4'>其它应得款</td><td colspan='4'>应扣款项</td><td>实发薪资</td></tr><tr bgcolor=FFFBE8><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>住房补贴</td><td>餐费补贴</td><td>出差补贴</td><td>其它</td><td>考勤扣款</td><td>所得税</td><td>保险扣款</td><td>其它</td><td>&nbsp;</td></tr>"
	   rs.PageSize =15 '每页记录条数
	   iCount=rs.RecordCount '记录总数
	    iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    
      if Not IsNumeric(page) or page="" then
        page=1
      else
        page=cint(page)
      end if
    
     if page<1 then
        page=1
     elseif  page>maxpage then
        page=maxpage
     end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	i=0
	do while not rs.EOF
      response.Write "<tr "
	  if i mod 2 =0 then response.write "bgcolor=#FFFBE8" else response.write "bgcolor=#FFFBE8"
	  response.Write "><td><a href='wagelist.asp?action=view&WS_id="&rs("WS_id")&"&WS_Uid="&WS_Uid&"'><b><font color='#0000FF'>"&month(rs("WS_dotime"))&"</font></b></a></td><td>"&rs("WS_wage")&"</td><td>"&rs("WS_pay")&"</td><td>"&rs("WS_house")&"</td><td>"&rs("WS_lunch")&"</td><td>"&rs("WS_outpay")&"</td><td>"&rs("WS_bonus")&"</td><td>"&rs("WS_card")&"</td><td>"&rs("WS_ratal")&"</td><td>"&rs("WS_safe")&"</td><td>"&rs("WS_other")&"</td><td>"&rs("WS_lastmoney")&"</td></tr>"
	  i=i+1
	  if i>=rs.PageSize then Exit Do
	    rs.movenext
        loop
        call WS_S.PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>",12)
        response.Write "</table></td></tr><tr bgcolor='#FFFBE8'><td height='30' align=right>&nbsp;<input type='button' name='WS_Submit23' value='合同信息' onClick=""javascript:location.href='compactinfo.asp?WS_Uid="&WS_Uid&"';""> <input type='button' name='WS_Submit2' value='工资信息' onclick=""javascript:location.href='wagelist.asp?WS_Uid="&WS_Uid&"';""> <input type='button' name='WS_Submit22' value='修改"&Truename&"资料' onClick=""javascript:location.href='domodify.asp?WS_Uid="&WS_Uid&"';""> <input type='button' name='WS_Submit2' value=' 返 回 ' onclick='javascript:history.go(-1);'> <input type='button' name='WS_Submit2' value=' 打 印 ' onclick='javascript:print();'></td></tr>"
     end if
end select
response.Write "</table></td></tr></table></td></tr></table>"
%>