<!--#include file="Admin_Common.asp"-->
<!--#include file="Admin_CommonCode_CRM.asp"-->
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005－2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************

Const NeedCheckComeUrl = True   '是否需要检查外部访问

Const PurviewLevel = 2      '0--不检查，1--超级管理员，2--普通管理员
Const PurviewLevel_Channel = 0   '0--不检查，1--频道管理员，2--栏目总编，3--栏目管理员
Const PurviewLevel_Others = ""   '其他权限

Dim arrServiceType, arrServiceMode, arrTakeTime, arrResult, arrConfirmScore

'检查管理员操作权限
If AdminPurview > 1 Then
    arrPurview(0) = CheckPurview_Other(AdminPurview_Others, "Service_View")
    arrPurview(1) = CheckPurview_Other(AdminPurview_Others, "Service_Add")
    arrPurview(2) = CheckPurview_Other(AdminPurview_Others, "Service_ModifyOwn")
    arrPurview(3) = CheckPurview_Other(AdminPurview_Others, "Service_ModifyAll")
    arrPurview(4) = CheckPurview_Other(AdminPurview_Others, "Service_Del")
    arrPurview(5) = CheckPurview_Other(AdminPurview_Others, "Call_View")
    arrPurview(6) = CheckPurview_Other(AdminPurview_Others, "Call_Add")
    arrPurview(7) = CheckPurview_Other(AdminPurview_Others, "Call_ModifyOwn")
    arrPurview(8) = CheckPurview_Other(AdminPurview_Others, "Call_ModifyAll")
    For PurviewIndex = 0 To 4
        If arrPurview(PurviewIndex) = True Then
            PurviewPassed = True
            Exit For
        End If
    Next
    If PurviewPassed = False Then
        Response.Write "<br><p align='center'><font color='red' style='font-size:9pt'>对不起，你没有此项操作的权限。</font></p>"
        Call WriteEntry(6, AdminName, "越权操作")
        Response.End
    End If
End If

strFileName = "Admin_Service.asp?SearchType=" & SearchType & "&Field=" & strField & "&keyword=" & Keyword


Response.Write "<html>" & vbCrLf
Response.Write "<head>" & vbCrLf
Response.Write "<title>客户服务管理</title>" & vbCrLf
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & vbCrLf
Response.Write "<link rel='stylesheet' href='Admin_Style.css'>" & vbCrLf
Response.Write "</head>" & vbCrLf
Response.Write "<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>" & vbCrLf
Response.Write "<table width='100%'  border='0' cellpadding='2' cellspacing='1' class='border'>" & vbCrLf
Call ShowPageTitle("客 户 服 务 管 理", 10223)
Response.Write "  <tr class='tdbg'>" & vbCrLf
Response.Write "  <form name='form1' action='Admin_Service.asp' method='get'>" & vbCrLf
Response.Write "    <td>快速查找：" & vbCrLf
Response.Write "      <select name='SearchType' onChange='javascript:submit()'>" & vbCrLf
Response.Write "        <option " & OptionValue(SearchType, 0) & ">全部记录</option>" & vbCrLf
Response.Write "        <option " & OptionValue(SearchType, 1) & ">10天内的记录</option>" & vbCrLf
Response.Write "        <option " & OptionValue(SearchType, 2) & ">1个月内的记录</option>" & vbCrLf
Response.Write "        </select>&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
Response.Write "      <a href='Admin_Service.asp'>客户服务管理首页</a> | <a href='Admin_Service.asp?Action=Add'>添加服务记录</a></td>" & vbCrLf
Response.Write "  </form>" & vbCrLf
Response.Write "<form name='form2' method='post' action='Admin_Service.asp'>" & vbCrLf
Response.Write "    <td>高级查询：" & vbCrLf
Response.Write "      <select name='Field' id='Field'>" & vbCrLf
Response.Write "        <option value='ClientName'>客户名称</option>" & vbCrLf
Response.Write "        <option value='ClientID'>客户ID</option>" & vbCrLf
Response.Write "        <option value='Processor'>服务人员</option>" & vbCrLf
Response.Write "        <option value='ServiceTime'>服务时间</option>" & vbCrLf
Response.Write "      </select>" & vbCrLf
Response.Write "      <input name='Keyword' type='text' id='Keyword' size='20' maxlength='30'>" & vbCrLf
Response.Write "      <input type='submit' name='Submit2' value=' 查 询 '>" & vbCrLf
Response.Write "      <input name='SearchType' type='hidden' id='SearchType' value='10'>" & vbCrLf
Response.Write "    </td>" & vbCrLf
Response.Write "</form>" & vbCrLf
Response.Write "  </tr>" & vbCrLf
Response.Write "</table>" & vbCrLf

arrServiceType = GetArrFromDictionary("PE_ServiceItem", "ServiceType")
arrServiceMode = GetArrFromDictionary("PE_ServiceItem", "ServiceMode")
arrTakeTime = GetArrFromDictionary("PE_ServiceItem", "TakeTime")
arrResult = GetArrFromDictionary("PE_ServiceItem", "Result")
arrConfirmScore = GetArrFromDictionary("PE_ServiceItem", "ConfirmScore")

Select Case Action
Case "Add"
    Call add
Case "Modify"
    Call Modify
Case "SaveAdd", "SaveModify"
    Call SaveService
Case "SaveConfirm"
    Call SaveConfirm
Case "Show", "Confirm"
    Call Show
Case "Del"
    Call Del
Case Else
    Call main
End Select
If FoundErr = True Then
    Call WriteErrMsg(ErrMsg, ComeUrl)
