<%@ LANGUAGE="VBSCRIPT" %> <% '-- Global Variables -- 'Dim gradename strPageURL = "pattillo_readrep.asp" blnNeedRs = False ' True: Create New Recordset blnEmptyRs = False ' True: Database Query Returned empty recordset adMaximumShow = 30 ' Maximum show on page strFilename = Request.ServerVariables("PATH_INFO") strnameParts = Split(strFilename,"/") strFilename = strnameParts(UBound(strnameParts)) ' -- Retrieve Page Parameters 'Response.Write "BlnNeedRs is :" & BlnNeedRs ' determine the current page number strPageNmr = FormatTextHTML(request.QueryString("Page")) If strPageNmr = "" Then If IsEmpty(Session("PageNmr_Sch_aa")) Then intPageNmr = 1 Else 'intPageNmr = Session("PageNmr_Sch_aa") End If Else intPageNmr = CInt(strPageNmr) Session("PageNmr_Sch_aa") = intPageNmr End If 'Comment started Sanjay If IsEmpty(Session("Schoolname_aa")) Then Session("Schoolname_aa") = " " End If strAge = FormatTextHTML(request.QueryString("Age")) If strAge <> "" Then Session("Age_aa") = strAge Else strAge = Session("Age_aa") End If If IsEmpty(Session("SortType_Sch_aa")) Then Session("SortType_Sch_aa") = "Title" End If strSort = FormatTextHTML(request.QueryString("Sort")) If strSort = "" Then strSort = Session("SortType_Sch_aa") End If Select Case strSort Case "State": strSortBy = "State, Q1, Firstname, LastInitial" Case "Student": strSortBy = "Firstname, LastInitial" Case "Title": strSortBy = "Q1, Firstname, LastInitial" End Select If IsEmpty(Session("avar_Reports_Sch_aa")) Then blnNeedRs = True ElseIf Session("SortType_Sch_aa") <> strSort Then blnNeedRs = True 'ElseIf FormatTextHTML(request.QueryString("School")) <> "" Then '---->Sanjay ElseIf FormatTextHTML(request.QueryString("Age")) <> "" Then blnNeedRs = True End If '-- Open Database Connection -- ' Select if BlnNeedRs is true If blnNeedRs Then Set rs = Server.CreateObject("ADODB.Recordset") 'strSQL = "SELECT Grade, Firstname, LastInitial, Q1, Q2, Schoolname, Age, ReportID FROM CB_HowFeel WHERE Status =" & adLive & " AND Hold = 0 AND Schoolname = '" & strSchoolname & "' ORDER BY " & strSortBy strSQL = "SELECT Age, Firstname, LastInitial, Q1, Q2, 'DUMMYCOLUMN', State, ReportID FROM " & table_name & " WHERE Status =" & adLive & " AND Hold = 0 AND Age = '" & strAge & "' AND WritingType='PATI' " & " ORDER BY " & strSortBy 'rs.Open strSQL, Application("DBConn"), 3, 3 rs.Open strSQL, CONNECTION_STRING, 3, 3 If NOT (rs.EOF AND rs.BOF) Then 'gradename = rs("Grade") avarReports = rs.GetRows() Else blnEmptyRs = True End If Session("avar_Reports_Sch_aa") = avarReports Session("SortType_Sch_aa") = strSort Else avarReports = Session("avar_Reports_Sch_aa") End If On Error Resume Next 'Calculate # of pages If NOT blnEmptyRs Then intTotalPages = Fix((UBound(avarReports,2) + 1) /adMaximumShow) If UBound(avarReports,2) + 1 mod adMaximumShow <> 0 Then intTotalPages = intTotalPages + 1 End If End If Function WrapIt(textfield) dim strCount, strLineSize,LineCount, LineInitial, LineTerminator, strTimes strCount = len(textfield) LineCount = 20 LineInitial = 1 LineTerminator = "
" textfield = replace(textfield,chr(13)&chr(10),"
") strTimes= strCount/LineCount For i=0 to Cint(strTimes) strValue = strValue & mid(textfield, LineInitial, LineCount) & LineTerminator LineInitial = LineInitial + LineCount next WrapIt = strValue End Function strNavBar = "" '****** Generate page(s) link (30 records per each page) *********** If NOT blnEmptyRs Then ' -- JUMP TO PAGE linkS -- If intTotalPages > 1 Then 'Generate pages only if find more than 30 records If (intPageNmr > 1) then strNavBar = strNavBar & "<<Previous " End If For intI = 1 To intTotalPages If intI <> intPageNmr Then strNavBar = strNavBar & " | " & intI & " " Else strNavBar = strNavBar & " | " & intI & " " End If Next strNavBar = strNavBar & "|" If ((intTotalPages > 1) and (intPageNmr < intTotalPages)) then strNavBar = strNavBar & " Next>>" End If strNavBar = strNavBar & "" End If End If %> How Would You Feel? <% doMenu %>


1. Big Decisions
2. First Day
3. Inside-Briefly
4. Integration Is the Law
5. Fighting to Learn
6. Becoming a Warrior
7. Endings and
Beginnings
8. Reunion
Interview

Melba Pattillo Home

<% 'Generate List of records in selected page. Default is first page. If NOT blnEmptyRs Then 'There is some record exist on the selection If (intPageNmr <> intTotalPages) and (intTotalPages > 1) Then intRepShow = adMaximumShow Elseif (intPageNmr > 0) and (intTotalPages > 1) Then intRepShow = UBound(avarReports,2) - ((intPageNmr-1) * adMaximumShow) + 1 Else intPageNmr = 1 intRepShow = UBound(avarReports,2) + 1 End If intShift = (intPageNmr - 1) * adMaximumShow For intLoop = intShift To intRepShow + intShift - 1 Response.Write "" Response.Write "" Response.Write "" Next Else 'No Record exist - output Message Response.Write "" End If %>
Age <%=strAge%>
<% 'Display Current page of total pages If FormatTextHTML(request("Page")) <> "" then ' Is there Page # passed? Page = FormatTextHTML(request("Page")) ' Yes, there is If IsNumeric(Page) then Page = Int(Page) Else If intTotalPages > 1 Then intPageNmr = 1 End If PageURL = "readsch.asp" 'strPageTitle = "Administration Page" If FormatTextHTML(request("rand"))= NULL or FormatTextHTML(request("rand")) = "" then rndnum = rnd else rndnum = FormatTextHTML(request("rand"))+ 1 end if If intTotalPages > 1 Then Response.Write "Page: " & intPageNmr & " of " & intTotalPages End If %>
<%=strNavBar%>
Click the red arrows to sort by Title, Author, or State/Country. Click the student's name to read the selection.
Title
 ">
Written By
 ">
State/Country
 ">
" & avarReports(3,intLoop) & "" & avarReports(1,intLoop) If avarReports(2,intLoop) <> "" Then Response.Write " " & avarReports(2,intLoop) & "." End If Response.Write"" & WrapIt(avarReports(6,intLoop)) & "
No reports available.

 

 

<% doFooter %>