Back to the Source Listing 

<!--#include file="includes/FacConn.inc"-->
<%
'Developer: Angela Johnston
'Date: April 15, 2002
'
'preview.asp - This page allows the user to view how the current faculty members web page will be
' displayed.
'
'***************************************************************************************************************
'Included pages
' FacConn.inc - Checks whether the user has application privileges
' formStyle.css - The style sheet for the Faculty Application
' adovbs.inc - A page usually included with ASP to make opening tables and running queries easier.
' It assigns names to numbers, so that you don't have to remember what each number means.
' footer.asp - Contains the menu that should be located at the bottom of the page
'
'QueryStrings (name - value)
' None
'
'Recordsets (name - value)
' rsUser - (FacConn.inc) contains the current user logged on to the intranet (tblUser)
' rsFac - contains the current faculty member's information (tblFaculty)
' rsCourses - contains the information for all courses that the faculty member teaches (tblCourses)
' rsMiscCat - contains all the miscellaneous categories for the current faculty member (tblMiscCategory)
' rsMiscData - contains information for the current misc category (tblMiscData)
'
'Variables
' strSQL - (FacConn.inc) use to store the sql string for a query
' bAdmin - (FacConn.inc) boolean value, "True" if user is an Administrator, "False" if the user is not
' lngUserID - (FacConn.inc) the ID number for the current user
' strUserLogon - (FacConn.inc) the Logon Name for the current user
' lngFacID - the ID number for the current faculty member
' strLastUpdated - the last time the current faculty member's page was updated
'
'
'***************************************************************************************************************
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="EN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Kansas State University - Department of Agronomy - Faculty Form</title>
<link rel="stylesheet" type="text/css" href="../newhierarchy/styles/agrn.css">
</head>
<body background="../newhierarchy/images/backgroundtile.gif">
<%
Dim rsCourses, rsMiscCat, rsMiscData
Dim lngFacID, strLastUpdated
 

'Open a recordset containing the appropriate faculty member
'If the user is an administrator use the Session variable called "FacID"
'If the user is not an administrator use the lngUserID variable
'Store the Faculty ID number in lngFacID
'Store the last time the faculty page was updated in strLastUpdated
'***********************************************************************
If bAdmin = "True" Then
If Session("FacID") = "" Then
Response.Redirect "http://intranet.oznet.ksu.edu/agronomy/welcome.asp?error=NotFound"
Else
lngFacID = Session("FacID")
End If
 

'Open a recordset containing the current faculty member using the variable lngFacID
Set rsFac = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tblFaculty WHERE fldFacID = " & lngFacID & ";"
rsFac.Open strSQL, fp_conn, adOpenDynamic, adLockOptimistic, adCmdText
Else
 