End If
Response.Write "</body></html>"
Call CloseConn


Sub main()
    Call ShowJS_Main("记录")
    Response.Write "<br><table width='100%'><tr><td align='left'>您现在的位置：<a href='Admin_Service.asp'>服务管理</a>&nbsp;&gt;&gt;&nbsp;"

    Dim sql, Querysql
    Select Case SearchType
    Case 1, 2, 10
        sql = "select S.*,C.ShortedForm,C.ClientName from PE_ServiceItem S inner join PE_Client C on S.ClientID=C.ClientID"
    Case Else
        sql = "select top " & MaxPerPage & " " & " S.*,C.ShortedForm,C.ClientName from PE_ServiceItem S inner join PE_Client C on S.ClientID=C.ClientID"
    End Select

    Querysql = " where 1=1 "
    Select Case SearchType
    Case 0
        Response.Write "所有服务记录"
    Case 1
        Querysql = Querysql & " and datediff(" & PE_DatePart_D & ",S.ServiceTime," & PE_Now & ")<10"
        Response.Write "10天内的记录"
    Case 2
        Querysql = Querysql & " and datediff(" & PE_DatePart_D & ",S.ServiceTime," & PE_Now & ")<30"
        Response.Write "一个月内的记录"
    Case 10
        If Keyword = "" Then
            Response.Write "所有记录"
        Else
            Select Case strField
            Case "ClientID"
                If IsNumeric(Keyword) = False Then
                    FoundErr = True
                    ErrMsg = ErrMsg & "<li>客户ID必须是整数</li>"
                Else
                    Querysql = Querysql & " and C.ClientID=" & PE_CLng(Keyword)
                    Response.Write "客户ID等于<font color=red> " & PE_CLng(Keyword) & " </font>的服务记录"
                End If
            Case "ClientName"
                Querysql = Querysql & " and C.ClientName like '%" & Keyword & "%'"
                Response.Write "名称中含有“ <font color=red>" & Keyword & "</font> ”的服务记录"
            Case "Processor"
                Querysql = Querysql & " and S.Processor like '%" & Keyword & "%'"
                Response.Write "“ <font color=red>" & Keyword & "</font> ”的服务记录"
            
            Case "ServiceTime"
                If IsDate(Keyword) = True Then
                    Querysql = Querysql & " and DateDiff(" & PE_DatePart_D & ",S.ServiceTime,'" & Keyword & "')=0 "
                    Response.Write "<font color=red>" & Year(Keyword) & "-" & Month(Keyword) & "-" & Day(Keyword) & "</font> 服务的记录"
                Else
                    FoundErr = True
                    ErrMsg = ErrMsg & "<li>查询的服务时间格式不正确！</li>"
                End If
            Case Else
                Querysql = Querysql & " and C.ClientName like '%" & Keyword & "%'"
                Response.Write "名称中含有“ <font color=red>" & Keyword & "</font> ”的客户"
            End Select
        End If
    End Select
    
    If SearchType = 10 Then
        totalPut = PE_CLng(Conn.Execute("select Count(*) from PE_ServiceItem S inner join PE_Client C on S.ClientID=C.ClientID " & Querysql)(0))
    Else
        totalPut = PE_CLng(Conn.Execute("select Count(*) from PE_ServiceItem S " & Querysql)(0))
    End If
    If CurrentPage < 1 Then
        CurrentPage = 1
    End If
    If (CurrentPage - 1) * MaxPerPage > totalPut Then
        If (totalPut Mod MaxPerPage) = 0 Then
            CurrentPage = totalPut \ MaxPerPage
        Else
            CurrentPage = totalPut \ MaxPerPage + 1
        End If
    End If
    If CurrentPage > 1 Then
        Querysql = Querysql & " and ItemID < (select min(ItemID) from (select top " & ((CurrentPage - 1) * MaxPerPage) & " ItemID from PE_ServiceItem S " & Querysql & " order by ItemID desc) as QueryClient) "
    End If
    sql = sql & Querysql & " order by ItemID desc"


    Response.Write "</td></tr></table>"
    If FoundErr = True Then Exit Sub
    
    Response.Write "<table width='100%'  border='0' cellpadding='2' cellspacing='1' class='border'>" & vbCrLf
    Response.Write "  <tr align='center' class='title'>" & vbCrLf
    Response.Write "    <td width='120'>服务时间</td>" & vbCrLf
    Response.Write "    <td width='60' align='center'>客户名称</td>" & vbCrLf
    Response.Write "    <td>主题</td>" & vbCrLf
    Response.Write "    <td width='60' align='center'>服务类型</td>" & vbCrLf
    Response.Write "    <td width='60' align='center'>服务方式</td>" & vbCrLf
    Response.Write "    <td width='60' align='center'>服务人员</td>" & vbCrLf
    Response.Write "    <td width='60' align='center'>服务结果</td>" & vbCrLf
    Response.Write "    <td width='60' align='center'>回访确认</td>" & vbCrLf
    Response.Write "    <td width='60' align='center'>客户评价</td>" & vbCrLf
    Response.Write "    <td width='90' align='center'>操作</td>" & vbCrLf
    Response.Write "  </tr>" & vbCrLf
    Dim rsService, i
    Set rsService = Conn.Execute(sql)
    If rsService.BOF And rsService.EOF Then
        Response.Write "<tr><td colspan='10' height='50' align='center' class='tdbg'>没有任何服务记录！</td></tr>"
    Else
        Do While Not rsService.EOF
            Response.Write "  <tr class='tdbg' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"">" & vbCrLf
            Response.Write "    <td width='120'>" & rsService("ServiceTime") & "</td>" & vbCrLf
            Response.Write "    <td width='60' align='center'><a href='Admin_Client.asp?Action=Show&InfoType=5&ClientID=" & rsService("ClientID") & "' title='" & rsService("ClientName") & "'>" & rsService("ShortedForm") & "</a></td>" & vbCrLf
            Response.Write "    <td><a href='Admin_Service.asp?Action=Show&ItemID=" & rsService("ItemID") & "'>" & rsService("ServiceTitle") & "</a></td>" & vbCrLf
            Response.Write "    <td width='60' align='center'>" & GetArrItem(arrServiceType, rsService("ServiceType")) & "</td>" & vbCrLf
            Response.Write "    <td width='60' align='center'>" & GetArrItem(arrServiceMode, rsService("ServiceMode")) & "</td>" & vbCrLf
            Response.Write "    <td width='60' align='center'>" & rsService("Processor") & "</td>" & vbCrLf
            Response.Write "    <td width='60' align='center'>" & GetArrItem(arrResult, rsService("ServiceResult")) & "</td>" & vbCrLf
            Response.Write "    <td width='60' align='center'>"
            If rsService("ConfirmTime") <> "" Then
                Response.Write "<strong>√</strong>"
            End If
            Response.Write "</td>" & vbCrLf
            Response.Write "    <td width='60' align='center'>"
            If rsService("ConfirmTime") <> "" Then
                Response.Write GetArrItem(arrConfirmScore, rsService("ConfirmScore"))
            End If
            Response.Write "</td>" & vbCrLf
            Response.Write "    <td width='90' align='center'>"
            Response.Write "<a href='Admin_Service.asp?Action=Confirm&ItemID=" & rsService("ItemID") & "'>回访</a> "
            Response.Write "<a href='Admin_Service.asp?Action=Modify&ItemID=" & rsService("ItemID") & "'>修改</a> "
            Response.Write "<a href='Admin_Service.asp?Action=Del&ItemID=" & rsService("ItemID") & "' onclick=""return confirm('确实要删除此服务记录吗？');"">删除</a>"
            Response.Write "    </td>" & vbCrLf
            Response.Write "  </tr>" & vbCrLf
            i = i + 1
            If i >= MaxPerPage Then Exit Do
            rsService.MoveNext
        Loop
    End If
    Set rsService = Nothing
    Response.Write "</table>" & vbCrLf

    If totalPut > 0 Then
        Response.Write ShowPage(strFileName, totalPut, MaxPerPage, CurrentPage, True, True, "条记录", True)
    End If

