<!DOCTYPE HTML PUBLIC "-//SoftQuad Software//DTD HoTMetaL PRO 6.0::19990601::extensions to HTML 4.0//EN" "hmpro6.dtd"> <HTML><% @Language=VBScript %> <HEAD> <%'***************************************************************************************************************** ' Set up initial variables and ODBC connection '**************************************************************************************************************** Dim TableCount Dim TotalArray(9) Dim TableArray(21,9) Dim TRow, TIndc, x, QueryRows, LowerBound, UpperBound, y, A Dim ReportCode InitVariables(0) TRow = 0 TIndc = 0 QueryRows = 0 Set Conn = Server.CreateObject("ADODB.Connection") conn.Open "Student" 'This is the name of the ODBC connection to the SQL server that was specified at the SERVER Set cmd = Server.CreateObject("ADODB.Command") Set cmd.ActiveConnection = Conn adCmdStoredProc = 4 cmd.CommandType = adCmdStoredProc 'States that it is a stored procedure LocationCode = Request.QueryString("LocationCode") 'U,C,M SemesterCodes = Request("SemesterCodes")' 199900FA200001FA CurrentYear = Mid(SemesterCodes,9,4) ViewName = Request("View") select case LocationCode case "U"%> <TITLE>University Park Enrollment Summary</TITLE> <%case "C"%> <TITLE>Campus Locations Enrollment Summary</TITLE> <%case "M"%> <TITLE>College of Medicine Enrollment Summary</TITLE> <%end select '***********************************************************************************************************%> <!--#include file ="../HeaderFBLevel1.htm" --> </HEAD> <BODY TEXT="#000000" bgcolor="FFFFFF"><br> <TABLE WIDTH="600" ALIGN="center" BORDER="0" CELLPADDING="0" CELLSPACING="0"> <TR> <TD> <TABLE WIDTH="70%" ALIGN="center" BORDER="0" CELLPADDING="0" CELLSPACING="0"> <TR>&nbsp; </TR> <TR> <TD COLSPAN="5" ALIGN="middle" HEIGHT="45"><FONT SIZE="4"><b> <%'This is for the header of the page%> Fall Enrollment Summary<br> <%If LocationCode = "U" then%> University Park <%elseif LocationCode = "C" then%> Campus Locations <%else %> College of Medicine <%end if%> <BR><%=Mid(SemesterCodes,9,4)%> and <%=Left(SemesterCodes,4)%><BR><br> </td> </tr> <TR> <TD width="55%" ALIGN="left" HEIGHT="25" VALIGN="bottom" colspan="2">&nbsp;</TD> <TD width="15%" ALIGN="middle" HEIGHT="25" VALIGN="bottom" ><B>&nbsp;</B></TD> <TD width="15%" ALIGN="middle" HEIGHT="25" VALIGN="bottom" ><B>&nbsp;</B></TD> <TD width="15%" ALIGN="middle" HEIGHT="25" VALIGN="bottom" ><B>&nbsp;</B></TD> </TR> <TR VALIGN="bottom"> <TD width="55%" ALIGN="left" HEIGHT="15" VALIGN="bottom" colspan="2"> </TD> <TD width="15%" ALIGN="right" HEIGHT="15" VALIGN="bottom" ><B><%=Mid(SemesterCodes,9,4)%>&nbsp;</B></TD> <TD width="15%" ALIGN="right" HEIGHT="15" VALIGN="bottom" ><B><%=Left(SemesterCodes,4)%>&nbsp;</B></TD> <TD width="15%" ALIGN="right" HEIGHT="15" VALIGN="bottom" ><B>Change</B></TD> </TR> <TR> <TD COLSPAN="10"><HR></TD> </TR> <!-- </table> <TABLE WIDTH="70%" ALIGN="center" BORDER="1" CELLPADDING="0" CELLSPACING="0"> --> <%BuildTableArray()'This calls the Build Table Array function, which calls 'the stored procedures and puts the result in an array%> <%for RowCount = 0 to queryrows 'Loop is executed 1, 2,or 3 times depending on number of tables needed %> <tr> <%'This outputs the title of each row from array%> <td width="52%" COLSPAN="2"><%=TableData1(cstr(RowCount))%> </td> <%for subscript = 1 to 2 %> <TD ALIGN="right" width="16%"> <%=checkblank(TableArray(RowCount,subscript),subscript,RowCount)%> </td> <% next%> <%'for subscript = 1 to 2 %> <TD ALIGN="right" width="16%"> <%=FormatNumber((TableArray(RowCount,1)- TableArray(RowCount,2)),0,,-1)%> </td> </TR> <%next%> <%'for RowCount = 0 to queryrows %> <%select case LocationCode%> <%case "U"%> <tr BGCOLOR="#c8c8c8" > <td width = "50%" colspan="2" >&nbsp;&nbsp;<b>Subtotal</b></td> <%for subscript = 1 to 2 %> <TD ALIGN="right"><B><%=formatnumber(TotalArray(subscript),0)%></B></TD> <% next%> <%'for subscript = 1 to 2 %> <TD ALIGN="right" width="18%"> <b><%=FormatNumber((TotalArray(1)-TotalArray(2)),0,,-1)%></b> </td> </TR> <%for RowCount = 11 to 12%> <%if RowCount = 12 then%> <TR> <TD COLSPAN="10"><hr></TD> </TR> <%end if%> <tr <%if RowCount=12 then%>BGCOLOR="#c8c8c8"<%elseif RowCount=11 then%>height="25" valign="bottom" <%end if%>> <td colspan="2"><%if RowCount=12 then%><b><%end if%> <%=TableArray(RowCount,0)%> <%if RowCount=12 then%></b><%end if%> </td> <%for subscript = 1 to 2 %> <TD width="15%" ALIGN="right" > <%if RowCount=12 then%><b><%end if%> <%=checkblank(TableArray(RowCount,subscript),subscript,RowCount)%> <%if RowCount=12 then%></b><%end if%> </TD> <%next%> <%'for subscript = 1 to 2 %> <TD ALIGN="right" width="18%"> <%if RowCount=12 then%><b><%end if%> <%=FormatNumber((TableArray(RowCount,1)- TableArray(RowCount,2)),0,,-1)%> <%if RowCount=12 then%></b><%end if%> </td> </TR> <%next%> <%'for RowCount = 11 to 12%> <%Case "C","M"%> <TR> <TD COLSPAN="10"><hr></TD> </TR> <tr BGCOLOR="#c8c8c8"> <td width="50%" COLSPAN="2"><b><%=TableArray(queryrows+1,0)%></b></td> <%for subscript = 1 to 2 %> <TD ALIGN="right" width="16%"><b> <%=checkblank(TableArray(queryrows+1,subscript),subscript,queryrows+1)%></b></TD> <%next%> <%'for subscript = 1 to 2 %> <TD ALIGN="right" width="18%"> <b><%=FormatNumber((TableArray(queryrows+1,1)- TableArray(queryrows+1,2)),0,,-1)%></b> </td> </TR> <%end select%> <TR><TD>&nbsp;</TD></TR> <TR><TD>&nbsp;</TD></TR> </TABLE> <TABLE BORDER="0" WIDTH="70%" CELLSPACING="0" CELLPADDING="0" ALIGN="center"> <TR> <TD VALIGN="bottom" ALIGN="right"> <A href="StudentTableOfContents<%=CurrentYear%>.asp">Table of Contents</A> </TD> </TR> </TABLE> </TD> </TR> </TABLE> <!--#include file ="../FooterFactBook.htm" --> </BODY> </HTML> <%' -----------------------------------------------------------------------------------------------------------------------------------------------> 'Function Section '-------------------------------------------------------------------------------------------------------------------------------------------------> public function BuildTableArray() 'This function gets the data from database and stores in array 'Following code is for first call to SQL Server to execute stored procedure select case LocationCode case "U" cmd.CommandText = "SPEnrollByCollege2YearsUP" cmd.Parameters("@CurrYear") = Mid(SemesterCodes,9,8) cmd.Parameters("@PrevYear") = Left(SemesterCodes,8) cmd.Parameters("@ViewName") = ViewName queryrows = 10 '10 rows expected case "C" cmd.CommandText = "SPEnrollByCampus2Years" cmd.Parameters("@CurrYear") = Mid(SemesterCodes,9,8) cmd.Parameters("@PrevYear") = Left(SemesterCodes,8) cmd.Parameters("@ViewName") = ViewName queryrows = 19 '19 rows expected case "M" cmd.CommandText = "SPEnrollByCollege2YearsHY" cmd.Parameters("@CurrYear") = Mid(SemesterCodes,9,8) cmd.Parameters("@PrevYear") = Left(SemesterCodes,8) cmd.Parameters("@ViewName") = ViewName queryrows = 1 end select set RS = cmd.Execute 'Execute stored procedure for x= 0 to queryrows if not RS.eof then for y = 0 to 2 TableArray(x,y) = RS(y) ' Store data from database RS(y) into array next RS.movenext 'move to next record in recordset end if next set RS = RS.nextrecordset select case LocationCode case "U" for x = 11 to 12 ' x = 11 set RS = RS.nextrecordset set RS = RS.nextrecordset for y = 0 to 1 TableArray(x,y+1) = RS(y) next if x = 12 then RS.close set RS = nothing end if next TableArray(11,0) = "Other Areas" TableArray(12,0) = "Total" case "C","M" for y = 0 to 1 TableArray(queryrows+1,0) = "Total" TableArray(queryrows+1,y+1) = RS(y) next end select end function '-------------------------------------------------------------------------------------------- public function TableData1(Row) 'Returns first cell of the row if TableArray(Row,0) = "MD" then TableData1 = "Doctor of Medicine" elseif TableArray(Row,0) = "GR" then TableData1 = "Graduate" else TableData1 = TableArray(Row,0) end if end function '------------------------------------------------------------------------------------------------ public function InitVariables(value) 'initialize TotalArray for subscript = 1 to 8 TotalArray(subscript) = value next end function '------------------------------------------------------------------------------------------------- public function CheckBlank(value,subscript,RowCount) 'Format data if blank or if a number, add to TotalArray if value > " " then checkblank = formatnumber(value,0) TotalArray(subscript) = TotalArray(subscript) + formatnumber(value,0) else checkblank = " " TotalArray(subscript) = TotalArray(subscript) + 0 end if end function '--------------------------------------------------------------------------- %>