Back to the Source Listing 


<!--#include file="includes/FacConn.inc"-->

<%
'Developer: Angela Johnston
'Date: January 21, 2002
'
'editPage.asp - This page contains form buttons that allow the user to access forms that update
' the current faculty member's web page.
'
'***************************************************************************************************************
'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
'
'Forms
' frmGeneral - contains a button that leads to the editGeneral.asp page
' frmUploadImage - contains a button that leads to the uploadImage.asp page
' frmProfessional - contains a button that leads to the editProfessional.asp page
' frmAddMiscCategory - contains a button that leads to the editMiscCategory.asp page
' frmEditMiscCategory - contains a button that leads to the editMiscCategory.asp page
' It specifies which Category is to be edited using a QueryString
' frmRemoveMiscData - contains a button called Remove that leads to the addMiscCategory.asp page
' It specifies which item is to be removed using a QueryString
' frmAddCourse - contains a button called Add that leads to editCourse.asp
' frmEditCourse - contains buttons called Edit and Remove that lead to editCourse.asp
' It specifies which Category is to be edited using a QueryString
'
'***************************************************************************************************************
%>

<!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="includes/formStyle.css">
<script Language
="JavaScript">
<!--
function verifyDelete()
{
var reply = confirm("Are you sure you want to DELETE this faculty member?");
 
if(reply)
{ return true; }
 
return false;
}
//-->

</script>
</head>
<body background=
"../newhierarchy/images/backgroundtile.gif">
<div class=
"center">
<table summary=" " width="80%" cellspacing="0" cellpadding="0">
<tr>
<td>
<%
Dim rsFac, rsCourses, rsMiscCat, rsMiscData
Dim lngFacID, strLastUpdated
'If there is an error skip it and continue displaying the page
On Error Resume Next
'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")
%>

<table summary=" ">
<tr>
<td colspan="5">
<h1>Faculty Web Application</h1>
</td>
</tr>
<tr>
<td class="center">[<a href="http://intranet.oznet.ksu.edu/agronomy/uploadImage.asp">Edit
Picture</a>]&nbsp;</td>
<td class="center">[<a href="editGeneral.asp">Edit General Info</a>]&nbsp;</td>
<td class="center">[<a href="editProfessional.asp">Edit Professional
Info</a>]</td>
<td class="center">[<a href="editMiscCategory.asp">Add Miscellaneous
Info</a>]</td>
<td class="center">[<a href="editCourse.asp?Add=yes">Add Course</a>]</td>
</tr>
<tr>
<td colspan="5">
<hr>
<% If bAdmin = "True" Then %>
<form method="POST" name="frmDelete" action="deleteFaculty.asp">
Only select this button if you want to permanently delete this
faculty member from the faculty's database.<br>
<br>
<input type="submit" onclick="return verifyDelete()" value="Delete Faculty Member From the Database" alt="Delete Faculty Member" name="Delete">
</form>
<hr>
<% End If %>
<form method="POST" name="frmGeneral" action="editGeneral.asp">
<br>
<input type="submit" value="Edit General Information" alt="Edit General Information" name="B3">
</form>
<h2><%= rsFac("fldName")%></h2>
<table summary=" " cellpadding="5" cellspacing="5" width="100%">
<tr>
<td rowspan="6">
<table summary=" " border="4" cellpadding="0" cellspacing="0">
<tr>
<td><img src="<%= rsFac("fldPictureURL")%>" alt="picture of <%= rsFac("fldName")%>"></td>
</tr>
</table>
<form method="POST" name="frmUploadImage" action="http://intranet.oznet.ksu.edu/agronomy/uploadImage.asp">
<input type="hidden" alt=" " name="VTI-GROUP" value="0"><input type="submit" alt="Update Picture" value="Update Picture" name="B3">
</form>
</td>
</tr>
<tr>
<td><strong>Position:</strong></td>
<td><strong><%= rsFac("fldPosition")%></strong></td>
</tr>
<tr>
<td><strong>Office:</strong></td>
<td><strong><%= rsFac("fldOffice")%><br>
<a href="../../MAPS/throck.asp">Throckmorton Plant Sciences
Center</a></strong></td>
</tr>
<tr>
<td><strong>Phone:</strong></td>
<td><strong><%= rsFac("fldPhone")%></strong></td>
</tr>
<tr>
<td><strong>Fax:</strong></td>
<td><strong><%= rsFac("fldFax")%></strong></td>
</tr>
<tr>
<td><strong>E-mail:</strong></td>
<td><a href="mailto:<%= rsFac("fldEmail")%>"><%= rsFac("fldEmail")%></a></td>
</tr>
</table>
<hr>
<form method="POST" name="frmProfessional" action="editProfessional.asp">
<input type="submit" alt="Edit Professional Information" value="Edit Professional Information" name="B3">
</form>
<table width="100%" cellspacing="0" cellpadding="5">
<tr>
<td width="30%"><strong>PROFESSIONAL INFO:</strong></td>
<td width="70%"><% If Not rsFac("fldVitae") = "" Then %><a href="<%= rsFac("fldVitae") %>">Vitae</a><% End If %></td>
</tr>
<%If Not rsFac("fldResearchInterest") = "" Then%>
<tr>
<td width="30%"><strong>Research Interest:</strong></td>
<td width="70%">
<pre><%= rsFac("fldResearchInterest")%></pre>
</td>
</tr>
<%End If%>
<tr>
<td width="30%"><strong>Education:</strong></td>
<td width="70%"><%= rsFac("fldBS")%><br>
<%= rsFac("fldMS")%><br>
<%= rsFac("fldPhD")%>
<br>
<br>
</td>
</tr>
<%If Not rsFac("fldHonors") = "" Then%>
<tr>
<td width="30%"><strong>Honors:</strong></td>
<td width="70%">
<pre><%= rsFac("fldHonors")%></pre>
</td>
</tr>
<%
End If
 