End Sub
Sub ShowJS_Check()
    Response.Write "<script language=javascript>" & vbCrLf
    Response.Write "function SelectClient(){" & vbCrLf
    Response.Write "    var arr=showModalDialog('Admin_SourceList.asp?TypeSelect=ClientList','','dialogWidth:600px; dialogHeight:450px; help: no; scroll: yes; status: no');" & vbCrLf
    Response.Write "    if (arr != null){" & vbCrLf
    Response.Write "        var ss=arr.split('$$$');" & vbCrLf
    Response.Write "        document.myform.ClientName.value=ss[0];" & vbCrLf
    Response.Write "        document.myform.ClientID.value=ss[1];" & vbCrLf
    Response.Write "        makeRequest('Admin_GetContacter.asp?ClientID='+ss[1]);" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "}" & vbCrLf
    Response.Write "function SelectProcessor(){" & vbCrLf
    Response.Write "    var arr=showModalDialog('Admin_SourceList.asp?TypeSelect=AdminList&DefaultValue='+document.myform.Processor.value,'','dialogWidth:600px; dialogHeight:450px; help: no; scroll: yes; status: no');" & vbCrLf
    Response.Write "    if (arr != null){" & vbCrLf
    Response.Write "        document.myform.Processor.value=arr;" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "}" & vbCrLf

    Response.Write "var http_request = false;" & vbCrLf
    Response.Write "function makeRequest(url) {" & vbCrLf
    Response.Write "  http_request = false;" & vbCrLf
    Response.Write "  if (window.XMLHttpRequest) { // Mozilla, Safari,..." & vbCrLf
    Response.Write "    http_request = new XMLHttpRequest();" & vbCrLf
    Response.Write "    if (http_request.overrideMimeType) {" & vbCrLf
    Response.Write "      http_request.overrideMimeType('text/xml');" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "  } else if (window.ActiveXObject) { // IE" & vbCrLf
    Response.Write "    try {" & vbCrLf
    Response.Write "      http_request = new ActiveXObject('Msxml2.XMLHTTP');" & vbCrLf
    Response.Write "    } catch (e) {" & vbCrLf
    Response.Write "      try {" & vbCrLf
    Response.Write "        http_request = new ActiveXObject('Microsoft.XMLHTTP');" & vbCrLf
    Response.Write "      } catch (e) {}" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "  }" & vbCrLf
    Response.Write "  if (!http_request) {" & vbCrLf
    Response.Write "    alert('Giving up :( Cannot create an XMLHTTP instance');" & vbCrLf
    Response.Write "    return false;" & vbCrLf
    Response.Write "  }" & vbCrLf
    Response.Write "  http_request.onreadystatechange = GetContacter;" & vbCrLf
    Response.Write "  http_request.open('GET', url, true);" & vbCrLf
    Response.Write "  http_request.send(null);" & vbCrLf
    Response.Write "}" & vbCrLf
    Response.Write "function GetContacter() {" & vbCrLf
    Response.Write "  if (http_request.readyState == 4) {" & vbCrLf
    Response.Write "    if (http_request.status == 200) {" & vbCrLf
    Response.Write "      document.getElementById('ContacterList').innerHTML=http_request.responseText;" & vbCrLf
