<%@ Language=VBScript %>
<% Option Explicit %>
<!-- #include file="Utility_ConnectionString.asp" -->
<% Response.Expires = 0 %>
<link rel="stylesheet" type="text/css" href="IP_Utility_StyleSheet.css">
<meta>
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
var ColumnHeaders = new Array('Site','Bucket','Supervisor','Collector','Total','One','Two','Three','Four','Five','Six','Seven','Eight','Nine','Ten','Eleven','Twelve','Thirteen','Fourteen','Fifteen','Sixteen','Seventeen','Eighteen','Nineteen','Twenty');
var old,theTop,menu,temp;
var menu,scrollIt;
var theTop = 30
var old = theTop;
function scale()
{
if (temp) clearTimeout(temp);
extra = 1;
var a = new getObj('fixedtable1');
var b = new getObj('normaltable');
for (i=0;i<ColumnHeaders.length;i++)
{
y = new getObj(ColumnHeaders(i)+'Body');
z = new getObj(ColumnHeaders(i)+'Head');
x = y.obj.offsetWidth - extra;
z.style.width = x;
}
theTop = b.obj.offsetTop - a.obj.offsetHeight;
a.style.left = b.obj.offsetLeft;
old=theTop;
menu = new getObj('fixedtable1');
movemenu();
}
function getObj(ObjectName)
{
if (document.getElementById)
{
this.obj = document.getElementById(ObjectName);
this.style = document.getElementById(ObjectName).style;
}
else if (document.all)
{
this.obj = document.all[ObjectName];
this.style = document.all[ObjectName].style;
}
else if (document.layers)
{
this.obj = document.layers[ObjectName];
this.style = document.layers[ObjectName];
}
}
function movemenu()
{
if (window.innerHeight)
{
pos = window.pageYOffset
}
else if (document.documentElement && document.documentElement.scrollTop)
{
pos = document.documentElement.scrollTop
}
else if (document.body)
{
pos = document.body.scrollTop
}
if (pos < theTop) pos = theTop;
if (pos == old)
{
menu.style.top = pos;
}
old = pos;
temp = setTimeout('movemenu()',250);
}
window.onresize = scale;
// -->
</SCRIPT>
<title>Immediate Pay - Collector Totals</title>
</HEAD>
<BODY bgcolor=#eaeafd onload="Javascript: scale();parent.FrameNavigation.document.location.reload();">
<%
ON error resume next
Dim strConnectDMBACK, objDB, rstCollectorTotals, rstCollectorTotalsSum, rstSupervisors, strCollectorTotalsTable, strTemp, strOutput, intCount, strMonth, strRegion, strBucket, strSupervisor
strMonth = Session.Contents("Month")
strRegion = Session.Contents("Region")
strBucket = Session.Contents("Bucket")
strSupervisor = Session.Contents("Supervisor")
set objDB = server.CreateObject ("ADODB.Connection")
set rstCollectorTotals = server.CreateObject ("ADODB.Recordset")
set rstCollectorTotalsSum = server.CreateObject ("ADODB.Recordset")
objDB.Open strConnectDMBACK
rstCollectorTotals.Open "SELECT tbl_IP_CollectorTotals.Supervisor, " & _
"tbl_IP_CollectorTotals.CollectorSite, " & _
"tbl_IP_CollectorTotals.Bucket, " & _
"tbl_IP_CollectorTotals.Collector, " & _
"tbl_IP_CollectorTotals.Total, " & _
"tbl_IP_CollectorTotals.[01] as [1]," & _
"tbl_IP_CollectorTotals.[02] as [2]," & _
"tbl_IP_CollectorTotals.[03] as [3]," & _
"tbl_IP_CollectorTotals.[04] as [4]," & _
"tbl_IP_CollectorTotals.[05] as [5]," & _
"tbl_IP_CollectorTotals.[06] as [6]," & _
"tbl_IP_CollectorTotals.[07] as [7]," & _
"tbl_IP_CollectorTotals.[08] as [8]," & _
"tbl_IP_CollectorTotals.[09] as [9]," & _
"tbl_IP_CollectorTotals.[10]," & _
"tbl_IP_CollectorTotals.[11]," & _
"tbl_IP_CollectorTotals.[12]," & _
"tbl_IP_CollectorTotals.[13]," & _
"tbl_IP_CollectorTotals.[14]," & _
"tbl_IP_CollectorTotals.[15]," & _
"tbl_IP_CollectorTotals.[16]," & _
"tbl_IP_CollectorTotals.[17]," & _
"tbl_IP_CollectorTotals.[18]," & _
"tbl_IP_CollectorTotals.[19]," & _
"tbl_IP_CollectorTotals.[20] " & _
"FROM tbl_IP_CollectorTotals " & _
"WHERE (CollectorSite = '" & strRegion & "') " & _
"AND (Bucket = '" & strBucket & "') " & _
"AND (Month = '" & strMonth & "') " & _
"ORDER BY CollectorSite, Bucket, Supervisor, Collector", strConnectDMBACK
rstCollectorTotalsSum.Open "SELECT Sum(tbl_IP_CollectorTotals.Total) as Total, " & _
"Sum(tbl_IP_CollectorTotals.[01]) as [1]," & _
"Sum(tbl_IP_CollectorTotals.[02]) as [2]," & _
"Sum(tbl_IP_CollectorTotals.[03]) as [3]," & _
"Sum(tbl_IP_CollectorTotals.[04]) as [4]," & _
"Sum(tbl_IP_CollectorTotals.[05]) as [5]," & _
"Sum(tbl_IP_CollectorTotals.[06]) as [6]," & _
"Sum(tbl_IP_CollectorTotals.[07]) as [7]," & _
"Sum(tbl_IP_CollectorTotals.[08]) as [8]," & _
"Sum(tbl_IP_CollectorTotals.[09]) as [9]," & _
"Sum(tbl_IP_CollectorTotals.[10]) as [10]," & _
"Sum(tbl_IP_CollectorTotals.[11]) as [11]," & _
"Sum(tbl_IP_CollectorTotals.[12]) as [12]," & _
"Sum(tbl_IP_CollectorTotals.[13]) as [13]," & _
"Sum(tbl_IP_CollectorTotals.[14]) as [14]," & _
"Sum(tbl_IP_CollectorTotals.[15]) as [15]," & _
"Sum(tbl_IP_CollectorTotals.[16]) as [16]," & _
"Sum(tbl_IP_CollectorTotals.[17]) as [17]," & _
"Sum(tbl_IP_CollectorTotals.[18]) as [18]," & _
"Sum(tbl_IP_CollectorTotals.[19]) as [19]," & _
"Sum(tbl_IP_CollectorTotals.[20]) as [20] " & _
"FROM tbl_IP_CollectorTotals " & _
"WHERE (CollectorSite = '" & strRegion & "') " & _
"AND (Bucket = '" & strBucket & "') " & _
"AND (Month = '" & strMonth & "')", strConnectDMBACK
%>
<br>
<DIV ID="fixedtable1">
<TABLE cellspacing=0 Cellpadding=0>
<tr bgcolor=#000080><Font Color=White>
<td id="SiteHead"><Font Color=White>Site</font></td>
<td id="BucketHead"><Font Color=White>Bucket</font></td>
<td id="SupervisorHead"><Font Color=White>Supervisor</font></td>
<td id="CollectorHead"><Font Color=White>Collector</font></td>
<td id="TotalHead"><Font Color=White>Total</font></td>
<td id="OneHead"><Font Color=White>1</font></td>
<td id="TwoHead"><Font Color=White>2</font></td>
<td id="ThreeHead"><Font Color=White>3</font></td>
<td id="FourHead"><Font Color=White>4</font></td>
<td id="FiveHead"><Font Color=White>5</font></td>
<td id="SixHead"><Font Color=White>6</font></td>
<td id="SevenHead"><Font Color=White>7</font></td>
<td id="EightHead"><Font Color=White>8</font></td>
<td id="NineHead"><Font Color=White>9</font></td>
<td id="TenHead"><Font Color=White>10</font></td>
<td id="ElevenHead"><Font Color=White>11</font></td>
<td id="TwelveHead"><Font Color=White>12</font></td>
<td id="ThirteenHead"><Font Color=White>13</font></td>
<td id="FourteenHead"><Font Color=White>14</font></td>
<td id="FifteenHead"><Font Color=White>15</font></td>
<td id="SixteenHead"><Font Color=White>16</font></td>
<td id="SeventeenHead"><Font Color=White>17</font></td>
<td id="EighteenHead"><Font Color=White>18</font></td>
<td id="NineteenHead"><Font Color=White>19</font></td>
<td id="TwentyHead"><Font Color=White>20</font></td>
</tr>
</Table>
</Div>
<DIV ID="normaltable">
<TABLE cellspacing=0 Cellpadding=0>
<%
intCount = 1
Do while not rstCollectorTotals.EOF
Response.Write ("<tr")
If Eval(intCount\2 = intCount/2) Then 'determine if the number is odd or even
Response.Write " bgcolor=Gainsboro>"
Else
Response.Write " bgcolor=White>"
End If
intCount = intCount + 1 'increment the counter
%>
<td> <% = rstCollectorTotals.Fields("CollectorSite") %> </td>
<td nowrap> <% if rstCollectorTotals.Fields("Bucket") = "ACD" or rstCollectorTotals.Fields("Bucket") = "CRG" then
Response.Write (" " & rstCollectorTotals.Fields("Bucket") & " ")
else
Response.Write (PCase(rstCollectorTotals.Fields("Bucket")))
end if %> </td>
<td nowrap> <% = (PCase(rstCollectorTotals.Fields("Supervisor"))) %> </td>
<td nowrap> <% = (PCase(rstCollectorTotals.Fields("Collector"))) %> </td>
<td><% = FormatNumber(rstCollectorTotals.Fields("Total"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("1"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("2"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("3"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("4"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("5"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("6"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("7"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("8"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("9"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("10"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("11"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("12"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("13"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("14"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("15"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("16"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("17"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("18"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("19"),0) %></td>
<td><% = FormatNumber(rstCollectorTotals.Fields("20"),0) %></td>
</tr>
<%
rstCollectorTotals.MoveNext
loop
%>
<tr bgcolor=white><td Colspan=25> </td></tr>
<tr bgcolor=#99ccff>
<td id="SiteBody"> </td>
<td id="BucketBody"> </td>
<td id="SupervisorBody"> </td>
<td id="CollectorBody"><b>Totals</b></td>
<td id="TotalBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("Total"),0) %> </td>
<td id="OneBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("1"),0) %> </td>
<td id="TwoBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("2"),0) %> </td>
<td id="ThreeBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("3"),0) %> </td>
<td id="FourBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("4"),0) %> </td>
<td id="FiveBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("5"),0) %> </td>
<td id="SixBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("6"),0) %> </td>
<td id="SevenBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("7"),0) %> </td>
<td id="EightBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("8"),0) %> </td>
<td id="NineBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("9"),0) %> </td>
<td id="TenBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("10"),0) %> </td>
<td id="ElevenBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("11"),0) %> </td>
<td id="TwelveBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("12"),0) %> </td>
<td id="ThirteenBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("13"),0) %> </td>
<td id="FourteenBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("14"),0) %> </td>
<td id="FifteenBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("15"),0) %> </td>
<td id="SixteenBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("16"),0) %> </td>
<td id="SeventeenBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("17"),0) %> </td>
<td id="EighteenBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("18"),0) %> </td>
<td id="NineteenBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("19"),0) %> </td>
<td id="TwentyBody"> <% = FormatNumber(rstCollectorTotalsSum.Fields("20"),0) %> </td>
</tr>
</Table>
</Div>
<%
rstCollectorTotals.Close
rstCollectorTotalsSum.Close
Set rstCollectorTotals = Nothing
Set rstCollectorTotalsSum = Nothing
objDB.Close
Set objDB = Nothing
%>
</BODY>
</HTML>