%@ Language=VBScript %>
<% Dim lResult Dim sErrorDesc Dim i Dim oXMLDom Dim iSelectedReportType Dim sStartDate Dim sEndDate Dim iDay Dim iMonth Dim iYear Dim sLocationNum iDay = Day(DateAdd("d", -14, Now)) iMonth = Month(DateAdd("d", -14, Now)) iYear = Year(DateAdd("d", -14, Now)) sStartDate = Right("00" & trim(iDay), 2) & "/" & Right("00" & trim(iMonth),2) & "/" & Right("0000" & trim(iYear), 4) iDay = Day(Now) iMonth = Month(Now) iYear = Year(Now) sEndDate = Right("00" & trim(iDay), 2) & "/" & Right("00" & trim(iMonth),2) & "/" & Right("0000" & trim(iYear), 4) iSelectedReportType = Trim(Request.QueryString("sReportType")) sCompany = Trim(Request.QueryString("sCompany")) sLocationNum = Trim(Request.QueryString("sLocationNumber")) 'Response.Write "sLocationNum = " & sLocationNum If (iSelectedReportType = "2") or (iSelectedReportType = "6") then 'Get the locations collection: Dim oStores Dim sStoresXML 'Set oStores = CreateObject("ESReporter.clsESReporter") Set oStores = CreateObject("ESReports.clsESFinancialReports") 'lResult = oStores.RetrieveStores(sCompany,sStoresXML, sErrorDesc) lResult = oStores.RetrieveLocationsInAStore(sCompany, sLocationNum, sStoresXML, sErrorDesc) Set oStores = Nothing If (lResult <> 0) then Response.Redirect "Error.asp?sErrCode=" & 2 end if Set oXMLDom = CreateObject("MSXML.DOMDocument") oXMLDom.async = False Call oXMLDom.loadXML(sStoresXML) end if If (iSelectedReportType = "3") or (iSelectedReportType = "7") then 'Get the POS terminals collection: Dim oPOSTerminal Dim sPOSTerminalXML 'Set oPOSTerminal = CreateObject("ESReporter.clsESReporter") Set oPOSTerminal = CreateObject("ESReports.clsESFinancialReports") lResult = oPOSTerminal.RetrievePOSTerminals(sCompany, sPOSTerminalXML, sErrorDesc) Set oPOSTerminal = Nothing If (lResult <> 0) then Response.Redirect "Error.asp?sErrCode=" & 3 & "& sMsg=" & sErrorDesc end if Set oXMLDom = CreateObject("MSXML.DOMDocument") oXMLDom.async = False Call oXMLDom.loadXML(sPOSTerminalXML) end if 'Servers detailed report If (iSelectedReportType = "4") or (iSelectedReportType = "8") then 'Get the servers collection: Dim oServer Dim sServerXML 'Set oPOSTerminal = CreateObject("ESReporter.clsESReporter") Set oServer = CreateObject("ESReports.clsESFinancialReports") lResult = oServer.RetrieveStaff(sCompany, sServerXML, sErrorDesc) Set oServer = Nothing If (lResult <> 0) then Response.Redirect "Error.asp?sErrCode=" & 3 & "& sMsg=" & sErrorDesc end if Set oXMLDom = CreateObject("MSXML.DOMDocument") oXMLDom.async = False Call oXMLDom.loadXML(sServerXML) end if session("MEDIA") = request("sMedia") %>