'   Response.Write "      alert(http_request.responseText);" & vbCrlf
    Response.Write "    } else {" & vbCrLf
    Response.Write "      alert('There was a problem with the request.');" & vbCrLf
    Response.Write "    }" & vbCrLf
    Response.Write "  }" & vbCrLf
    Response.Write "}" & vbCrLf

    Response.Write "</script>" & vbCrLf
End Sub

Sub add()
    If AdminPurview > 1 And arrPurview(1) = False Then
        Response.Write "<br><p align='center'><font color='red' style='font-size:9pt'>对不起，你没有此项操作的权限。</font></p>"
        Call WriteEntry(6, AdminName, "越权操作")
        Exit Sub
    End If

    Call ShowJS_Check
    Dim ClientID, ContacterID
    ClientID = PE_CLng(Trim(Request("ClientID")))
    ContacterID = PE_CLng(Trim(Request("ContacterID")))
    
    Response.Write "<form name='myform' method='post' action='Admin_Service.asp'>" & vbCrLf
    Response.Write "  <table width='100%'  border='0' cellpadding='2' cellspacing='1' class='border'>" & vbCrLf
    Response.Write "    <tr class='title' align='center'>" & vbCrLf
    Response.Write "      <td colspan='2'><strong>添 加 客 户 服 务 记 录</strong></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td width='15%' align='right' class='tdbg5'>服务主题：</td>" & vbCrLf
    Response.Write "      <td width='85%'><input name='ServiceTitle' type='text' id='ServiceTitle' size='50' maxlength='50'></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>对应客户：</td>" & vbCrLf
    Response.Write "      <td><input name='ClientName' type='text' id='ClientName' size='50' maxlength='200' ReadOnly value='" & GetClientName(ClientID) & "'>" & vbCrLf
    Response.Write "      <input type='button' name='Submit' value='...' onclick='SelectClient();'>" & vbCrLf
    Response.Write "      <input name='ClientID' type='hidden' id='ClientID' value='" & ClientID & "'></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>客户方联系人：</td>" & vbCrLf
    Response.Write "      <td><span id='ContacterList'><select name='ContacterID'>" & GetContacterOption(ClientID, ContacterID) & "</select></span></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务人员：</td>" & vbCrLf
    Response.Write "      <td><input name='Processor' type='text' id='Processor' size='50' value='" & AdminName & "' >" & vbCrLf
    If AdminPurview = 1 Then
        Response.Write "      <input type='button' name='Submit' value='...' onclick='SelectProcessor();'>"
    End If
    Response.Write "</td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务类型：</td>" & vbCrLf
    Response.Write "      <td><select name='ServiceType' id='ServiceType'>" & Array2Option(arrServiceType, 0) & "</select></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务方式：</td>" & vbCrLf
    Response.Write "      <td><select name='ServiceMode' id='ServiceMode'>" & Array2Option(arrServiceMode, 0) & "</select></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>开始时间：</td>" & vbCrLf
    Response.Write "      <td><input name='ServiceDate' type='text' id='ServiceDate' value='" & Date & "' size='12' maxlength='12'>" & vbCrLf
    Response.Write "        <input name='ServiceTime' type='text' id='ServiceTime' value='" & Time() & "' size='10' maxlength='10'></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>花费时间：</td>" & vbCrLf
    Response.Write "      <td><select name='TakeTime' id='TakeTime'>" & Array2Option(arrTakeTime, 0) & "</select></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务内容：</td>" & vbCrLf
    Response.Write "      <td><textarea name='ServiceContent' cols='40' rows='5' id='ServiceContent'></textarea></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务结果：</td>" & vbCrLf
    Response.Write "      <td><select name='ServiceResult' id='ServiceResult'>" & Array2Option(arrResult, 0) & "</select></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>客户反馈：</td>" & vbCrLf
    Response.Write "      <td><textarea name='Feedback' cols='40' rows='4' id='Feedback'></textarea></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>备注：</td>" & vbCrLf
    Response.Write "      <td><textarea name='Remark' cols='40' rows='4' id='Remark'></textarea></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr align='center'>" & vbCrLf
    Response.Write "      <td height='40' colspan='2' class='tdbg'><input type='hidden' name='Action' value='SaveAdd'><input type='submit' name='Submit' value='保存服务记录'></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "  </table>" & vbCrLf
    Response.Write "</form>" & vbCrLf
End Sub