'Open a recordset containing the current faculty member using the variable lngUserID
Set rsFac = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tblFaculty WHERE fldUserID = " & lngUserID & ";"
rsFac.Open strSQL, fp_conn, adOpenDynamic, adLockOptimistic, adCmdText
End If
If Not rsFac.EOF Then
'store the current faculty member's id
lngFacID = rsFac("fldFacID")
'get the last time the page was updated
strLastUpdated = rsFac("fldTimeStamp")
%>
<div class="center">
<table border="0" cellpadding="0" cellspacing="0" width="640" style="border-collapse: collapse">
<tr>
<td colspan="8">
<h1>Faculty Web Application</h1>
</td>
</tr>
<tr>
<td class="center" colspan="8">
<table border="0" width="100%" cellpadding="2">
<tr>
<td width="16%">[<a href="editPage.asp">Main Form</a>]</td>
<%If Not Session("strUserLogon")="tfaculty" Then %>
<td width="17%">[<a href="../uploadImage.asp">Edit Picture</a>]&nbsp;</td>
<%End If%>
<td width="17%">[<a href="editGeneral.asp">Edit General Info</a>]</td>
<td width="17%">[<a href="editProfessional.asp">Edit Professional
Info</a>]</td>
<td width="17%">[<a href="editMiscCategory.asp">Add Miscellaneous
Info</a>]</td>
<td width="17%">[<a href="editCourse.asp?Add=yes">Add Course</a>]
<p>&nbsp;</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><!--webbot bot="Include"
u-include="../newhierarchy/includes/insidemenu.htm" tag="BODY" -->
</td>
</tr>
<tr>
<td colspan="8" width="640">
<hr>
</td>
</tr>
<tr>
<td colspan="8" width="640">
<p class="locationlinks">Location: <a href="../newhierarchywelcome.asp">Home</a>
&gt; <a href="../welcome.asp">People</a> &gt; <%= rsFac("fldName")%></td>
</tr>
<tr>
<td class="drkcreamcellcolumn" width="200" height="78">
<p class="logotypesm"><a href="../newhierarchy/welcome.asp"><img border="0" src="../newhierarchy/images/logotypesm.gif" alt="K-State Agronomy home"></a></td>
<td width="40" height="78" class="redcell"><img border="0" src="../newhierarchy/images/pictures/set2/sunflowerpic.jpg" alt="Sunflower"></td>
<td width="38" class="redcell" height="78"><img border="0" src="../newhierarchy/images/place.gif" alt></td>
<td width="113" class="drkcreamcell" height="78"><img border="0" src="../newhierarchy/images/place.gif" alt></td>
<td width="62" height="78" class="goldcell"><img border="0" src="../newhierarchy/images/pictures/lndscppic.jpg" alt="field"></td>
<td width="61" class="goldcell" height="78"><img border="0" src="../newhierarchy/images/place.gif" alt></td>
<td width="63" height="78" class="goldcell"><img border="0" src="../newhierarchy/images/pictures/set2/wheatripepic.jpg" alt="wheat"></td>
<td width="63" class="bluecell"><img border="0" src="../newhierarchy/images/pictures/set2/sorghumpic.jpg" alt="sorghum"></td>
</tr>
<tr>
<td class="drkcreamcellcolumn" width="200"><br/>
<!--webbot bot="Include"
u-include="../newhierarchy/includes/randicons.asp" tag="BODY" -->
<div class="indentinside">
<a class="linkside" onmouseover="Show(1)" onmouseout="Hide(1)" href="../newhierarchy/aboutus">About
Us<img border="0" src="../newhierarchy/images/tri.gif"></a>
</div>
<div class="indentinside">
<a class="linkside" onmouseover="Show(2)" onmouseout="Hide(2)" href="../newhierarchy../academics/">Academics<img border="0" src="../newhierarchy/images/tri.gif"></a>
</div>
<div class="indentinside">
<a class="linkside" href="../EXTENSION">Extension</a>
</div>
<div class="indentinside">
<a class="linkside" href="../newhierarchy/research">Research</a>
</div>
<div class="indentinside">
<a class="linkside" onmouseover="Show(3)" onmouseout="Hide(3)" href="../newhierarchy/testing%20services">Testing
Services<img border="0" src="../newhierarchy/images/tri.gif" alt=" "></a>
</div>
<div class="indentinside">
<a class="linkside" onmouseover="Show(4)" onmouseout="Hide(4)" href="../newhierarchy/people">People<img border="0" src="../newhierarchy/images/tri.gif" alt=" "></a>
</div>
<div class="indentinside">
<a class="linkside" onmouseover="Show(5)" onmouseout="Hide(5)" href="../newhierarchy/events">Events<img border="0" src="../newhierarchy/images/tri.gif" alt=" "></a>
</div>
<div class="indentinside">
<a class="linkside" href="../newhierarchy/links">Links</a>
</div>
<div class="indentinside">
<a class="linkside" href="intranet.oznet.ksu.edu/agronomy">Intranet <img border="0" src="../newhierarchy/images/key.gif" alt=" "></a>
</div>
<div class="indentinside">
<a class="linkside" href="../welcome.htm">Home</a>
</div>
&nbsp;<!--webbot bot="Include"
u-include="../newhierarchy/includes/search.asp" tag="BODY" -->
<p><br>
<img border="0" src="../newhierarchy/images/bar.gif" width="90%" height="2" alt=" "></p>
<address class="indent">
&nbsp;
</address>
<address class="indent">
Department of Agronomy<br>
2004 Throckmorton<br>
Plant Sciences Center<br>
Kansas State University Manhattan, KS 66506 USA<br>
<br>
Phone (785) 532-6101<br>
Fax (785) 532-6094 <a href="mailto:agronomy@ksu.edu">agronomy@ksu.edu</a>
</address>
<address class="indent">
&nbsp;
</address>
<address class="indent">
<img border="0" src="../newhierarchy/images/bar.gif" width="90%" height="2" alt=" ">
</address>
<p class="indent"><a href="../newhierarchy/sitemap" class="links">Site
Map</a><br>
<a href="http://www.ksu.edu" class="links">K-State</a><br>
<a href="http://www.ag.ksu.edu/" class="links">College of Agriculture</a><br>
&nbsp;</td>
<td colspan="7" width="440" valign="top">
<div class="center">
&nbsp;
<table border="0" cellpadding="4" cellspacing="0" style="border-collapse: collapse" width="98%" id="AutoNumber1">
<tr>
<td colspan="3" height="41">
<h1 class="center"><%= rsFac("fldName")%></h1>
</td>
</tr>
<tr>
<td rowspan="5">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber3" class="picborder">
<tr>
<td><%If Not Session("strUserLogon")="tfaculty" Then %><img src="<%= rsFac("fldPictureURL")%>" alt="<%= rsFac("fldName")%>" border="0"><%Else%><br>
<br>
No Image will be<br>
added for the Test Faculty Page<br>
<br>
<%End If%></td>
</tr>
</table>
</td>
<td>
<p class="title">Position:&nbsp;&nbsp;</td>
<td>
<%= rsFac("fldPosition")%></td>
</tr>
<tr>
<td>
<p class="title">Office:&nbsp;</td>
<td>
<%= rsFac("fldOffice")%> Throckmorton Plant Sciences Center</td>
</tr>
<tr>
<td>
<p class="title">Phone:</td>
<td>
<%= rsFac("fldPhone")%></td>
</tr>
<tr>
<td>
<p class="title">Fax:</td>
<td>
<%= rsFac("fldFax")%>
</td>
</tr>
<tr>
<td>
<p class="title">E-mail:</td>
<td><a href="mailto:<%= rsFac("fldEmail")%>"><%= rsFac("fldEmail")%></a></td>
</tr>
</table>
<p>&nbsp;</p>
<table align="center" border="0" cellpadding="4" cellspacing="0" style="border-collapse: collapse" width="98%" id="AutoNumber2">
<tr>
<td width="100%" height="18" colspan="2">
<p class="happenings">PROFESSIONAL INFO: <span class="smaller"><% If Not rsFac("fldVitae") = "" Then %><a href="<%= rsFac("fldVitae") %>">Vitae</a><% End If %></span></p>
</td>
</tr>
 
