<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include file="../Inc/Conn.asp" -->
<!--#include file="../Inc/SK.Session.asp" -->
<!--#include file="../Inc/SK.Funtion.asp" -->
<%if Not (Getconfig("SK_Finance")="0" AND (Session("Manager")="1" OR (JudgePopedomTF(Session("UserName"),"SK700000000") AND JudgePopedomTF(Session("UserName"),"SK700000700")))) then Call ReturnError()%>
<%
if Not isnumeric(JCID(F("ID"))) then Call ReturnError10()
set rs=server.createobject("adodb.recordset")
sql="SELECT * from SK_Wages where WagesID="&JCID(F("ID"))&""
rs.Open sql,conn,1,1
if rs.eof and rs.bof then Call ReturnError4()
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>查看员工工资</title>
<META http-equiv=Page-Enter content=SKCRM>
<META http-equiv=Page-Exit content=SKCRM>
<META content="MSHTML 6.00.3790.2858" name=GENERATOR>
<LINK href="../images/style.css" type=text/css rel=stylesheet>
<script language="javascript" src="../Inc/Check.js"></script>
<script language="javascript" src="../Inc/Calendar.js"></script>
<script language="javascript" src="../Inc/jquery.js"></script>
<SCRIPT language=javascript src="../inc/Openwin.js"></SCRIPT>
<style type="text/css">
<!--
body {
margin: 5px 0px 5px 0px;
overflow-x: hidden;
}
-->
</style>
</head>
<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<TBODY>
<tr>
<td class="SK_Td_Top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="25"><img src="../images/tab_03.gif" width="12" height="25" /></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="46%" valign="middle">查看员工工资</td>
<td width="54%"></td>
</tr>
</table></td>
<td width="16"><img src="../images/tab_07.gif" width="16" height="25" /></td>
</tr>
</table></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8" background="../images/tab_12.gif"></td>
<td>

<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
  <td width="14%" class="SK_Text2">工资主题</td>
  <td class="SK_Text1"><%=Rs("SK_Title")%></td>
  </tr>
  
<tr>
  <td class="SK_Text2">发放状态</td>
  <td class="SK_Text1"><%if Rs("SK_Feet")=0 then Response.write"<font color=blue>未发放</font>" else Response.write"<font color=red>已发放</font>" end if%></td>
</tr>

<tr>
  <td class="SK_Text2">发放日期</td>
  <td class="SK_Text1"><%=Rs("SK_Atime")%></td>
</tr>

<tr>
  <td valign="top" class="SK_Text2">备注</td>
  <td class="SK_Text1"><%=Rs("SK_Content")%></td>
</tr>

<tr>
  <td colspan="2" class="SK_Title1">工资列表</td>
</tr>
<tr>
  <td colspan="2" class="SK_Text">
<!--工资列表开始-->
<%
set rsYg=Server.createobject("adodb.recordset")
sqlYg="select * from SK_WagesDetail where SK_WagesID="&Rs("WagesID")&" order by WagesDetailID asc"
rsYg.open sqlYg,conn,1,1
if rsYg.bof and rsYg.eof then 
Response.write"对不起，还没有工资信息。"
else
%>
<TABLE width="100%" border=1 align="center" cellPadding=1 cellSpacing=0 borderColor=#ffffff borderColorLight=#dfdfdf borderColorDark=#ffffff>
<tr>
<th width="6%" class="Pheadtd">员工姓名</th>
<%
set rsxx=Server.createobject("adodb.recordset")
sqlxx="select * from SK_WagesOption where SK_Di=0 order by WOptionID asc"
rsxx.open sqlxx,conn,1,1
A=0
while not rsxx.eof
A=A+1
Response.write"<th width=""6%"" class=""Pheadtd"">"&rsxx("SK_WName")&"</th>"
rsxx.movenext
wend
rsxx.close
Set rsxx=Nothing