Sub Modify()
    If AdminPurview > 1 And arrPurview(2) = False And arrPurview(3) = False Then
        Response.Write "<br><p align='center'><font color='red' style='font-size:9pt'>对不起，你没有此项操作的权限。</font></p>"
        Call WriteEntry(6, AdminName, "越权操作")
        Exit Sub
    End If

    Call ShowJS_Check

    Dim ItemID, rsService
    ItemID = PE_CLng(Trim(Request("ItemID")))
    If ItemID <= 0 Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定要修改的服务记录的ID！</li>"
    End If
    
    Set rsService = Conn.Execute("select * from PE_ServiceItem where ItemID=" & ItemID & "")
    If rsService.BOF And rsService.EOF Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>找不到指定的服务记录！</li>"
        rsService.Close
        Set rsService = Nothing
        Exit Sub
    End If

    If rsService("Inputer") <> AdminName And AdminPurview > 1 And arrPurview(3) = False Then
        Response.Write "<br><p align='center'><font color='red' style='font-size:9pt'>对不起，你没有此项操作的权限。</font></p>"
        Call WriteEntry(6, AdminName, "越权操作")
        rsService.Close
        Set rsService = Nothing
        Exit Sub
    End If

    Response.Write "<form name='myform' method='post' action='Admin_Service.asp'>" & vbCrLf
    Response.Write "  <table width='100%'  border='0' cellpadding='2' cellspacing='1' class='border'>" & vbCrLf
    Response.Write "    <tr class='title' align='center'>" & vbCrLf
    Response.Write "      <td colspan='2'><strong>修 改 客 户 服 务 记 录</strong></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td width='15%' align='right' class='tdbg5'>服务主题：</td>" & vbCrLf
    Response.Write "      <td width='85%'><input name='ServiceTitle' type='text' id='ServiceTitle' size='50' maxlength='50' value='" & rsService("ServiceTitle") & "'></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>对应客户：</td>" & vbCrLf
    Response.Write "      <td><input name='ClientName' type='text' id='ClientName' size='50' ReadOnly maxlength='200' ReadOnley value='" & GetClientName(rsService("ClientID")) & "'>" & vbCrLf
    Response.Write "      <input type='button' name='Submit' value='...' onclick='SelectClient();'>" & vbCrLf
    Response.Write "      <input name='ClientID' type='hidden' id='ClientID' value='" & rsService("ClientID") & "'></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>客户方联系人：</td>" & vbCrLf
    Response.Write "      <td><span id='ContacterList'><select name='ContacterID'>" & GetContacterOption(rsService("ClientID"), rsService("ContacterID")) & "</select></span></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务人员：</td>" & vbCrLf
    Response.Write "      <td><input name='Processor' type='text' id='Processor' size='50' value='" & rsService("Processor") & "' >" & vbCrLf
    If AdminPurview = 1 Then
        Response.Write "      <input type='button' name='Submit' value='...' onclick='SelectProcessor();'>"
    End If
    Response.Write "</td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务类型：</td>" & vbCrLf
    Response.Write "      <td><select name='ServiceType' id='ServiceType'>" & Array2Option(arrServiceType, rsService("ServiceType")) & "</select></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务方式：</td>" & vbCrLf
    Response.Write "      <td><select name='ServiceMode' id='ServiceMode'>" & Array2Option(arrServiceMode, rsService("ServiceMode")) & "</select></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>开始时间：</td>" & vbCrLf
    Response.Write "      <td><input name='ServiceDate' type='text' id='ServiceDate' value='" & FormatDateTime(rsService("ServiceTime"), 2) & "' size='12' maxlength='12'>" & vbCrLf
    Response.Write "        <input name='ServiceTime' type='text' id='ServiceTime' value='" & Hour(rsService("ServiceTime")) & ":" & Minute(rsService("ServiceTime")) & ":" & Second(rsService("ServiceTime")) & "' size='10' maxlength='10'></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>花费时间：</td>" & vbCrLf
    Response.Write "      <td><select name='TakeTime' id='TakeTime'>" & Array2Option(arrTakeTime, rsService("TakeTime")) & "</select></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务内容：</td>" & vbCrLf
    Response.Write "      <td><textarea name='ServiceContent' cols='40' rows='5' id='ServiceContent'>" & rsService("ServiceContent") & "</textarea></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务结果：</td>" & vbCrLf
    Response.Write "      <td><select name='ServiceResult' id='ServiceResult'>" & Array2Option(arrResult, rsService("ServiceResult")) & "</select></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>客户反馈：</td>" & vbCrLf
    Response.Write "      <td><textarea name='Feedback' cols='40' rows='4' id='Feedback'>" & rsService("Feedback") & "</textarea></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>备注：</td>" & vbCrLf
    Response.Write "      <td><textarea name='Remark' cols='40' rows='4' id='Remark'>" & rsService("Remark") & "</textarea></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr align='center'>" & vbCrLf
    Response.Write "      <td height='40' colspan='2' class='tdbg'><input type='hidden' name='ItemID' value='" & ItemID & "'><input type='hidden' name='Action' value='SaveModify'><input type='submit' name='Submit' value='保存服务记录'></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "  </table>" & vbCrLf
    Response.Write "</form>" & vbCrLf
    rsService.Close
    Set rsService = Nothing
End Sub

