<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_Office")="0" AND (Session("Manager")="1" OR (JudgePopedomTF(Session("UserName"),"SK100000000") AND JudgePopedomTF(Session("UserName"),"SK100000500")))) then Call ReturnError()%>
<%
if Not isnumeric(JCID(F("ID"))) then Call ReturnError10()
set rs=server.createobject("adodb.recordset")
sql="SELECT * from SK_OfficeWorkLog where SK_Del=0 and WorkLogID="&JCID(F("ID"))&""
rs.Open sql,conn,1,3
if rs.eof and rs.bof then Call ReturnError4()

if RQ("Action")="DelDP" and F("RID")<>"" then
conn.execute("delete from SK_OfficeWorkLogReply where RWorkLogID="&JCID(F("RID"))&" and SK_SalesID="&Session("UID")&"")
'Event Begin
if getconfig("SK_Event")=0 then
set rsEvent=server.createobject("adodb.recordset")
sqlEvent="select * from SK_SystemEvent"
rsEvent.open sqlEvent,conn,1,3
rsEvent.AddNew
rsEvent("SK_Title")="删除点评内容"
rsEvent("SK_User")=Session("UserName")
rsEvent("SK_Time")=Now()
rsEvent("SK_IP")=request.ServerVariables("Remote_Addr")
rsEvent.Update
rsEvent.Close 
set rsEvent=Nothing
end if
'Event End
Call Returnokback()
end if
'Delete end
%>
<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>

<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="11%" class="SK_Text2">日志主题</td>
  <td colspan="3" class="SK_Text1"><%=Rs("SK_Title")%></td>
  </tr>
<tr>
  <td class="SK_Text2">工作日期</td>
  <td colspan="3" class="SK_Text1"><%=Rs("SK_Ftime")%></td>
  </tr>

<tr>
  <td valign="top" class="SK_Text2">工作内容</td>
  <td colspan="3" valign="top" class="SK_FContent"><%=Rs("SK_Content")%></td>
</tr>
<%
'自定义选项开始
set RsOptions=server.createobject("adodb.recordset")
sqlOptions="SELECT * from SK_OfficeOptions where SK_Di=0 and SK_ShowOnForm=0 Order by SK_OrderID asc"
RsOptions.Open sqlOptions,conn,1,1
if RsOptions.bof and RsOptions.eof then
else
%>
<tr>
<td colspan="4" class="SK_Title1">自定义选项</td>
</tr>
<tr>
  <td colspan="4" valign="top" class="SK_Text1">
<%
Response.write"<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""1"">"
for Optionsi=1 to RsOptions.recordCount '变量i从1循环到数据库中的全部记录数 
if (Optionsi mod 2 =1) then '每个tr即每行显示1个记录,可根据需要自行修改, 将左边的1修改为2即显示两行。
response.write "<tr>" 
end if
Response.write"<td class=""SK_Text2"" width=""11%"">"&RsOptions("SK_Title")&"</td><td class=""SK_Text1"">"

Set rs1=Server.CreateObject("ADODB.RecordSet") 
sql1="SELECT * from SK_OfficeOptionsDetail where SK_OptionsID="&RsOptions("FieldID")&" and OptionsDetailID="&rs(""&RsOptions("SK_FieldName")&"")&"" 
rs1.Open sql1,conn,1,1
Response.write""&rs1("SK_OName")&""
rs1.close
set rs1=Nothing

Response.write"</td>"
if (Optionsi mod 2 = 0) then '每个tr即每行显示1个记录,可根据需要自行修改, 将左边的1修改为2即显示两行。
response.write "</tr>" 
end if 
RsOptions.movenext 
next 
Response.write"</table>"
%>
</td>
</tr>
<%
end if
RsOptions.close
set RsOptions=Nothing
'自定义选项结束
'自定义字段开始
set RsFields=server.createobject("adodb.recordset")
sqlFields="SELECT * from SK_OfficeFields where SK_Di=0 and SK_ShowOnForm=0 Order by SK_OrderID asc"
RsFields.Open sqlFields,conn,1,1
if RsFields.bof and RsFields.eof then
else
%>  
<tr>
<td colspan="4" class="SK_Title1">自定义字段</td>
</tr>
<tr>
  <td colspan="4" valign="top" class="SK_Text1">
<%
Response.write"<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""1"">"
for Fieldsi=1 to RsFields.recordCount '变量i从1循环到数据库中的全部记录数 
if (Fieldsi mod 2 =1) then '每个tr即每行显示1个记录,可根据需要自行修改, 将左边的1修改为2即显示两行。
response.write "<tr>" 
end if
Response.write"<td class=""SK_Text2"" width=""11%"">"&RsFields("SK_Title")&"</td><td class=""SK_Text1"">"&Rs(""&RsFields("SK_FieldName")&"")&"</td>"
if (Fieldsi mod 2 = 0) then '每个tr即每行显示1个记录,可根据需要自行修改, 将左边的1修改为2即显示两行。
response.write "</tr>" 
end if 
RsFields.movenext 
next 
Response.write"</table>"
%>
</td>
</tr>
<%
end if
RsFields.close
set RsFields=Nothing
'自定义字段结束
%>
<tr>
<td colspan="4" class="SK_Title1">其他信息</td>
</tr>
<tr>
  <td valign="top" class="SK_Text2">填写人员</td>
  <td width="45%" class="SK_Text1"><%