'Close the faculty recordset
rsFac.Close
'Open rsMiscCat for the current faculyt member using lngFacID
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
'****************************************************************************
%>

 
<tr>
<td colspan="2">
<hr>
</td>
</tr>
<tr>
<td colspan="2" width="580">
<form method="POST" name="frmAddMiscCategory" action="editMiscCategory.asp">
<input type="submit" alt="Add Miscellaneous Category" value="Add Miscellaneous Category" name="B3"><br>
<br>
</form>
</td>
</tr>
<% While Not rsMiscCat.EOF %>
<tr>
<td colspan="2">
<hr>
</td>
</tr>
<tr>
<td colspan="2" width="580">
<form method="POST" name="frmEditMiscCategory" action="editMiscCategory.asp?fldMiscCatID=<%= rsMiscCat("fldMiscCatID") %>">
<input type="submit" alt="Edit Miscellaneous Category" value="Edit Miscellaneous Category" name="B4"><br>
<br>
</form>
</td>
</tr>
<tr>
<td width="30%"><strong><%= rsMiscCat("fldMiscTitle") & ":" %></strong></td>
<td width="70%"></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 width="30%"></td>
<td width="70%">
<form method="POST" name="frmRemoveMiscData" action="addMiscCategory.asp?fldMiscDataID=<%= rsMiscData("fldMiscDataID") %>">
<strong>
<% If IsNull( rsMiscData("fldLocation")) Then %>
<% If Not IsNull(rsMiscData("fldInformation")) Then Response.Write rsMiscData("fldInformation") End If %>
<% Else %>
<a href="<%= rsMiscData("fldLocation")%>">
<% If Not IsNull(rsMiscData("fldInformation")) Then Response.Write rsMiscData("fldInformation") End If %>
</a></strong>
<% End If %>
<input type="submit" alt="Remove Item from Category" value="Remove Item from Cateogory" name="Remove">
</form>
</td>
</tr>
 
 
<% rsMiscData.MoveNext
Wend %>

 
<%
rsMiscCat.MoveNext
Wend %>

 
<tr>
<td colspan="2">
<hr>
</td>
</tr>
<tr>
<td colspan="2" width="580">
<form method="POST" name="frmAddCourse" action="editCourse.asp">
<input type="submit" alt="Add New Course" value="Add New Course" name="Add">
</form>
</td>
</tr>
<%
 
'Select all information for courses taught by the current faculty member
'(lngFacID) being edited.
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 width="30%"><strong>Courses:</strong></td>
<td width="70%">
<% Do While Not rsCourses.EOF %>
<form method="POST" name="frmEditCourse" action="editCourse.asp?ID=<%= rsCourses("fldCourseID") %>">
<input type="submit" alt="Edit" value="Edit" name="Edit">
<%
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
 
%>

<input type="submit" alt="Remove" value="Remove" name="Remove">
</form>
 
<%
rsCourses.MoveNext
Loop
%>

 
</td>
</tr>
 
<%
rsCourses.Close
End If
%>

 
<tr>
<td width="30%">
<p class="smaller">LAST UPDATED: <%= strLastUpdated %></p>
</td>
<td width="70%"></td>
</tr>
</table>
</td>
</tr>
</table>
<% Else %>
<h2>Web Page has not been created</h2>
<%
'If no faculty record was available
rsFac.Close
End If
%>

<!--webbot bot="Include" u-include="includes/footer.asp" tag="BODY" --></td>
</tr>
</table>
</div>
</body>
</html>