Sub Show()
    Dim ItemID, rsService
    ItemID = PE_CLng(Trim(Request("ItemID")))
    If ItemID <= 0 Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定要修改的服务记录的ID！</li>"
    End If
    
    Set rsService = Conn.Execute("select * from PE_ServiceItem where ItemID=" & ItemID & "")
    If rsService.BOF And rsService.EOF Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>找不到指定的服务记录！</li>"
        rsService.Close
        Set rsService = Nothing
        Exit Sub
    End If

    If Action = "Show" Then
        Response.Write "<script language='javascript'>" & vbCrLf
        Response.Write "var tID=0;" & vbCrLf
        Response.Write "function ShowTabs(ID){" & vbCrLf
        Response.Write "  if(ID!=tID){" & vbCrLf
        Response.Write "    TabTitle[tID].className='title5';" & vbCrLf
        Response.Write "    TabTitle[ID].className='title6';" & vbCrLf
        Response.Write "    Tabs[tID].style.display='none';" & vbCrLf
        Response.Write "    Tabs[ID].style.display='';" & vbCrLf
        Response.Write "    tID=ID;" & vbCrLf
        Response.Write "  }" & vbCrLf
        Response.Write "}" & vbCrLf
        Response.Write "</script>" & vbCrLf

        Response.Write "<br><table width='100%'><tr><td align='left'>您现在的位置：<a href='Admin_Service.asp'>服务管理</a>&nbsp;&gt;&gt;&nbsp;查看服务记录</td></tr></table>"
        Response.Write "<br><table  width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
        Response.Write "        <tr align='center' height='24'>" & vbCrLf
        Response.Write "            <td id='TabTitle' class='title6' onclick='ShowTabs(0)'>基本信息</td>" & vbCrLf
        If AdminPurview = 1 Or arrPurview(5) = True Then
            Response.Write "            <td id='TabTitle' class='title5' onclick='ShowTabs(1)'>回访信息</td>" & vbCrLf
        End If
        Response.Write "            <td>&nbsp;</td>" & vbCrLf
        Response.Write "        </tr>" & vbCrLf
        Response.Write "</table>" & vbCrLf
    Else
        Response.Write "<br><table  width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
        Response.Write "        <tr align='center' height='24'>" & vbCrLf
        Response.Write "            <td class='title6'>服务信息</td>" & vbCrLf
        Response.Write "            <td>&nbsp;</td>" & vbCrLf
        Response.Write "        </tr>" & vbCrLf
        Response.Write "</table>" & vbCrLf
    End If
    Response.Write "<table width='100%'  border='0' cellpadding='5' cellspacing='1' class='border'><tr class='tdbg'><td height='100' valign='top'>"
    Response.Write "  <table width='95%' align='center' cellpadding='2' cellspacing='1' bgcolor='#FFFFFF'>" & vbCrLf
    Response.Write "    <tbody id='Tabs'>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td width='15%' align='right' class='tdbg5'>服务主题：</td>" & vbCrLf
    Response.Write "      <td width='35%'>" & rsService("ServiceTitle") & "</td>" & vbCrLf
    Response.Write "      <td width='15%' align='right' class='tdbg5'>服务人员：</td>" & vbCrLf
    Response.Write "      <td width='35%'>" & rsService("Processor") & "</td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>对应客户：</td>" & vbCrLf
    Response.Write "      <td><a href='Admin_Client.asp?Action=Show&InfoType=5&ClientID=" & rsService("ClientID") & "'>" & GetClientName(rsService("ClientID")) & "</a></td>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>客户方联系人：</td>" & vbCrLf
    Response.Write "      <td><a href='Admin_Contacter.asp?Action=Show&ContacterID=" & rsService("ContacterID") & "'>" & GetContacterName(rsService("ContacterID")) & "</a></td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务类型：</td>" & vbCrLf
    Response.Write "      <td>" & GetArrItem(arrServiceType, rsService("ServiceType")) & "</td>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务方式：</td>" & vbCrLf
    Response.Write "      <td>" & GetArrItem(arrServiceMode, rsService("ServiceMode")) & "</td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>开始时间：</td>" & vbCrLf
    Response.Write "      <td>" & rsService("ServiceTime") & "</td>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>花费时间：</td>" & vbCrLf
    Response.Write "      <td>" & GetArrItem(arrTakeTime, rsService("TakeTime")) & "</td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务内容：</td>" & vbCrLf
    Response.Write "      <td>" & PE_HTMLEncode(rsService("ServiceContent")) & "</td>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>服务结果：</td>" & vbCrLf
    Response.Write "      <td>" & GetArrItem(arrResult, rsService("ServiceResult")) & "</td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    <tr class='tdbg'>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>客户反馈：</td>" & vbCrLf
    Response.Write "      <td>" & PE_HTMLEncode(rsService("Feedback")) & "</td>" & vbCrLf
    Response.Write "      <td align='right' class='tdbg5'>备注：</td>" & vbCrLf
    Response.Write "      <td>" & PE_HTMLEncode(rsService("Remark")) & "</td>" & vbCrLf
    Response.Write "    </tr>" & vbCrLf
    Response.Write "    </tbody>" & vbCrLf
    If AdminPurview = 1 Or arrPurview(5) = True Then
        Response.Write "    <tbody id='Tabs' style='display:none'>" & vbCrLf
        Response.Write "    <tr class='tdbg'>" & vbCrLf
        Response.Write "      <td width='15%' align='right' class='tdbg5'>回访时间：</td>" & vbCrLf
        Response.Write "      <td width='35%'>" & rsService("ConfirmTime") & "</td>" & vbCrLf
        Response.Write "      <td width='15%' align='right' class='tdbg5'>回访人员：</td>" & vbCrLf
        Response.Write "      <td width='35%'>" & rsService("ConfirmCaller") & "</td>" & vbCrLf
        Response.Write "    </tr>" & vbCrLf
        Response.Write "    <tr class='tdbg'>" & vbCrLf
        Response.Write "      <td align='right' class='tdbg5'>客户评价：</td>" & vbCrLf
        Response.Write "      <td>" & GetArrItem(arrConfirmScore, rsService("ConfirmScore")) & "</td>" & vbCrLf
        Response.Write "      <td align='right' class='tdbg5'>客户反馈：</td>" & vbCrLf
        Response.Write "      <td>" & PE_HTMLEncode(rsService("ConfirmFeedback")) & "</td>" & vbCrLf
        Response.Write "    </tr>" & vbCrLf
        Response.Write "    </tbody>" & vbCrLf
        Response.Write "  </table>" & vbCrLf
        Response.Write "</td></tr></table>" & vbCrLf
    End If
    If Action = "Show" Then
        Response.Write "<table id='table1' width='100%' height='40'><tr align='center'><td>"
        If rsService("ConfirmTime") <> "" Then
            If AdminPurview = 1 Or arrPurview(8) = True Or (arrPurview(7) = True And rsService("ConfirmCaller") = AdminName) Then
                Response.Write "<input type='button' name='modify' value='修改回访记录' onclick=""window.location.href='Admin_Service.asp?Action=Confirm&ItemID=" & ItemID & "';"">"
            End If
        Else
            If AdminPurview = 1 Or arrPurview(3) = True Or (arrPurview(2) = True And rsService("Inputer") = AdminName) Then
                Response.Write "<input type='button' name='modify' value='修改服务记录' onclick=""window.location.href='Admin_Service.asp?Action=Modify&ItemID=" & ItemID & "';""> "
            End If
            If AdminPurview = 1 Or arrPurview(6) = True Then
                Response.Write "<input type='button' name='modify' value='添加回访记录' onclick=""window.location.href='Admin_Service.asp?Action=Confirm&ItemID=" & ItemID & "';"">"
            End If
        End If
        Response.Write "</td></tr></table>"
    Else
        Dim ConfirmCaller, ConfirmDate, ConfirmTime
        If rsService("ConfirmCaller") & "" = "" Then
            ConfirmCaller = AdminName
        Else
            ConfirmCaller = rsService("ConfirmCaller")
        End If
        If IsDate(rsService("ConfirmTime")) Then
            ConfirmDate = FormatDateTime(rsService("ConfirmTime"), 2)
            ConfirmTime = Hour(rsService("ConfirmTime")) & ":" & Right("0" & Minute(rsService("ConfirmTime")), 2) & ":" & Right("0" & Second(rsService("ConfirmTime")), 2)
        Else
            ConfirmDate = Date
            ConfirmTime = Time()
        End If
        Response.Write "<form name='myform' method='post' action='Admin_Service.asp'>" & vbCrLf
        Response.Write "<table  width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
        Response.Write "  <tr align='center' height='24'>" & vbCrLf
        Response.Write "    <td class='title6' onclick='ShowTabs(0)'>回访信息</td>" & vbCrLf
        Response.Write "    <td>&nbsp;</td>" & vbCrLf
        Response.Write "  </tr>" & vbCrLf
        Response.Write "</table>" & vbCrLf
        Response.Write "<table width='100%'  border='0' cellpadding='5' cellspacing='1' class='border'><tr class='tdbg'><td height='100' valign='top'>"
        Response.Write "  <table width='95%' align='center' cellpadding='2' cellspacing='1' bgcolor='#FFFFFF'>" & vbCrLf
        Response.Write "    <tr class='tdbg'>" & vbCrLf
        Response.Write "      <td width='15%' align='right' class='tdbg5'>回访时间：</td>" & vbCrLf
        Response.Write "      <td width='35%'><input name='ConfirmDate' type='text' id='ConfirmDate' value='" & ConfirmDate & "'>"
        Response.Write "        <input name='ConfirmTime' type='text' id='ConfirmTime' value='" & ConfirmTime & "' size='10' maxlength='10'></td>" & vbCrLf
        Response.Write "      <td width='15%' align='right' class='tdbg5'>回访人员：</td>" & vbCrLf
        Response.Write "      <td width='35%'><input name='ConfirmCaller' type='text' id='ConfirmCaller' value='" & ConfirmCaller & "'></td>" & vbCrLf
        Response.Write "    </tr>" & vbCrLf
        Response.Write "    <tr class='tdbg'>" & vbCrLf
        Response.Write "      <td align='right' class='tdbg5'>客户评价：</td>" & vbCrLf
        Response.Write "      <td><select name='ConfirmScore' id='ConfirmScore'>" & Array2Option(arrConfirmScore, rsService("ConfirmScore")) & "</select></td>" & vbCrLf
        Response.Write "      <td align='right' class='tdbg5'>客户反馈：</td>" & vbCrLf
        Response.Write "      <td><textarea name='ConfirmFeedback' cols='30' rows='4' id='ConfirmFeedback'>" & rsService("ConfirmFeedback") & "</textarea></td>" & vbCrLf
        Response.Write "    </tr>" & vbCrLf
        Response.Write "  </table>" & vbCrLf
        Response.Write "  <p align='center'><input type='hidden' name='ItemID' value='" & ItemID & "'><input type='hidden' name='Action' value='SaveConfirm'><input type='submit' name='Submit' value='保存回访记录'></p>" & vbCrLf
        Response.Write "</td></tr></table>" & vbCrLf
        Response.Write "</form>"
    End If
    rsService.Close
    Set rsService = Nothing
