<%@ LANGUAGE="VBSCRIPT" %> <% '-- Global Variables -- 'Dim gradename 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 ' 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 'Comment endedd 'strSchoolname = FormatTextHTML(request.QueryString("School")) 'strSchoolname = FormatTextHTML(request.QueryString("State")) strSchoolname = FormatTextHTML(request.QueryString("grade")) If strSchoolname = "K" then strSchoolname = 0 If strSchoolname <> "" Then Session("Schoolname_aa") = strSchoolname Else strSchoolname = Session("Schoolname_aa") End If If IsEmpty(Session("SortType_Sch_aa")) Then Session("SortType_Sch_aa") = "Student" 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 "Poem": 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("State")) <> "" Then ElseIf FormatTextHTML(request.QueryString("grade")) <> "" Then blnNeedRs = True End If '-- Open Database Connection -- If blnNeedRs Then Set rs = Server.CreateObject("ADODB.Recordset") 'strSQL = "SELECT Grade, Firstname, LastInitial, Q1, Q2, Schoolname, State, ReportID FROM CB_HowFeel WHERE Status =" & adLive & " AND Hold = 0 AND Schoolname = '" & strSchoolname & "' ORDER BY " & strSortBy strSQL = "SELECT Grade, Firstname, LastInitial, Q1, Q2, Schoolname, State, ReportID FROM " & table_name & " WHERE Status =" & adLive & " AND Hold = 0 AND grade = '" & strSchoolname & "' 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 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 %> Poetry Writing with Jean Marzollo <% doMenu %>









Read Student Writing
Grade: <%if strschoolname = 0 then strschoolname = "K" End If%> <%=strSchoolname%>


<% 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 strNavBar = strNavBar & "Page: " & intPageNmr & " of " & intTotalPages & "  " 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 'end of pagination Response.Write "
" & strNavBar %>

Click a column heading to sort by student name, state, or title. Click a title to read the section.

<% '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 Then intRepShow = adMaximumShow Else intRepShow = UBound(avarReports,2) - (intPageNmr-1)*adMaximumShow + 1 End If intShift = (intPageNmr - 1) * adMaximumShow For intLoop = intShift To intRepShow + intShift - 1 Response.Write "" Response.Write "" Response.Write "" Response.Write "" Next Else 'No Record exist - output Message Response.Write "" Response.Write "" End If %>
">Student ">State ">Title
" & avarReports(1,intLoop) If avarReports(2,intLoop) <> "" Then Response.Write " " & avarReports(2,intLoop) & "." End If Response.Write"" & avarReports(6,intLoop) & "" & avarReports(3,intLoop) & "
No reports available.


 

<% doFooter %>