<%If Not rsFac("fldResearchInterest") = "" Then%>
<tr>
<td>
<p class="title">Research Interest:</p>
</td>
<td>
<p><%= rsFac("fldResearchInterest")%></p>
</td>
</tr>
<%End If%>
<%
 

'Select all information for courses taught by the current faculty member
Set rsCourses = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblCourses.fldCourseID, tblCourses.fldNumber, tblCourses.fldName, tblCourses.fldDescURL, tblCourses.fldWebPageURL"
strSQL = strSQL & " FROM tblCourses INNER JOIN tblCoursesTaught ON tblCourses.fldCourseID = tblCoursesTaught.fldCourseID"
strSQL = strSQL & " WHERE (((tblCoursesTaught.fldFacID)=" & lngFacID & "));"
rsCourses.Open strSQL, fp_conn, adOpenDynamic
If Not rsCourses.EOF Then
 

'If the faculty member has courses, loop through and display all their course information
'****************************************************************************************
%>
<tr>
<td>
<p class="title">Courses taught:</p>
</td>
<td>
<% Do While Not rsCourses.EOF
Response.Write "<p class='facIndent'>"
If rsCourses("fldDescURL") <> "" Then
Response.Write "<a href='" & rsCourses("fldDescURL") & "'>"
Response.Write rsCourses("fldNumber") & "&nbsp; "
Response.Write rsCourses("fldName")
Response.Write "</a>"
Else
Response.Write rsCourses("fldNumber") & "&nbsp; "
Response.Write rsCourses("fldName")
End If
If rsCourses("fldWebPageURL") <> "" Then
Response.Write " - "
Response.Write "<a href='" & rsCourses("fldWebPageURL") & "'>"
Response.Write "Course Web Page"
Response.Write "</a>"
 