End Sub

Sub SaveService()
    Dim rsService, sqlService
    Dim ItemID, ClientID, ContacterID, OrderFormID, ServiceDate, ServiceTime, ServiceType, ServiceMode, TakeTime, ServiceTitle, ServiceContent, ServiceResult, Processor, Feedback, Remark
    ItemID = PE_CLng(Trim(Request("ItemID")))
    ClientID = PE_CLng(Trim(Request("ClientID")))
    ContacterID = PE_CLng(Trim(Request("ContacterID")))
    OrderFormID = PE_CLng(Trim(Request("OrderFormID")))
    ServiceDate = Trim(Request("ServiceDate"))
    ServiceTime = Trim(Request("ServiceTime"))
    ServiceType = PE_CLng(Trim(Request("ServiceType")))
    ServiceMode = PE_CLng(Trim(Request("ServiceMode")))
    TakeTime = PE_CLng(Trim(Request("TakeTime")))
    ServiceTitle = Trim(Request("ServiceTitle"))
    ServiceContent = Trim(Request("ServiceContent"))
    ServiceResult = PE_CLng(Trim(Request("ServiceResult")))
    Processor = Trim(Request("Processor"))
    Feedback = Trim(Request("Feedback"))
    Remark = Trim(Request("Remark"))
    
    If ClientID <= 0 Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请输入对应客户</li>"
    End If
    If ServiceTitle = "" Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请输入服务主题</li>"
    End If
    If Not IsDate(ServiceDate) Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>服务日期的格式不对</li>"
    End If
    If Not IsDate(ServiceTime) Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>服务时间的格式不对</li>"
    End If
        
    If Action = "SaveAdd" Then
        If AdminPurview > 1 And arrPurview(1) = False Then
            Response.Write "<br><p align='center'><font color='red' style='font-size:9pt'>对不起，你没有此项操作的权限。</font></p>"
            Call WriteEntry(6, AdminName, "越权操作")
            Exit Sub
        End If
        sqlService = "select top 1 * from PE_ServiceItem"
    Else
        If AdminPurview > 1 And arrPurview(2) = False And arrPurview(3) = False Then
            Response.Write "<br><p align='center'><font color='red' style='font-size:9pt'>对不起，你没有此项操作的权限。</font></p>"
            Call WriteEntry(6, AdminName, "越权操作")
            Exit Sub
        End If
        If ItemID <= 0 Then
            FoundErr = True
            ErrMsg = ErrMsg & "<li>请指定ItemID！</li>"
        Else
            sqlService = "select * from PE_ServiceItem where ItemID=" & ItemID
        End If
    End If
    
    If FoundErr = True Then Exit Sub
    
    Set rsService = Server.CreateObject("adodb.recordset")
    rsService.Open sqlService, Conn, 1, 3
    If Action = "SaveAdd" Then
        rsService.AddNew
        rsService("Inputer") = AdminName
    End If
    rsService("ClientID") = ClientID
    rsService("ContacterID") = ContacterID
    rsService("OrderFormID") = OrderFormID
    rsService("ServiceType") = ServiceType
    rsService("ServiceMode") = ServiceMode
    rsService("ServiceTime") = PE_CDate(ServiceDate & " " & ServiceTime)
    rsService("TakeTime") = TakeTime
    rsService("ServiceTitle") = ServiceTitle
    rsService("ServiceContent") = ServiceContent
    rsService("ServiceResult") = ServiceResult
    rsService("Processor") = Processor
    rsService("Feedback") = Feedback
    rsService("Remark") = Remark
    rsService("ConfirmScore") = -1
    rsService.Update
    rsService.Close
    Set rsService = Nothing
    Call main
