T
Tony Schlak
Here is the ASP for the page:
<% @LANGUAGE = VBScript %>
<%response.buffer=true%>
<%
Dim objRS
Dim strQuery
Dim strConnection
Dim arrPics
Dim numRows, numRecords, colCounter, displayName, displayPic
Set Session("DB") = Server.CreateObject("ADODB.Connection")
Session("DB").Open("OSC")
strQuery = "SELECT * From vwWebPhoto Order by Name"
Set objRS= Session("DB").Execute(strQuery)
Const numColumns = 5
arrPics = objRS.getrows
%>
<%
Function IsLocal
If Request.QueryString("Local") = "" AND Session("bLocal") = 1 Then
IsLocal = TRUE
Else
IsLocal = FALSE
End If
End Function
%>
<html>
<head>
<script type="text/javascript" src="../include.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Student Pictures</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="STYLESHEET" type="text/css" href="../default2.css">
</head>
<script type="text/javascript">Logo()</script>
<body>
<h1>Current Students</h1>
<table align="center" border="0" cellpadding="1" cellspacing="1">
<%If IsLocal() = True Then%>
<THEAD>
<tr>
<%
For colCounter = 1 to numColumns%>
<%
next
%>
</tr>
</THEAD>
<%
numRecords = ubound(arrPics,2) +1
If numRecords mod numColumns = 0 Then
numRows = numRecords\numColumns
Else
numRows = numRecords\numColumns + 1
End IF
for rowCounter = 1 to numRows
For colCounter = 0 to numColumns-1
if rowCounter + colCounter * numRows <= numRecords then
displayName = arrPics(1, rowCounter + colCounter * numRows-1)
displayPic = arrPics(2, rowCounter +colCounter * numRows-1)
response.write "<td><p align=center><a href=""scripts/profile.asp?DirID="
& arrPics(0, rowCounter + colCounter * numRows-1) & """><img src= " &
displayPic & " /></a><br><text-align=center>" & displayName & "</td>"
Else
Response.write"</tr>"
end if
next
response.write"</tr>"
next
%>
</table>
<%
Else
response.write "<h3 align=center>You are viewing this page outside of the
Optical Science Department</h3>"
End IF%>
<script type="text/javascript">Footer()</script>
</body>
</html>
Right now when it returns the pictures they are arranged like:
A D
B E
C F
I would like:
A B C
D E F
Also the view has info about whether the student is BS or MS or PhD
candidate. I cant seem to figure out how to step into the array and pull
out only the entries with either BS or MS or PhD.
Thanks,
Tony
<% @LANGUAGE = VBScript %>
<%response.buffer=true%>
<%
Dim objRS
Dim strQuery
Dim strConnection
Dim arrPics
Dim numRows, numRecords, colCounter, displayName, displayPic
Set Session("DB") = Server.CreateObject("ADODB.Connection")
Session("DB").Open("OSC")
strQuery = "SELECT * From vwWebPhoto Order by Name"
Set objRS= Session("DB").Execute(strQuery)
Const numColumns = 5
arrPics = objRS.getrows
%>
<%
Function IsLocal
If Request.QueryString("Local") = "" AND Session("bLocal") = 1 Then
IsLocal = TRUE
Else
IsLocal = FALSE
End If
End Function
%>
<html>
<head>
<script type="text/javascript" src="../include.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Student Pictures</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="STYLESHEET" type="text/css" href="../default2.css">
</head>
<script type="text/javascript">Logo()</script>
<body>
<h1>Current Students</h1>
<table align="center" border="0" cellpadding="1" cellspacing="1">
<%If IsLocal() = True Then%>
<THEAD>
<tr>
<%
For colCounter = 1 to numColumns%>
<%
next
%>
</tr>
</THEAD>
<%
numRecords = ubound(arrPics,2) +1
If numRecords mod numColumns = 0 Then
numRows = numRecords\numColumns
Else
numRows = numRecords\numColumns + 1
End IF
for rowCounter = 1 to numRows
For colCounter = 0 to numColumns-1
if rowCounter + colCounter * numRows <= numRecords then
displayName = arrPics(1, rowCounter + colCounter * numRows-1)
displayPic = arrPics(2, rowCounter +colCounter * numRows-1)
response.write "<td><p align=center><a href=""scripts/profile.asp?DirID="
& arrPics(0, rowCounter + colCounter * numRows-1) & """><img src= " &
displayPic & " /></a><br><text-align=center>" & displayName & "</td>"
Else
Response.write"</tr>"
end if
next
response.write"</tr>"
next
%>
</table>
<%
Else
response.write "<h3 align=center>You are viewing this page outside of the
Optical Science Department</h3>"
End IF%>
<script type="text/javascript">Footer()</script>
</body>
</html>
Right now when it returns the pictures they are arranged like:
A D
B E
C F
I would like:
A B C
D E F
Also the view has info about whether the student is BS or MS or PhD
candidate. I cant seem to figure out how to step into the array and pull
out only the entries with either BS or MS or PhD.
Thanks,
Tony