End If
Response.Write "</p>"
rsCourses.MoveNext
Loop
%>
 
</td>
</tr>
 
<%
rsCourses.Close
End If
%>
<tr>
<td>
<p class="title">Education:</p>
</td>
<td>
<%If rsFac("fldBS")<>"" Then%>
<p class="facindent">BS <%= rsFac("fldBS")%></p>
<%End If%>
<%If rsFac("fldMS")<>"" Then%>
<p class="facindent">MS <%= rsFac("fldMS")%></p>
<%End If%>
<%If rsFac("fldPhD")<>"" Then%>
<p class="facindent">PhD <%= rsFac("fldPhD")%></p>
<%End If%>
</td>
</tr>
<%If Not rsFac("fldHonors") = "" Then%>
<tr>
<td>
<p class="title">Honors:</p>
</td>
<td>
<p><%= rsFac("fldHonors")%></p>
</td>
</tr>
<% End If %>
<%'Open rsMiscCat for the current faculy member
Set rsMiscCat = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tblMiscCategory WHERE ((fldFacID)=" & lngFacID & ");"
rsMiscCat.Open strSQL, fp_conn, adOpenDynamic
'Loop through each of the Misc Categories for the current faculty member, and
'Display each of the Misc Data Items for each of the Categories
'****************************************************************************
%>
 
 
<% While Not rsMiscCat.EOF %>
 
<tr>
<td>
<p class="Title"><%= rsMiscCat("fldMiscTitle") & ":" %></p>
</td>
<td></td>
</tr>
<% 'Open rsMiscData for the current Misc Category
Set rsMiscData = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tblMiscData WHERE ((fldMiscCatID)=" & rsMiscCat("fldMiscCatID") & ");"
rsMiscData.Open strSQL, fp_conn, adOpenDynamic, adCmdText
'Loop through the rsMiscData and display each of the Misc Data
'items for the current Misc Category
'*************************************************************
While Not rsMiscData.EOF
 

%>
 
<tr>
<td></td>
<td>
<% If IsNull( rsMiscData("fldLocation")) Then %>
<p class="facIndent"><%= rsMiscData("fldInformation") %></p>
<% Else %>
<a href="<%= rsMiscData("fldLocation")%>"><%= rsMiscData("fldInformation") %></a>
<% End If %>
</td>
</tr>
 
 
<% rsMiscData.MoveNext
Wend %>
 
<%
rsMiscCat.MoveNext
Wend %>
 
<tr>
<td colspan="2"><br>
<br>
</td>
</tr>
<tr>
<td>
<p class="Title">Last Updated:</p>
</td>
<td><%= rsFac("fldTimeStamp")%></td>
</tr>
<%
'Close the faculty recordset
%>
</table>
</div>
<br/>
<br/>
</td>
</tr>
<tr>
<td colspan="8" width="640"><!--webbot bot="Include"
u-include="../newhierarchy/includes/bottomlinks.htm" tag="BODY" -->
</td>
</tr>
<% Else %>
<tr>
<td colspan="8">
<h2>Web Page has not been created</h2>
<%
'If no faculty record was available
End If
%>
 
</td>
</tr>
</table>
</div>
</body>