<?
session_start();
if($userType != 'm')
	header("Location: logout.php");

/**********************************************************************************
*Name: addCourse.php
*Purpose: 1)adds a course to the list of courses
*Version information
*Date: December 2, 2001
*Copyright notice
***********************************************************************************/
require("DB.php");

$db = new DB("andromeda", "gradinfo");
$db->connect();

if( !empty($form[course]) && !empty($form[year])){
	
	//store both semester and year in one field.
	$tmp = $form[semester].$form[year];	

	$classToAdd = new Course(null,null,null,null,null);
	$classToAdd->grade = $form[grade];
	$classToAdd->semester = $tmp;
	$classToAdd->course = $form[course];
	$classToAdd->courseStatus = $form[courseStatus];
	$classToAdd->type=$form[type];

	$event_id=$st_id;

		$result = $db->addToClassList($st_id, $classToAdd);
	//	$st_id = $form[rNumber];
	//	session_register('st_id');
	//	session_register('st_course');
	//	session_register('st_semester');
			header("Location: addCourseForm.php?event_id=$st_id");

}
else{
	$eCourse = 1;
	session_register('eCourse');
	
		header("Location: addCourseForm.php?event_id=$st_id");
}
?>