set RsFuser=server.createobject("adodb.recordset")
SqlFuser="select * from SK_SystemUsers where UsersID="&Rs("SK_SalesID")&""
RsFuser.open SqlFuser,conn,1,1
set rs10=server.createobject("adodb.recordset")
sql10="select * from SK_SystemDept where LID="&RsFuser("SK_Dept1")&""
rs10.open sql10,conn,1,1
Response.write""&Rs10("LName")&" >> "
set rs11=server.createobject("adodb.recordset")
sql11="select * from SK_SystemDept where LID="&RsFuser("SK_Dept2")&""
rs11.open sql11,conn,1,1
Response.write""&Rs11("LName")&" >> "
set rs12=server.createobject("adodb.recordset")
sql12="select * from SK_SystemDept where LID="&RsFuser("SK_Dept3")&""
rs12.open sql12,conn,1,1
Response.write""&Rs12("LName")&" >> "&RsFuser("SK_Oname")&""
RsFuser.close
RsFuser=Nothing
%></td>
  <td width="11%" class="SK_Text2">填写时间</td>
  <td width="33%" class="SK_Text1"><%=Rs("SK_Atime")%></td>
</tr>
<%if Rs("SK_Editor")<>"0" then%>
<tr>
  <td class="SK_Text2">修改人员</td>
  <td class="SK_Text1"><%
set RsEditor=server.createobject("adodb.recordset")
SqlEditor="select * from SK_SystemUsers where UsersID="&Rs("SK_Editor")&""
RsEditor.open SqlEditor,conn,1,1
Response.write""&RsEditor("SK_Oname")&""
RsEditor.close
Set RsEditor=Nothing
%></td>
  <td class="SK_Text2">修改时间</td>
  <td class="SK_Text1"><%=Rs("SK_Etime")%></td>
</tr>
<%end if%>

<!--点评列表开始-->
<%
Dim RsDP,i
set rsDP=Server.createobject("adodb.recordset")
sqlDP="select * from SK_OfficeWorkLogReply where SK_WorkLogID="&Rs("WorkLogID")&" order by RWorkLogID asc"
rsDP.open sqlDP,conn,1,1
if rsDP.eof and rsDP.bof then
else
%>
<tr>
<td colspan="4" class="SK_Title1">日志点评</td>
</tr>
<%
i=0
while not rsDP.eof
i=i+1
%>
<tr>
  <td valign="top" class="SK_Text2"><%=RsDP("SK_Atime")%></td>
  <td colspan="3" class="SK_Text1"><%=RsDP("SK_Content")%>  <%if Session("UID")=RsDP("SK_SalesID") and (Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK100000502")) then%> [ <a href="javascript:void(0)" onClick="javascript:var win=window.open('SK.ModWLDP.asp?id=<%=RsDP("RWorkLogID")%>','Mod','width=820,height=400,top=170,left=161,center:yes,status:no,help:no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes'); win.focus()"><font color="#999999">修改</font></a> | <a onClick="return confirm('删除点评内容，是否继续吗？')" href="?Action=DelDP&ID=<%=Rs("WorkLogID")%>&RID=<%=RsDP("RWorkLogID")%>"><font color="#999999">删除</font></a> ]<%end if%> <br><font color=red>(点评人：<%
set RsDPren=server.createobject("adodb.recordset")
SqlDPren="select * from SK_SystemUsers where UsersID="&Rs("SK_SalesID")&""
RsDPren.open SqlDPren,conn,1,1
%> 
<%
set rs13=server.createobject("adodb.recordset")
sql13="select * from SK_SystemDept where LID="&RsDPren("SK_Dept1")&""
rs13.open sql13,conn,1,1
%>
  <%=Rs13("LName")%> >>
  <%
set rs14=server.createobject("adodb.recordset")
sql14="select * from SK_SystemDept where LID="&RsDPren("SK_Dept2")&""
rs14.open sql14,conn,1,1
%>
  <%=Rs14("LName")%> >>
  <%
set rs15=server.createobject("adodb.recordset")
sql15="select * from SK_SystemDept where LID="&RsDPren("SK_Dept3")&""
rs15.open sql15,conn,1,1
%>
<%=Rs15("LName")%> >>

<%=RsDPren("SK_Oname")%>
<%
RsDPren.close
RsDPren=Nothing
%> )</font></td>
</tr>
<%
rsDP.movenext
wend
end if
rsDP.close
set rsDP=Nothing
%> 
<tr>
<td colspan="4" class="SK_Text">
<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>