Back to
the Source Listing
<!--#include
file="includes/FacConn.inc"-->
<%
'Developer: Angela Johnston
'Date: February 5, 2002
'
'editGeneral.asp - This page
allows the user to update the general information for the current
' faculty member. The form on
this page sends its information to addGeneral.asp.
'
'***************************************************************************************************************
'Included pages
' FacConn.inc - Checks whether
the user has application priviledges
' formStyle.css - The style sheet
for the Faculty Application
' adovbs.inc - A page usually
included with ASP to make openning 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)
'
'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
'
'Forms
' frmGeneral - send information
to addGeneral.asp
'
'Form Fields
' Name - a text box for the
faculty member's name
' Position - a text box for the
faculty member's title or position
' Office - a text box for the
faculty member's office number
' Phone - a text box for the
faculty member's phone number
' Fax - a text box for the
faculty member's fax number
' Email - a text box for the
faculty member's E-mail Address
'
'***************************************************************************************************************
%>
<!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>Faculty
Form</title>
<link rel="stylesheet"
type="text/css"
href="includes/formStyle.css">
<script Language="JavaScript">
<!--
//Checks fields from the form to
determine whether they are empty
function verifyData()
{
if (isEmpty(document.frmGeneral.Email.value))
{
alert("Your Email field is
empty - please reenter");
return false;
}
return 1;
}
// Check whether string s is
empty.
function isEmpty(s)
{ return ((s == null) || (s.length
== 0))
}
//-->
</script>
</head>
<body background="../newhierarchy/images/backgroundtile.gif">
<div class="center">
<table
summary=" "
cellspacing="0"
cellpadding="0"
width="600">
<tr>
<td colspan="5">
<%
Dim rsFac
Dim lngFacID
'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
'***********************************************************************
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 lngUserID
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
%>
<h1>Faculty
Web Application - General Information</h1>
</td>
</tr>
<tr>
<td class="center">[<a
href="editPage.asp">Main
Form</a>]</td>
<%If Not
Session("strUserLogon")="tfaculty" Then %>
<td class="center">[<a
href="http://intranet.oznet.ksu.edu/agronomy/uploadImage.asp">Edit
Picture</a>]</td>
<%End If%>
<td class="center">[<a
href="editProfessional.asp">Edit
Professional Info</a>]</td>
<td class="center">[<a
href="editMiscCategory.asp">Edit
Miscellaneous Info</a>]</td>
<td class="center">[<a
href="editCourse.asp?Add=yes">Add
Course</a>]</td>
</tr>
<tr>
<td colspan="5">
<hr>
<h2>Edit
General Information for the web</h2>
<form
action="addGeneral.asp"
method="post"
name="frmGeneral"
onsubmit="return verifyData()">
<input
type="Hidden"
alt=" "
name="FacID"
value="<%=
rsFac("fldFacID") %>">
<table
summary=" "
cellpadding="10">
<tr>
<td>
<table
summary=" "
width="600">
<tr>
<td><label
title="label for Name text box">Name:</label></td>
</tr>
<tr>
<td><input
alt="Name"
type="text"
name="Name"
value="<%=
rsFac("fldName") %>"
size="74"></td>
</tr>
<tr>
<td><label
title="label for Position text box">Position:</label></td>
</tr>
<tr>
<td><input
alt="Position"
type="text"
name="Position"
value="<%=
rsFac("fldPosition") %>"
size="74"></td>
</tr>
<tr>
<td><label
title="label for Office text box">Office:</label></td>
</tr>
<tr>
<td><input
alt="Office"
type="text"
name="Office"
value="<%=
rsFac("fldOffice") %>"
size="74"></td>
</tr>
<tr>
<td><label
title="label for Phone text box">Phone:</label></td>
</tr>
<tr>
<td><input
alt="Phone"
type="text"
name="Phone"
value="<%=
rsFac("fldPhone") %>"
size="40"></td>
</tr>
<tr>
<td><label
title="label for Fax text box">Fax:</label></td>
</tr>
<tr>
<td><input
alt="Fax"
type="text"
name="Fax"
value="<%=
rsFac("fldFax") %>"
size="40"></td>
</tr>
<tr>
<td><label
title="label for E-mail text box">E-mail*:</label></td>
</tr>
<tr>
<td><input
alt="Email"
type="text"
name="Email"
value="<%=
rsFac("fldEmail") %>"
size="40"></td>
</tr>
<% rsFac.Close %>
<tr>
<td><br>
<input
type="submit"
alt="Update My General Information"
value="Update My General Information">
<input
type="reset"
alt="Reset to Original "
value="Reset to Original Information"
name="reset"></td>
</table>
</td>
</tr>
</table>
</form>
<!--webbot bot="Include"
u-include="includes/footer.asp" tag="BODY" -->
</td>
</tr>
</table>
</div>
</body>