set rscc=Server.createobject("adodb.recordset")
sqlcc="select * from SK_WagesOption where SK_Di=1 order by WOptionID asc"
rscc.open sqlcc,conn,1,1
C=0
while not rscc.eof
C=C+1
Response.write"<th width=""6%"" class=""Pheadtdred"">"&rscc("SK_WName")&"</th>"
rscc.movenext
wend
rscc.close
Set rscc=Nothing
%>
<th width="6%" class="Pheadtd">应发金额</th>
<th width="6%" class="Pheadtd">应扣金额</th>
<th width="6%" class="Pheadtd">实发金额</th>
</tr>
<%
J=0
while not rsYg.eof
J=J+1
%>
<tr>
<td class="Ptetd">
<%
set rsau=Server.createobject("adodb.recordset")
sqlau="select * from SK_SystemUsers where UsersID="&rsYg("SK_UsersID")&""
rsau.open sqlau,conn,1,1
Response.write""&rsau("SK_Oname")&""
rsau.close
Set rsau=Nothing
%>
</td>
<%
set rsyy=Server.createobject("adodb.recordset")
sqlyy="select * from SK_WagesOption where SK_Di=0 order by WOptionID asc"
rsyy.open sqlyy,conn,1,1
B=0
while not rsyy.eof
B=B+1
Response.write"<td class=""Ptetd"">"&rsYg("SK_AA"&B)&"</td>"
rsyy.movenext
wend
rsyy.close
Set rsyy=Nothing

set rsdd=Server.createobject("adodb.recordset")
sqldd="select * from SK_WagesOption where SK_Di=1 order by WOptionID asc"
rsdd.open sqldd,conn,1,1
D=0
while not rsdd.eof
D=D+1
Response.write"<td class=""Ptetd"">"&rsYg("SK_BB"&D)&"</td>"
rsdd.movenext
wend
rsdd.close
Set rsdd=Nothing

set RsAG=server.createobject("adodb.recordset")
SqlAG="select sum(SK_AA1+SK_AA2+SK_AA3+SK_AA4+SK_AA5+SK_AA6+SK_AA7+SK_AA8+SK_AA9+SK_AA10) as AG from SK_WagesDetail where WagesDetailID="&rsYg("WagesDetailID")&""
RsAG.open SqlAG,Conn,1,1
Jvgz=formatnumber(RsAG("AG"),2)
RsAG.close
set RsAG=Nothing

set RsBG=server.createobject("adodb.recordset")
SqlBG="select sum(SK_BB1+SK_BB2+SK_BB3+SK_BB4+SK_BB5+SK_BB6+SK_BB7+SK_BB8+SK_BB9+SK_BB10) as BG from SK_WagesDetail where WagesDetailID="&rsYg("WagesDetailID")&""
RsBG.open SqlBG,Conn,1,1
Kvgz=formatnumber(RsBG("BG"),2)
RsBG.close
set RsBG=Nothing
%>
<td class="Ptetd"><%=Jvgz%></td>
<td class="Ptetd"><font color=red><%=Kvgz%></font></td>
<td class="Ptetd"><%=formatnumber((Jvgz-Kvgz),2)%></td>
</tr>
<%
rsYg.movenext
wend
%>
</table>
<%
end if
rsYg.close
Set rsYg=Nothing
%>
<!--工资列表结束-->
</td>
</tr>
<tr>
<td colspan="2" class="SK_Text">
<%if Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK700000704") then%>
<input type="button" value=" 导出 " class="button1" onclick="location.href='SK.ExcelWagesDetail.asp?ID=<%=Rs("WagesID")%>'">
<%end if%>
<input type="button" value=" 打印 " class="button1" onclick="location.href='SK.PrintWages.asp?ID=<%=Rs("WagesID")%>'">
<input type="button" value=" 关闭 " onClick="window.opener.location.reload();window.close();" class="button1" /></td>
</tr>
</table>

</td>
<td width="8" background="../images/tab_15.gif"></td>
</tr>
</table></td>
</tr>
<tr>
<td class="SK_Td_Foot">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" height="20"><img src="../images/tab_18.gif" width="12" height="20" /></td>
<td width="98%" class="SK_Td_Page"></td>
<td width="1%"><img src="../images/tab_20.gif" width="16" height="20" /></td>
</tr>
</table>

</td>
</tr>
</TBODY>
</table>
</body>
<%
Call CloseDB()
%>
</html>