<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_Sales")="0" AND (Session("Manager")="1" OR (JudgePopedomTF(Session("UserName"),"SK600000000") AND JudgePopedomTF(Session("UserName"),"SK600000100")))) then Call ReturnError()%>
<%
if not isnumeric(JCID(F("ID"))) then Call ReturnError10()
set rs=server.createobject("adodb.recordset")
if Session("Manager")=1 or Session("Manager")=2 then
sql="SELECT * from SK_Services where ServicesID="&JCID(F("ID"))&""
elseif Session("Manager")=3 then
sql="SELECT * from SK_Services INNER JOIN SK_SystemUsers ON SK_Services.SK_SalesID=SK_SystemUsers.UsersID where SK_Services.SK_SystemUsers.SK_Dept1="&Session("Dept1")&" and SK_Services.SK_Services.ServicesID="&JCID(F("ID"))&""
elseif Session("Manager")=4 then
sql="SELECT * from SK_Services INNER JOIN SK_SystemUsers ON SK_Services.SK_SalesID=SK_SystemUsers.UsersID where SK_Services.SK_SystemUsers.SK_Dept1="&Session("Dept1")&" and SK_SystemUsers.SK_Dept2="&Session("Dept2")&" and SK_Services.SK_Services.ServicesID="&JCID(F("ID"))&""
elseif Session("Manager")=5 then
sql="SELECT * from SK_Services INNER JOIN SK_SystemUsers ON SK_Services.SK_SalesID=SK_SystemUsers.UsersID where SK_Services.SK_SystemUsers.SK_Dept1="&Session("Dept1")&" and SK_SystemUsers.SK_Dept2="&Session("Dept2")&" and SK_SystemUsers.SK_Dept3="&Session("Dept3")&" and SK_Services.SK_Services.ServicesID="&JCID(F("ID"))&""
elseif Session("Manager")=6 then
sql="SELECT * from SK_Services where SK_SalesID="&Session("UID")&" and ServicesID="&JCID(F("ID"))&""
end if
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="12%" class="SK_Text2">关联客户</td>
  <td width="35%" class="SK_Text1"><%
set rsClient=server.createobject("adodb.recordset")
sqlClient="select * from SK_Client where ClientID="&Rs("SK_ClientID")&""
rsClient.open sqlClient,conn,1,1
if rsClient.eof and rsClient.bof then Call ReturnError13()
Response.write""&RsClient("SK_Wname")&""
RsClient.close
Set RsClient=nothing
%></td>
  <td width="12%" class="SK_Text2">客服编号</td>
  <td width="41%" class="SK_Text1"><%=Rs("SK_SNo")%></td>
</tr>
<tr>
  <td class="SK_Text2">客服主题</td>
  <td class="SK_Text1"><%=Rs("SK_STitle")%></td>
  <td class="SK_Text2">客服日期</td>
  <td class="SK_Text1"><%=Rs("SK_ATime")%></td>
</tr>
<tr>
  <td class="SK_Text2">客服类别</td>
  <td class="SK_Text1">
<%
set RsClass=server.createobject("adodb.recordset")
SqlClass="select * from SK_SystemCategory where SK_Di=101 and CategoryID="&RS("SK_Di")&""
RsClass.open SqlClass,conn,1,1
Response.write""&RsClass("SK_Name")&""
RsClass.close
Set RsClass=Nothing
%></td>
  <td class="SK_Text2">客服状态</td>
  <td class="SK_Text1"><%
set RsFeet=server.createobject("adodb.recordset")
SqlFeet="select * from SK_SystemCategory where SK_Di=103 and CategoryID="&RS("SK_Feet")&""
RsFeet.open SqlFeet,conn,1,1
Response.write""&RsFeet("SK_Name")&""
RsFeet.close
Set RsFeet=Nothing
%></td>
</tr>
<tr>
  <td class="SK_Text2">紧急程度</td>
  <td class="SK_Text1">
<%
set RsLevel=server.createobject("adodb.recordset")
SqlLevel="select * from SK_SystemCategory where SK_Di=104 and CategoryID="&Rs("SK_Level")&""
RsLevel.open SqlLevel,conn,1,1
Response.write"<font color=""#999999"">"&RsLevel("SK_Name")&"</font> "
RsLevel.close
Set RsLevel=Nothing
%></td>
  <td class="SK_Text2">客户方式</td>
  <td class="SK_Text1"><%
set RsMode=server.createobject("adodb.recordset")
SqlMode="select * from SK_SystemCategory where SK_Di=102 and CategoryID="&Rs("SK_Mode")&""
RsMode.open SqlMode,conn,1,1
Response.write"<font color=""#999999"">"&RsMode("SK_Name")&"</font> "
RsMode.close
Set RsMode=Nothing
%></td>
</tr>

<tr>
  <td class="SK_Text2">负责人员</td>
  <td class="SK_Text1"><%=Rs("SK_Aname")%></td>
  <td class="SK_Text2">所用时间</td>
  <td class="SK_Text1"><%=Rs("SK_Ntime")%></td>
</tr>

<%
'自定义选项开始
set RsOptions=server.createobject("adodb.recordset")
sqlOptions="SELECT * from SK_ServiceOptions 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" 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=""12%"">"&RsOptions("SK_Title")&"</td><td class=""SK_Text1"">"

Set rs1=Server.CreateObject("ADODB.RecordSet") 
sql1="SELECT * from SK_ServiceOptionsDetail 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_ServiceField 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" 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=""12%"">"&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 colspan="3" valign="top" class="SK_FContent"><%=Rs("SK_Content")%></td>
</tr>
<tr>
  <td valign="top" class="SK_Text2">处理意见</td>
  <td colspan="3" valign="top" class="SK_FContent"><%=Rs("SK_Content1")%></td>
</tr>
<tr>
  <td valign="top" class="SK_Text2">处理结果</td>
  <td colspan="3" valign="top" class="SK_FContent"><%=Rs("SK_Content2")%></td>
</tr>
<tr>
  <td colspan="4" class="SK_Title1">其他信息</td>
</tr>
<tr>
  <td class="SK_Text2">客服人员</td>
  <td class="SK_Text1"><%
set RsSales=server.createobject("adodb.recordset")
SqlSales="select * from SK_SystemUsers where UsersID="&RS("SK_SalesID")&""
RsSales.open SqlSales,conn,1,1
Response.write""&RsSales("SK_OName")&""
RsSales.close
Set RsSales=Nothing
%></td>
  <td class="SK_Text2">&nbsp;</td>
  <td class="SK_Text1">&nbsp;</td>
</tr>
<tr>
  <td class="SK_Text2">创建人员</td>
  <td class="SK_Text1"><%=Rs("SK_Addor")%></td>
  <td class="SK_Text2">新建时间</td>
  <td class="SK_Text1"><%=Rs("SK_Time")%></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%>
<tr>
<td colspan="4" class="SK_Text">
<input type="button" value=" 打印 " class="button1" onclick="location.href='SK.PrintServices.asp?ID=<%=Rs("ServicesID")%>'">
<input type="button" value=" 关闭 " onClick="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>