$rst = mysql_query($sql, $srvDB_Connection) or die("<p>Update, selecting member Query failed with error message: \"" . mysql_error() . '"');
    list($pkMemberId, $fldFname, $fldMname, $fldLname, $fldEmail, $fldUVMId, $fldhomepage, $fldFaculty, $fldStaff, $fldAdjunct, $fldDepartment1, $fldPostion1, $fldOverview, $fldOtherMethod, $fldOtherApplication, $fldConfirmed, $fldApproved, $fldActive, $fldDateEntered) = mysql_fetch_row($rst);
    if ($fldActive == "Y") {
        $message1 = "Update";
    } else {
        $message1 = "Add";
        //they are in our system from a project or course
    }
    $sql = "select fldPhoto from tblMemberPhoto where fkMemberId={$pkMemberId}";
    $rst = mysql_query($sql, $srvDB_Connection);
    list($fldPhoto) = mysql_fetch_row($rst);
    for ($i = 1; $i <= 11; $i++) {
        $MethodsChecked[$i] = checkForRecord(0, $pkMemberId, $i);
    }
    for ($i = 1; $i <= 8; $i++) {
        $DomainsChecked[$i] = checkForRecord(2, $pkMemberId, $i);
    }
} else {
    //use ldap to get their info and set default values
    $message1 = "Add";
    $pkMemberId = 0;
    //pull record from uvm
    $ds = ldap_connect("ldap.uvm.edu");
    if ($ds) {
        $r = ldap_bind($ds);
        $dn = "uid={$UVMNetID},ou=People,dc=uvm,dc=edu";
        $filter = "(|(netid={$UVMNetID}))";
        $justthese = array("ou", "sn", "givenname", "mail", "title", "c");
        $sr = ldap_search($ds, $dn, $filter, $justthese);
        $info = ldap_get_entries($ds, $sr);
        if (ldap_count_entries($ds, $sr) > 0) {
	<p></p>
<? // get values
	$sql = "SELECT pkCourseID, fldCXSCourse, fldTitle, fldDept, fldCourseNumber, fldCredits, fldSemester, fldFrequency, fldPreReq, fldDescription, fldCourseDoc, fldOtherMethod, fldOtherApplication, fldApproved, fldDateEntered, fldDateUpdated ";
	$sql .= "FROM tblCXSCourse ";
	$sql .= "WHERE pkCourseID=" . $HTTP_GET_VARS['id'];

  $rst = mysql_query($sql,$srvDB_Connection) or die ("<p>Update, selecting Course Query failed with error message: \"" . mysql_error () . '"');
     
  list($pkCourseID, $fldCXSCourse, $fldTitle, $fldDept, $fldCourseNumber,  $fldCredits, $fldSemester, $fldFrequency, $fldPreReq, $fldDescription, $fldCourseDoc, $fldOtherMethod, $fldOtherApplication, $fldApproved, $fldDateEntered, $fldDateUpdated)=mysql_fetch_row($rst);

	for($i=1;$i<=11;$i++){
		$MethodsChecked[$i]=checkForRecord(7,$pkCourseID, $i);
	}
		
	for($i=1;$i<=8;$i++){
		$DomainsChecked[$i]=checkForRecord(8,$pkCourseID, $i);
	}
} else {
?>
	<h3>Add a Course</h3>
<p>Please fill out a copy of this form for <strong>EACH</strong>   course related to Complex Systems you have taught within the last two years  or plan to teach in the coming year.</p>

<? 
	$pkCourseID=0;
	$fldCXSCourse=""; 
	$fldTitle="";
	$fldDept="";
	$fldCourseNumber=""; 
	$fldCredits="";
	$fldSemester="";
	$fldFrequency="";