<%@ Language=VBScript%>
<%
Response.Expires = -1
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "cache-control", "no-store"
%>
<!--#include file="../../../Connections/SetCONN.asp" -->
<%
classid = Trim(Request("classid"))
UI=Trim(Request("UI"))
'如果為1,獲取KPI審核返回信息
IF UI="1" Then
KID=Trim(Request("KID"))
CSE=Trim(Request("CSE"))
CEE=Trim(Request("CEE"))
SID=Trim(Request("SID"))
FCEE=Trim(Request("FCEE"))
Response.ContentType="text/xml"
response.Write("<?xml version='1.0' encoding='BIG5' ?>")
response.Write("<root>")
IF date()<=cdate(FCEE) THEN
'執行存儲過程
Dim Bomie_Auditing
SET Bomie_Auditing=CONN.Execute ("PROC_DATA_AuditingKPIList '"&CSE&"','"&CEE&"','"& Session("UserID") &"','"& KID &"'")
IF NOT Bomie_Auditing.Eof THEN
Do WHILE NOT Bomie_Auditing.Eof
SET SEEME= CONN.EXECUTE("SELECT Count(*) AS CountKPI FROM SET_MyKPI (nolock) Where KPISystemID='"& KID &"' and TopOrg in (Select OrgID FROM dbo.FORE_Organise (nolock) Where Organise_Sor_ID LIKE (Select Organise_Sor_ID From FORE_Organise (nolock) where OrgID='"&Bomie_Auditing("KpiObject")&"')+'%') AND Xtime <= getdate() and KPIState='OK' and KPIPersonnel_State=0 and Personnel_No<>'"&Session("UserID")&"' and levelID<>'"&Bomie_Auditing("LevelID")&"' ")
response.Write("<KPIinfo H='0'>")
response.Write("<KPISystemID>"& KID &"</KPISystemID>")
response.Write("<StartDate>"& CSE &"</StartDate>")
response.Write("<EndDate>"& CEE &"</EndDate>")
response.Write("<KPIObject>"& Bomie_Auditing("KPIObject") &"</KPIObject>")
response.Write("<OrgName>"& Bomie_Auditing("OrgName") &"</OrgName>")
response.Write("<LevelID>"& Bomie_Auditing("LevelID") &"</LevelID>")
response.Write("<LevelName>"& Bomie_Auditing("LevelName") &"</LevelName>")
response.Write("<CountKPI>"& SEEME("CountKPI") &"</CountKPI>")
response.Write("<CountinKPI>"& Bomie_Auditing("CountinKPI") &"</CountinKPI>")
response.Write("<CountPKPI>"& Bomie_Auditing("CountPKPI") &"</CountPKPI>")
response.Write("<CountSKPI>"& Bomie_Auditing("CountPKPI") &"</CountSKPI>")
response.Write("<CountStop>"& Bomie_Auditing("CountStop") &"</CountStop>")
response.Write("</KPIinfo>")
Bomie_Auditing.MoveNext
Loop
ELSE
response.Write("<KPIinfo H='1'>")
response.Write("</KPIinfo>")
END IF
Bomie_Auditing.Close
SET Bomie_Auditing=Nothing
ELSE
response.Write("<KPIinfo H='2'>")
response.Write("</KPIinfo>")
END IF
response.Write("</root>")
END IF %>