End Sub

Sub SaveConfirm()
    Dim rsService, sqlService
    Dim ItemID, ConfirmDate, ConfirmTime, ConfirmCaller, ConfirmScore, ConfirmFeedback
    ItemID = PE_CLng(Trim(Request("ItemID")))
    ConfirmDate = Trim(Request("ConfirmDate"))
    ConfirmTime = Trim(Request("ConfirmTime"))
    ConfirmCaller = Trim(Request("ConfirmCaller"))
    ConfirmScore = PE_CLng(Trim(Request("ConfirmScore")))
    ConfirmFeedback = Trim(Request("ConfirmFeedback"))
    
    If ItemID <= 0 Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定ItemID</li>"
    End If
    If Not IsDate(ConfirmDate) Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>回访日期的格式不对</li>"
    End If
    If Not IsDate(ConfirmTime) Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>回访时间的格式不对</li>"
    End If
        
    If FoundErr = True Then Exit Sub
    
    sqlService = "select * from PE_ServiceItem where ItemID=" & ItemID
    Set rsService = Server.CreateObject("adodb.recordset")
    rsService.Open sqlService, Conn, 1, 3
    rsService("ConfirmTime") = PE_CDate(ConfirmDate & " " & ConfirmTime)
    rsService("ConfirmCaller") = ConfirmCaller
    rsService("ConfirmScore") = ConfirmScore
    rsService("ConfirmFeedback") = ConfirmFeedback
    rsService.Update
    rsService.Close
    Set rsService = Nothing
    Call main
End Sub

Sub Del()
    If AdminPurview > 1 And arrPurview(4) = False Then
        Response.Write "<br><p align='center'><font color='red' style='font-size:9pt'>对不起，你没有此项操作的权限。</font></p>"
        Call WriteEntry(6, AdminName, "越权操作")
        Exit Sub
    End If

    Dim ItemID
    ItemID = Trim(Request("ItemID"))
    If IsValidID(ItemID) = False Then
        FoundErr = True
        ErrMsg = ErrMsg & "<li>请指定正确的ItemID！</li>"
        Exit Sub
    End If
    Dim rsService, sqlService, iTemp
    iTemp = 0
    sqlService = "select * from PE_ServiceItem where ItemID in (" & ItemID & ")"
    Set rsService = Server.CreateObject("adodb.recordset")
    rsService.Open sqlService, Conn, 1, 3
    Do While Not rsService.EOF
        rsService.Delete
        rsService.Update
        iTemp = iTemp + 1
        rsService.MoveNext
    Loop
    rsService.Close
    Set rsService = Nothing
    Call WriteSuccessMsg("删除服务记录成功！共删除了 " & iTemp & " 条记录。", "Admin_Service.asp")
End Sub
%>
