//include('/var/www/nonssl/washburn/www/closed/shared/getGlobals.php');
if (!ini_get("register_globals")){
foreach ($_REQUEST as $k=>$v){
if (!isset($GLOBALS[$k])){
${$k}=$v;
}
}
}
if (Trim($id) == "") {
$id = "login_screen";
}
function connect_to_db () {
// Connecting, selecting database
global $dbUser, $dbPass, $dbName;
include('/var/www/nonssl/washburn/www/closed/faculty/online-syllabi/db.inc.php');
$link = mysql_connect('psqldb.washburn.edu', "$dbUser", "$dbPass");
mysql_select_db($dbName);
// username password same as progserv ***
} // *** end of connect_to_db function ***
if ($id == "login_screen") {
if ($submit) {
if (!$instructor_id) {
$error="You did not enter a login name";
}
else {
$strng = strtolower($instructor_id);
connect_to_db();
$sql="SELECT * FROM Instructor_ID WHERE instructor_id='$strng' AND passwd='$passwd'";
$result = mysql_query($sql) or die("Query Failed");
$num = mysql_num_rows($result);
if ($num == 0) {
$error="Invalid login, $strng or password, $passwd. Please try again. If you have trouble logging in please contact Terri Slater at xt 2302 ";
}
else {
setcookie("washburn_login","",time() - 3600, "/");
setcookie("washburn_login",$strng,time() + 360000, "/");
?>
echo $strng ?> Main Menu
echo "
\n
\n";
echo "
\n
You are logged in as $strng. Please select one of the options listed.
\n
\n
\n
\n";
echo " Create/change instructor profile\n";
echo " Create syllabus for a new course \n";
if (!$washburn_login) {
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$strng\"";
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$strng\"";
}
else {
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\"";
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\"";
}
$result = mysql_query($sql) or die("Query Failed");
while ($row = mysql_fetch_array($result)) {
printf("\n Edit %s Sullabus\n", $row["course_code_gen"], $row["course_code_gen"]);
} // end of mysql_fetch array while loop
$result2 = mysql_query($sql2);
$first_time = 0;
while ($row2 = mysql_fetch_array($result2)) {
if ($first_time == 0) {
printf("\n
View online syllabi for %s
\n", $row2["instructor_id_spec"]);
$first_time = 1;
} // end of if first_time == 0 statement
printf("\n%s %s http://www.washburn.edu/faculty/online-syllabi/create_syllabi.php?instructor_id=%s&course_code=%s&ref_num=%s \n", $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"], $row2["course_code_spec"], $row2["course_section_spec"], $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"]);
} // end of while loop
} // end of if else statement
} // end of !$instructor_id else statment
} // end of $submit if statement
if (!$submit || $error) {
setcookie("washburn_login","",time() - 3600, "/");
?>
Online Syllabi - Enter Login and Password Form
if ($error) {
?>
echo $error; ?>
} //end of error if statement
?>
Online Syllabus Creation Tool
Enter your login and password.
Login
names can be no longer than 20 characters with no spaces.
Passwords can be no longer than 10 characters.
} // end of !submit or $error for login_screen
} //end of id == login_screen if statement
if ($id == "create_login") {
if ($submit) {
if (!$instructor_id) {
$error="You did not enter a login name.";
} // end of !instructor_id if portion
else {
//process form
$strng = strtolower($instructor_id);
connect_to_db ();
$sql="SELECT * FROM Instructor_ID WHERE instructor_id='$strng'";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if ($num == 0) {
// create user name and password
$sql2 = "INSERT INTO Instructor_ID (instructor_id, passwd) VALUES ('$strng', '$passwd')";
$result2 = mysql_query($sql2) or die("Insert Failed");
setcookie("washburn_login","",time()-3600,"/");
setcookie("washburn_login",$strng,time() + 36000,"/");
?>
echo $strng ?> Main Menu
echo "
Login, $strng, created.
";
echo "
\n
\n";
echo "
\n
You are logged in as $strng. Please select one of the options listed.
\n
\n
\n
\n";
echo " Create/change instructor profile\n";
echo " Create syllabus for a new course \n";
if (!$washburn_login) {
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$strng\"";
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$strng\"";
}
else {
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\"";
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\"";
}
$result = mysql_query($sql) or die("Query Failed");
while ($row = mysql_fetch_array($result)) {
printf("\n Edit %s syllabus\n", $row["course_code_gen"], $row["course_code_gen"]);
} // end of mysql_fetch array while loop
$result2 = mysql_query($sql2);
$first_time = 0;
while ($row2 = mysql_fetch_array($result2)) {
if ($first_time == 0) {
printf("\n
View online syllabi for %s
\n", $row2["instructor_id_spec"]);
$first_time = 1;
} // end of if first_time == 0 statement
printf("\n%s %s http://www.washburn.edu/faculty/online-syllabi/create_syllabi.php?instructor_id=%s&course_code=%s&ref_num=%s \n", $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"], $row2["course_code_spec"], $row2["course_section_spec"], $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"]);
} // end of while loop
} // end of num == 0 if statement
else {
$error="Login, $instructor_id, is already being used. Please choose another login name.";
$instructor_id="";
} // end of else statement for if num == 0
} // end of else portion of the !instructor_id
} // end of submit statement
?>
if (!$submit || $error) { ?>
Online Syllabi - Create Login and Password Form
Create A Login and Password
if ($error) { ?>
echo $error; ?>
} ?>
Enter a login and password.
Login
names can be no longer than 20 characters with no spaces.
Passwords can be no longer than 10 characters.
} //end of !submit or error if statement
} //end of id == create_login if statement
if ($id == "change_password") {
if ($submit) {
// process form
if (!$instructor_id)
$error="You did not enter your login.";
elseif (!$passwd)
$error="You did not enter your current password";
else {
connect_to_db ();
$sql="SELECT * FROM Instructor_ID WHERE instructor_id = \"$instructor_id\"";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$num = mysql_num_rows($result);
if ($num == 0)
$error="Incorrect login name. There is no login name, $instructor_id. If you feel this is in error, please contact Terri Slater or call extension 2302.";
elseif ($passwd != $row['passwd'])
$error="The password entered, $passwd, is not correct. Please try again.";
else {
?>
Online Syllabi - Change Password Form
Change the password
Enter a new password for = $instructor_id; ?>.
Passwords can be no longer than 10 characters.
} // end of else statement of password matches
} // end of else statement of data validation
} // end of if submit statement
if (!$submit or $error) {
?>
Online Syllabi - Change Password Form
if ($error) {
?>
echo $error; ?>
} //end of error if statement
?>
Change Current Password
Enter your current login and password.
Passwords can be no longer than 10 characters.
} // end of if !submit or error statement
} // end of if id == change_password statement
if ($id == "change_password2") {
if (!$passwd) {
$error="You did not enter a password.";
?>
Online Syllabi - Change Password Form
if ($error) {
?>
echo $error; ?>
} //end of error if statement
?>
Change the password
Enter a new password for = $instructor_id; ?>.
Passwords can be no longer than 10 characters.
} // end of if !passwd statement
else {
connect_to_db ();
$sql="UPDATE Instructor_ID SET passwd = \"$passwd\" WHERE instructor_id = \"$instructor_id\"";
$result = mysql_query($sql);
setcookie("washburn_login","",time() - 3600, "/");
setcookie("washburn_login",$instructor_id,time() + 36000, "/");
?>
echo $instructor_id; ?> Main Menu
echo "
Password Changed
";
echo "
\n
\n";
echo "
\n
You are logged in as $instructor_id. Please select one of the options listed.
\n
\n
\n
\n";
echo " Create/change instructor profile\n";
echo " Create syllabus for a new course \n";
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$instructor_id\"";
$result = mysql_query($sql) or die("Query Failed");
while ($row = mysql_fetch_array($result)) {
printf("\n Edit %s syllabus\n", $row["course_code_gen"], $row["course_code_gen"]);
} // end of mysql_fetch array while loop
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$instructor_id\"";
$result2 = mysql_query($sql2);
$first_time = 0;
while ($row2 = mysql_fetch_array($result2)) {
if ($first_time == 0) {
printf("\n
View online syllabi for %s
\n", $row2["instructor_id_spec"]);
$first_time = 1;
} // end of if first_time == 0 statement
printf("\n%s %s http://www.washburn.edu/faculty/online-syllabi/create_syllabi.php?instructor_id=%s&course_code=%s&ref_num=%s \n", $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"], $row2["course_code_spec"], $row2["course_section_spec"], $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"]);
} // end of while loop
} //end of else statement for if !password
} // end of if id == change_password2
if ($id == "add") {
if ($submit) {
// process form
if (!$course_name_gen)
$error="You did not enter the Course Name. This field is required.\n";
elseif (!$course_code_gen)
$error="You did not enter the Course Code. This field is required.\n";
else {
// take out blank space from the course_code and uppercase
$search = array ("'[\s]+'");
$replace = array("");
$a_code = preg_replace ($search, $replace, $course_code_gen);
$code = strtoupper($a_code);
connect_to_db ();
$sql="SELECT instructor_id_gen, course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\" AND course_code_gen = \"$code\"";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if ($num != 0) {
$sql = "DELETE FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\" AND course_code_gen = \"$code\"";
$result = mysql_query($sql);
} // end of num == 0 if statement
$sql = "INSERT INTO online_syllabus_gen (instructor_id_gen,
course_name_gen, course_code_gen, description_gen, prereqs_gen,
goals_gen, gen_ed_gen, policies_gen, policies_other_gen,
book1_title_gen, book1_author_gen, book1_publisher_gen,
book1_edition_year_gen, book1_isbn_gen, book1_other_gen,
book1_required_gen, book2_title_gen, book2_author_gen,
book2_publisher_gen, book2_edition_year_gen, book2_isbn_gen,
book2_other_gen, book2_required_gen, book3_title_gen,
book3_author_gen, book3_publisher_gen, book3_edition_year_gen,
book3_isbn_gen, book3_other_gen, book3_required_gen,
book4_title_gen, book4_author_gen, book4_publisher_gen,
book4_edition_year_gen, book4_isbn_gen, book4_other_gen,
book4_required_gen, book5_title_gen, book5_author_gen,
book5_publisher_gen, book5_edition_year_gen, book5_isbn_gen,
book5_other_gen, book5_required_gen, site_name1_gen, link1_gen,
site_name2_gen, link2_gen, site_name3_gen, link3_gen,
course_require_gen, require_other_gen) VALUES ('$washburn_login',
'$course_name_gen', '$code', '$description_gen', '$prereqs_gen',
'$goals_gen', '$gen_ed_gen', '$policies_gen',
'$policies_other_gen', '$book1_title_gen', '$book1_author_gen',
'$book1_publisher_gen', '$book1_edition_year_gen',
'$book1_isbn_gen', '$book1_other_gen', '$book1_required_gen',
'$book2_title_gen', '$book2_author_gen', '$book2_publisher_gen',
'$book2_edition_year_gen', '$book2_isbn_gen', '$book2_other_gen',
'$book2_required_gen', '$book3_title_gen', '$book3_author_gen',
'$book3_publisher_gen', '$book3_edition_year_gen',
'$book3_isbn_gen', '$book3_other_gen', '$book3_required_gen',
'$book4_title_gen', '$book4_author_gen', '$book4_publisher_gen',
'$book4_edition_year_gen', '$book4_isbn_gen', '$book4_other_gen',
'$book4_required_gen', '$book5_title_gen', '$book5_author_gen',
'$book5_publisher_gen', '$book5_edition_year_gen',
'$book5_isbn_gen', '$book5_other_gen', '$book5_required_gen',
'$site_name1_gen', '$link1_gen', '$site_name2_gen', '$link2_gen',
'$site_name3_gen', '$link3_gen', '$course_require_gen', '$require_other_gen')";
$result = mysql_query($sql) or die("Insert Failed");
?>
echo $code; ?> Course Information Added
Generic Information for echo $code; ?> has been added to echo $washburn_login; ?>'s courses.
// id == add handles adding new generic course info and editing existing
// generic course info. If next is adding goes to the add spec form.
// If it is editing then it displays the user's main menu.
if ($next == "adding") {
if ($num_sections != 0) {
?>
} // end of if num_sections != 0
else {
?>
Main Menu
echo "
\n
\n";
echo "
\n
You are logged in as $washburn_login. Please select one of the options listed.
\n
\n
\n
\n";
echo " Create/change instructor profile\n";
echo " Create syllabus for a new course \n";
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\"";
$result = mysql_query($sql) or die("Query Failed");
while ($row = mysql_fetch_array($result)) {
printf("\n Edit %s syllabus\n", $row["course_code_gen"], $row["course_code_gen"]);
} // end of mysql_fetch array while loop
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\"";
$result2 = mysql_query($sql2);
$first_time = 0;
while ($row2 = mysql_fetch_array($result2)) {
if ($first_time == 0) {
printf("\n
View online syllabi for %s
\n", $row2["instructor_id_spec"]);
$first_time = 1;
} // end of if first_time == 0 statement
printf("\n%s %s http://www.washburn.edu/faculty/online-syllabi/create_syllabi.php?instructor_id=%s&course_code=%s&ref_num=%s \n", $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"], $row2["course_code_spec"], $row2["course_section_spec"], $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"]);
} // end of while loop
} // end of else portion of if num_sections != 0
} // end of if next == adding statement
if ($next == "editing") {
?>
Main Menu
echo "
\n
\n";
echo "
\n
You are logged in as $washburn_login. Please select one of the options listed.
\n
\n
\n
\n";
echo " Create/change instructor profile\n";
echo " Create syllabus for a new course \n";
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\"";
$result = mysql_query($sql) or die("Query Failed");
while ($row = mysql_fetch_array($result)) {
printf("\n Edit %s syllabus\n", $row["course_code_gen"], $row["course_code_gen"]);
} // end of mysql_fetch array while loop
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\"";
$result2 = mysql_query($sql2);
$first_time = 0;
while ($row2 = mysql_fetch_array($result2)) {
if ($first_time == 0) {
printf("\n
View online syllabi for %s
\n", $row2["instructor_id_spec"]);
$first_time = 1;
} // end of if first_time == 0 statement
printf("\n%s %s http://www.washburn.edu/faculty/online-syllabi/create_syllabi.php?instructor_id=%s&course_code=%s&ref_num=%s \n", $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"], $row2["course_code_spec"], $row2["course_section_spec"], $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"]);
} // end of while loop
} // end of if next == editing statement
} // end of else statment of the data validation if statments
} // end of if submit statement
if (!$submit || $error) { ?>
Add New Course Information Form
if ($error)
echo "
} // end of !submit or error if statment
} // end of if id == add if statement
if ($id == "add_spec") {
if ($submit) {
$index=0;
$error_found=0;
while ($index < $num_sections) {
$temp=${"course_ref_num_spec$index"};
if (!$temp) {
$next=$index+1;
$error="You did not enter a Course Reference Number For Section $next. This field is required.\n";
$error_found=1;
break;
} // end of if statement
if (!ereg("^[0-9]{4}$", $temp)) {
$next=$index+1;
$error="The Course Reference Number entered must be numeric for Section $next. Please enter numerals only.\n";
$error_found=1;
break;
} // end of ereg if statement
$index++;
} // end of while loop
if ($error_found == 0) {
$index=0;
while ($index < $num_sections) {
// process form
// take out blank space from the course_code
$search = array ("'[\s]+'");
$replace = array("");
$code = preg_replace ($search, $replace, $course_code_gen);
// Make course_section_spec uppercase
$temp=${"course_section_spec$index"};
$section = strtoupper($temp);
connect_to_db ();
$temp_ref=${"course_ref_num_spec$index"};
$sql="SELECT instructor_id_spec, course_code_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\" AND course_code_spec = \"$code\" AND course_ref_num_spec = \"$temp_ref\"";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if ($num != 0) {
$sql = "DELETE FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\" AND course_code_spec = \"$code\" AND course_ref_num_spec = \"$temp_ref\"";
$result = mysql_query($sql);
} // end of if num != 0 statement
$temp_start_year=${"start_year$index"};
$temp_start_month=${"start_month$index"};
$temp_start_day=${"start_day$index"};
$temp_end_day=${"end_day$index"};
$temp_end_month=${"end_month$index"};
$temp_end_year=${"end_year$index"};
$temp_start_time=${"start_time_spec$index"};
$temp_start_am=${"start_am_pm_spec$index"};
$temp_end_time=${"end_time_spec$index"};
$temp_end_am=${"end_am_pm_spec$index"};
$temp_location=${"location_spec$index"};
$temp_meet_1=${"meet_day1$index"};
$temp_meet_2=${"meet_day2$index"};
$temp_meet_3=${"meet_day3$index"};
$temp_meet_4=${"meet_day4$index"};
$temp_meet_5=${"meet_day5$index"};
$temp_meet_6=${"meet_day6$index"};
$temp_meet_7=${"meet_day7$index"};
$temp_online=${"online_spec$index"};
$temp_schedule=${"schedule_spec$index"};
$temp_sem=${"semester_spec$index"};
$temp_sem_year=${"sem_year_spec$index"};
$sql = "INSERT INTO online_syllabi_spec (instructor_id_spec, course_ref_num_spec, course_code_spec, course_section_spec, semester_spec, sem_year_spec, start_date_spec, end_date_spec, start_time_spec, start_am_pm_spec, end_time_spec, end_am_pm_spec, location_spec, meet_days_spec, online_spec, schedule_spec) VALUES ('$washburn_login', '$temp_ref', '$code', '$section', '$temp_sem', '$temp_sem_year', '$temp_start_year-$temp_start_month-$temp_start_day', '$temp_end_year-$temp_end_month-$temp_end_day', '$temp_start_time', '$temp_start_am', '$temp_end_time', '$temp_end_am', '$temp_location', '$temp_meet_1$temp_meet_2$temp_meet_3$temp_meet_4$temp_meet_5$temp_meet_6$temp_meet_7', '$temp_online', '$temp_schedule')";
$result = mysql_query($sql); // or die("Insert Failed");
if ($index+1 == $num_sections || $num_sections == 1) {
?>
echo $washburn_login; ?> Main Menu
echo "
\n
\n";
echo "
\n
You are logged in as $washburn_login. Please select one of the options listed.
\n
\n
\n
\n";
echo " Create/change instructor profile\n";
echo " Create syllabus for a new course \n";
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\"";
$result = mysql_query($sql) or die("Query Failed");
while ($row = mysql_fetch_array($result)) {
printf("\n Edit %s syllabus\n", $row["course_code_gen"], $row["course_code_gen"]);
} // end of mysql_fetch array while loop
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\"";
$result2 = mysql_query($sql2);
$first_time = 0;
while ($row2 = mysql_fetch_array($result2)) {
if ($first_time == 0) {
printf("\n
View online syllabi for %s
\n", $row2["instructor_id_spec"]);
$first_time = 1;
} // end of if first_time == 0 statement
printf("\n%s %s http://www.washburn.edu/faculty/online-syllabi/create_syllabi.php?instructor_id=%s&course_code=%s&ref_num=%s \n", $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"], $row2["course_code_spec"], $row2["course_section_spec"], $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"]);
} // end of while loop
} // end of if index == num_sections if statement
$index++;
} // end of while index loop
} // end of if error_found == 0 statement
} // end of if submit statment
if (!$submit || $error) {
?>
echo $course_code_gen; ?> Specific Course Information
if ($error)
echo "
$error
\n";
?>
} // end of !submit or error if statement
} // end of id == add_spec if statment
if ($id == "inst_info") {
if ($submit) {
if (!$instructor_name)
$error="You didn't enter an Instructor Name for $washburn_login. This field is required.";
elseif (!$office_location)
$error="You didn't enter an Instructor Location for $washburn_login. This field is required.";
elseif (!$office_hours)
$error="You didn't enter the office hours for $washburn_login. This field is required.";
elseif (!$instructor_phone)
$error="You didn't enter an Instructor Phone Number for $washburn_login. This field is required.";
else {
// process form
connect_to_db ();
// verify instructor info not in table and delete if it is
$sql="SELECT instructor_id FROM Instructor_Info WHERE instructor_id = \"$washburn_login\"";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if ($num != 0) {
$sql="DELETE FROM Instructor_Info WHERE instructor_id = \"$washburn_login\"";
$result = mysql_query($sql);
} // end of if num != 0 if statement
// add instructor info to database
$sql = "INSERT INTO Instructor_Info (instructor_id, instructor_name, instructor_email, office_location, office_hours, instructor_phone, instructor_bio, teach_assist1, teach_assist2, teach_assist3, home_url) VALUES ('$washburn_login', '$instructor_name', '$instructor_email', '$office_location', '$office_hours', '$instructor_phone', '$instructor_bio', '$teach_assist1', '$teach_assist2', '$teach_assist3', '$home_url')";
$result = mysql_query($sql);
?>
echo $strng ?> Main Menu
echo "
\n
\n";
echo "
\n
You are logged in as $washburn_login. Please select one of the options listed.
\n
\n
\n
\n";
echo " Create/change instructor profile\n";
echo " Create syllabus for a new course \n";
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\"";
$result = mysql_query($sql) or die("Query Failed");
while ($row = mysql_fetch_array($result)) {
printf("\n Edit %s syllabus\n", $row["course_code_gen"], $row["course_code_gen"]);
} // end of mysql_fetch array while loop
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\"";
$result2 = mysql_query($sql2);
$first_time = 0;
while ($row2 = mysql_fetch_array($result2)) {
if ($first_time == 0) {
printf("\n
View online syllabi for %s
\n", $row2["instructor_id_spec"]);
$first_time = 1;
} // end of if first_time == 0 statement
printf("\n%s %s http://www.washburn.edu/faculty/online-syllabi/create_syllabi.php?instructor_id=%s&course_code=%s&ref_num=%s \n", $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"], $row2["course_code_spec"], $row2["course_section_spec"], $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"]);
} // end of while loop
} // end of else portion of data validation if statement
} // end of if submit statement
if (!$submit || $error) {
// If instructor info in database already, populate the form
connect_to_db ();
$sql = "SELECT * FROM Instructor_Info WHERE instructor_id = \"$washburn_login\"";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if ($num != 0) {
while ($row = mysql_fetch_array($result)) {
$instructor_name=$row["instructor_name"];
$instructor_email=$row["instructor_email"];
$office_location=$row["office_location"];
$office_hours=$row["office_hours"];
$instructor_phone=$row["instructor_phone"];
$instructor_bio=$row["instructor_bio"];
$teach_assist1=$row["teach_assist1"];
$teach_assist2=$row["teach_assist2"];
$teach_assist3=$row["teach_assist3"];
$home_url=$row["home_url"];
} // end of while loop
} // end if num != 0 statement
?>
Instructor Information Form
if ($error) { ?>
echo $error; ?>
} ?>
Return to Main Menu
} // end of !submit or error if statment
} // end of if id == inst_info if statement
if ($id == "edit") {
// lists options to add course, instructor info, edit course info
?>
Main Menu
echo "
\n
\n";
echo "
\n
You are logged in as $washburn_login. Please select one of the options listed.
Return to $washburn_login Main Menu\n";
} // end of id == edit if statement
if ($id == "edit_gen") {
connect_to_db ();
$sql = "SELECT * FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\" AND course_code_gen = \"$course_code_gen\"";
$result = mysql_query($sql) or die("Query Failed");
while ($row = mysql_fetch_array($result)) {
$course_name_gen=$row["course_name_gen"];
$course_code_gen=$row["course_code_gen"];
$description_gen=$row["description_gen"];
$prereqs_gen=$row["prereqs_gen"];
$goals_gen=$row["goals_gen"];
$gen_ed_gen=$row["gen_ed_gen"];
$policies_gen=$row["policies_gen"];
$policies_other_gen=$row["policies_other_gen"];
$book1_title_gen=$row["book1_title_gen"];
$book1_author_gen=$row["book1_author_gen"];
$book1_publisher_gen=$row["book1_publisher_gen"];
$book1_edition_year_gen=$row["book1_edition_year_gen"];
$book1_isbn_gen=$row["book1_isbn_gen"];
$book1_other_gen=$row["book1_other_gen"];
$book1_required_gen=$row["book1_required_gen"];
$book2_title_gen=$row["book2_title_gen"];
$book2_author_gen=$row["book2_author_gen"];
$book2_publisher_gen=$row["book2_publisher_gen"];
$book2_edition_year_gen=$row["book2_edition_year_gen"];
$book2_isbn_gen=$row["book2_isbn_gen"];
$book2_required_gen=$row["book2_required_gen"];
$book2_other_gen=$row["book2_other_gen"];
$book3_title_gen=$row["book3_title_gen"];
$book3_author_gen=$row["book3_author_gen"];
$book3_publisher_gen=$row["book3_publisher_gen"];
$book3_edition_year_gen=$row["book3_edition_year_gen"];
$book3_isbn_gen=$row["book3_isbn_gen"];
$book3_other_gen=$row["book3_other_gen"];
$book3_required_gen=$row["book3_required_gen"];
$book4_title_gen=$row["book4_title_gen"];
$book4_author_gen=$row["book4_author_gen"];
$book4_publisher_gen=$row["book4_publisher_gen"];
$book4_edition_year_gen=$row["book4_edition_year_gen"];
$book4_isbn_gen=$row["book4_isbn_gen"];
$book4_other_gen=$row["book4_other_gen"];
$book4_required_gen=$row["book4_required_gen"];
$book5_title_gen=$row["book5_title_gen"];
$book5_author_gen=$row["book5_author_gen"];
$book5_publisher_gen=$row["book5_publisher_gen"];
$book5_edition_year_gen=$row["book5_edition_year_gen"];
$book5_isbn_gen=$row["book5_isbn_gen"];
$book5_other_gen=$row["book5_other_gen"];
$book5_required_gen=$row["book5_required_gen"];
$site_name1_gen=$row["site_name1_gen"];
$site_name2_gen=$row["site_name2_gen"];
$site_name3_gen=$row["site_name3_gen"];
$link1_gen=$row["link1_gen"];
$link2_gen=$row["link2_gen"];
$link3_gen=$row["link3_gen"];
$course_require_gen=$row["course_require_gen"];
$require_other_gen=$row["require_other_gen"];
} // end of while loop
?>
Add New Course Information FormReturn to Main Menu
} // end of edit_gen if statement
if ($id == "edit_spec") {
connect_to_db ();
$sql = "SELECT * FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\" AND course_code_spec = \"$course_code_spec\" AND course_ref_num_spec = \"$course_ref_num_spec\"";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
$course_ref_num_spec=$row["course_ref_num_spec"];
$course_code_spec=$row["course_code_spec"];
$course_section_spec=$row["course_section_spec"];
$start_date_spec=$row["start_date_spec"];
$end_date_spec=$row["end_date_spec"];
$start_time_spec=$row["start_time_spec"];
$start_am_pm_spec=$row["start_am_pm_spec"];
$end_time_spec=$row["end_time_spec"];
$end_am_pm_spec=$row["end_am_pm_spec"];
$location_spec=$row["location_spec"];
$meet_days_spec=$row["meet_days_spec"];
$online_spec=$row["online_spec"];
$schedule_spec=$row["schedule_spec"];
$semester_spec=$row["semester_spec"];
$sem_year_spec=$row["sem_year_spec"];
list($start_year, $start_month, $start_day) = split ("-",$start_date_spec);
list($end_year, $end_month, $end_day) = split ("-",$end_date_spec);
} // end of while loop
?>
Add New Course Section Form
} // end of id == edit_spec if statement
if ($id == "add_spec2") {
if ($submit) {
if (!$course_ref_num_spec)
$error="You did not enter a Course Reference Number. This field is required.\n";
elseif (!ereg("^[0-9]{4}$", $course_ref_num_spec))
$error="The Course Reference Number is not numeric. This field must be all numerals.\n";
else {
// process form
// take out blank space from the course_code
$search = array ("'[\s]+'");
$replace = array("");
$code = preg_replace ($search, $replace, $course_code_spec);
// Make course_section_spec uppercase
$section = strtoupper($course_section_spec);
connect_to_db ();
$sql="SELECT instructor_id_spec, course_code_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\" AND course_code_spec = \"$code\" AND course_ref_num_spec = \"$ref_num\"";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if ($num != 0) {
$sql = "DELETE FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\" AND course_code_spec = \"$code\" AND course_ref_num_spec = \"$ref_num\"";
$result = mysql_query($sql);
} // end of if num != 0 statement
$sql = "INSERT INTO online_syllabi_spec (instructor_id_spec, course_ref_num_spec, course_code_spec, course_section_spec, semester_spec, sem_year_spec, start_date_spec, end_date_spec, start_time_spec, start_am_pm_spec, end_time_spec, end_am_pm_spec, location_spec, meet_days_spec, online_spec, schedule_spec) VALUES ('$washburn_login', '$course_ref_num_spec', '$code', '$section', '$semester_spec', '$sem_year_spec', '$start_year-$start_month-$start_day', '$end_year-$end_month-$end_day', '$start_time_spec', '$start_am_pm_spec', '$end_time_spec', '$end_am_pm_spec', '$location_spec', '$meet_day1$meet_day2$meet_day3$meet_day4$meet_day5$meet_day6$meet_day7', '$online_spec', '$schedule_spec')";
$result = mysql_query($sql); // or die("Insert Failed");
?>
echo $washburn_login; ?> Main Menu
echo "
\n
\n";
echo "
\n
You are logged in as $washburn_login. Please select one of the options listed.
\n
\n
\n
\n";
echo " Create/change instructor profile\n";
echo " Create syllabus for a new course \n";
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\"";
$result = mysql_query($sql) or die("Query Failed");
while ($row = mysql_fetch_array($result)) {
printf("\n Edit %s syllabus\n", $row["course_code_gen"], $row["course_code_gen"]);
} // end of mysql_fetch array while loop
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\"";
$result2 = mysql_query($sql2);
$first_time = 0;
while ($row2 = mysql_fetch_array($result2)) {
if ($first_time == 0) {
printf("\n
View online syllabi for %s
\n", $row2["instructor_id_spec"]);
$first_time = 1;
} // end of if first_time == 0 statement
printf("\n%s %s http://www.washburn.edu/faculty/online-syllabi/create_syllabi.php?instructor_id=%s&course_code=%s&ref_num=%s \n", $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"], $row2["course_code_spec"], $row2["course_section_spec"], $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"]);
} // end of while loop
} // end of else statement from data validation if statement
} // end of if submit statment
if (!$submit || $error) {
?>
echo $course_code_spec; ?> Specific Course Information
if ($error)
echo "
$error
\n";
?>
Return to Main Menu
} // end of !submit or error if statement
} // end of id == add_spec2 if statment
if ($id == "delete_list") {
// brings up checkboxes of sections for users to check to delete one or
// all sections from database.
connect_to_db ();
$sql = "SELECT * FROM online_syllabi_spec WHERE instructor_id_spec =\"$washburn_login\" AND course_code_spec = \"$course_code_spec\"";
$result = mysql_query($sql);
?>
echo $washburn_login; ?> Section Delete
echo "\n";
echo " Return to Main Menu";
} // end of id == delete_list if statement
if($id == "delete") {
// deletes the sections out of the database
connect_to_db ();
$index = 0;
while ($index < $num_sections) {
$temp_ref = ${"which_ref$index"};
$sql = "DELETE FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\" AND course_code_spec = \"$course_code_spec\" AND course_ref_num_spec =\"$temp_ref\"";
$result = mysql_query($sql);
$index++;
} // end of while loop
?>
Main Menu
echo "
\n
\n";
echo "
\n
$washburn_login, Section(s) Deleted. Please select one of the options listed.
\n
\n
\n
\n";
echo " Create/change instructor profile\n";
echo " Create syllabus for a new course \n";
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\"";
$result = mysql_query($sql) or die("Query Failed");
while ($row = mysql_fetch_array($result)) {
printf("\n Edit %s syllabus\n", $row["course_code_gen"], $row["course_code_gen"]);
} // end of mysql_fetch array while loop
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\"";
$result2 = mysql_query($sql2);
$first_time = 0;
while ($row2 = mysql_fetch_array($result2)) {
if ($first_time == 0) {
printf("\n
View online syllabi for %s
\n", $row2["instructor_id_spec"]);
$first_time = 1;
} // end of if first_time == 0 statement
printf("\n%s %s http://www.washburn.edu/faculty/online-syllabi/create_syllabi.php?instructor_id=%s&course_code=%s&ref_num=%s \n", $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"], $row2["course_code_spec"], $row2["course_section_spec"], $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"]);
} // end of while loop
} // end of id == delete if statement
if($id == "menu_list") {
connect_to_db ();
?>
echo $washburn_login; ?> Main Menu
echo "
\n
\n";
echo "
\n
You are logged in as $washburn_login. Please select one of the options listed.
\n
\n
\n
\n";
echo " Create/change instructor profile\n";
echo " Create syllabus for a new course \n";
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\"";
$result = mysql_query($sql) or die("Query Failed");
while ($row = mysql_fetch_array($result)) {
printf("\n Edit %s syllabus\n", $row["course_code_gen"], $row["course_code_gen"]);
} // end of mysql_fetch array while loop
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\"";
$result2 = mysql_query($sql2);
$first_time = 0;
while ($row2 = mysql_fetch_array($result2)) {
if ($first_time == 0) {
printf("\n
View online syllabi for %s
\n", $row2["instructor_id_spec"]);
$first_time = 1;
} // end of if first_time == 0 statement
printf("\n%s %s http://www.washburn.edu/faculty/online-syllabi/create_syllabi.php?instructor_id=%s&course_code=%s&ref_num=%s \n", $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"], $row2["course_code_spec"], $row2["course_section_spec"], $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"]);
} // end of while loop
} // end of if id == menu_list
if ($id == "delete_course") {
// this deletes the entire course information both generic and specific
connect_to_db();
$sql = "DELETE FROM online_syllabus_gen WHERE instructor_id_gen = \"$instructor_id\" AND course_code_gen = \"$course_code_gen\"";
$sql2 = "DELETE FROM online_syllabi_spec WHERE instructor_id_spec = \"$instructor_id\" AND course_code_spec = \"$course_code_gen\"";
$result = mysql_query($sql);
$result2 = mysql_query($sql2);
connect_to_db ();
// put up main menu after deleting course
?>
echo $washburn_login; ?> Main Menu
echo "
$course_code_gen has been deleted for $instructor_id
";
echo "
\n
\n";
echo "
\n
You are logged in as $washburn_login. Please select one of the options listed.
\n
\n
\n
\n";
echo " Create/change instructor profile\n";
echo " Create syllabus for a new course \n";
$sql = "SELECT course_code_gen FROM online_syllabus_gen WHERE instructor_id_gen = \"$washburn_login\"";
$result = mysql_query($sql) or die("Query Failed");
while ($row = mysql_fetch_array($result)) {
printf("\n Edit %s syllabus\n", $row["course_code_gen"], $row["course_code_gen"]);
} // end of mysql_fetch array while loop
$sql2 = "SELECT course_code_spec, course_ref_num_spec, instructor_id_spec, course_section_spec FROM online_syllabi_spec WHERE instructor_id_spec = \"$washburn_login\"";
$result2 = mysql_query($sql2);
$first_time = 0;
while ($row2 = mysql_fetch_array($result2)) {
if ($first_time == 0) {
printf("\n
View online syllabi for %s
\n", $row2["instructor_id_spec"]);
$first_time = 1;
} // end of if first_time == 0 statement
printf("\n%s %s http://www.washburn.edu/faculty/online-syllabi/create_syllabi.php?instructor_id=%s&course_code=%s&ref_num=%s \n", $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"], $row2["course_code_spec"], $row2["course_section_spec"], $row2["instructor_id_spec"], $row2["course_code_spec"], $row2["course_ref_num_spec"]);
} // end of while loop
} // end of id == delete_course if statement
?>