diff --git a/js/course_list.js b/js/course_list.js index dab4e65..8504ff0 100644 --- a/js/course_list.js +++ b/js/course_list.js @@ -14,7 +14,7 @@ typeCoursesList = function() { var conflicting_objects = []; var default_semester = ''; conflicting_object = null; - + this.setSemester = function(sem) { semester = sem; if (typeof(full_course_list[semester]) == 'undefined') @@ -555,6 +555,9 @@ typeCoursesList = function() { course[11] = a_courses[i]['Seats']; course[12] = a_courses[i]['Limit']; course[13] = a_courses[i]['Enroll']; + + course[14] = a_courses[i]['Course Fees']; // Added for a course Fees column + course['accesses'] = a_courses[i]['accesses']; full_course_list[sem][s_subject].push(course); } diff --git a/js/jslists201330.js b/js/jslists201330.js index 92b1241..8a9f218 100644 --- a/js/jslists201330.js +++ b/js/jslists201330.js @@ -67,7 +67,7 @@ var subjects_201330 = [ ['THEA', 'Theater'], ['WGS', 'Women\'s and Gender Studies'] ]; -var headers_201330 = ['Conflicts', 'Select', 'CRN', 'Course', '*Campus', 'Days', 'Time', 'Location', 'Hrs', 'Title', 'Instructor', 'Seats', 'Limit', 'Enroll']; +var headers_201330 = ['Conflicts', 'Select', 'CRN', 'Course', '*Campus', 'Days', 'Time', 'Location', 'Hrs', 'Title', 'Instructor', 'Seats', 'Limit', 'Enroll', 'Course Fees']; var full_course_list_201330 = [ [ ['63042', 'ACCT 202D-01', 'M', 'M W F', '0900-1030', 'CRAMER 123', '3', 'Fundamentals of Accounting II', 'Robert T. Guthrie', '21', '25', '4'], diff --git a/js/tab_custom.js b/js/tab_custom.js index b20d4a5..9aa6a33 100644 --- a/js/tab_custom.js +++ b/js/tab_custom.js @@ -10,7 +10,7 @@ window.tabCustomClasses = { var getDefaultDescription = function(propertyName) { var randVal = o_listsTab.populateValuePlaceholder($(""), $(""), "", true, []); var retval = randVal; - var defaults = { '*Campus':'M', Days:'W', Time:'1600-1800', Location:'Field', Hrs:'0', Title:'Soccer Practice', Instructor:'Soccer Coach', Seats:'20', Limit:'20', Enroll:'20' } + var defaults = { '*Campus':'M', Days:'W', Time:'1600-1800', Location:'Field', Hrs:'0', Title:'Soccer Practice', Instructor:'Soccer Coach', Seats:'20', Limit:'20', Enroll:'20', 'Course Fees':'25' } if (defaults[propertyName]) { retval = defaults[propertyName]; } @@ -24,7 +24,7 @@ window.tabCustomClasses = { // get the properties to draw customHeaders = $.grep(customHeaders, function(v,k) { - var dontAdd = ["Select", "Conflicts", "Course", "Seats", "Enroll"]; + var dontAdd = ["Select", "Conflicts", "Course", "Seats", "Enroll", "Course Fees"]; if (dontAdd.indexOf(v) == -1) { return true; } else { diff --git a/js/use_course_list.js b/js/use_course_list.js index 84db697..3ab03d4 100644 --- a/js/use_course_list.js +++ b/js/use_course_list.js @@ -1,4 +1,4 @@ -headers = ['Conflicts', 'Select', 'CRN', 'Course', '*Campus', 'Days', 'Time', 'Location', 'Hrs', 'Title', 'Instructor', 'Seats', 'Limit', 'Enroll']; +headers = ['Conflicts', 'Select', 'CRN', 'Course', '*Campus', 'Days', 'Time', 'Location', 'Hrs', 'Title', 'Instructor', 'Seats', 'Limit', 'Enroll', 'Course Fees']; classes_table_classes = ['auto_table_classes', 'auto_header_classes', 'auto_row_classes']; o_courses = null; diff --git a/resources/database_structure.php b/resources/database_structure.php index 5000f81..63dd15d 100644 --- a/resources/database_structure.php +++ b/resources/database_structure.php @@ -49,6 +49,7 @@ "seats" => array("type" => "INT", "indexed" => FALSE, "isPrimaryKey" => FALSE, "special" => ""), "limit" => array("type" => "INT", "indexed" => FALSE, "isPrimaryKey" => FALSE, "special" => ""), "enroll" => array("type" => "INT", "indexed" => FALSE, "isPrimaryKey" => FALSE, "special" => ""), + "course_fees" => array("type" => "INT", "indexed" => FALSE, "isPrimaryKey" => FALSE, "special" => ""), "parent_class" => array("type" => "VARCHAR(255)", "indexed" => FALSE, "isPrimaryKey" => FALSE, "special" => ""), "subclass_identifier" => array("type" => "VARCHAR(255)", "indexed" => FALSE, "isPrimaryKey" => FALSE, "special" => ""), "user_ids_with_access" => array("type" => "VARCHAR(255)", "indexed" => FALSE, "isPrimaryKey" => FALSE, "special" => ""), diff --git a/resources/db_query.php b/resources/db_query.php index 1f0d528..d982d01 100644 --- a/resources/db_query.php +++ b/resources/db_query.php @@ -64,13 +64,13 @@ function open_db() { if (file_exists($filename)) { $a_configs = parse_ini_file($filename); } else { - print_debug_as_html_paragraph("Could not find file ${filename}"); + print_debug_as_html_paragraph("Could not find file {$filename}"); return FALSE; } if (!isset($a_configs["host"]) || !isset($a_configs["user"]) || !isset($a_configs["password"])) { - print_debug_as_html_paragraph("Undefined host, user, and password in ${filename}"); + print_debug_as_html_paragraph("Undefined host, user, and password in {$filename}"); return FALSE; } @@ -82,7 +82,7 @@ function open_db() { try { $mysqli = mysqli_connect($a_configs["host"], $a_configs["user"], $a_configs["password"]); } catch (Exception $e) { - print_debug_as_html_paragraph("Unable to connect to MySQL. ${e}"); + print_debug_as_html_paragraph("Unable to connect to MySQL. {$e}"); return FALSE; } if ($mysqli->connect_errno) { diff --git a/resources/debug.php b/resources/debug.php index 8214a5b..14c6833 100644 --- a/resources/debug.php +++ b/resources/debug.php @@ -1,7 +1,7 @@ ${s_value}

"; + echo "DEBUG:

{$s_value}

"; } ?> diff --git a/resources/globals.php b/resources/globals.php index 5a37c4e..c930a50 100644 --- a/resources/globals.php +++ b/resources/globals.php @@ -31,7 +31,7 @@ function define_global_vars() { if (file_exists($filename)) { $a_configs = parse_ini_file($filename); } else { - print_debug_as_html_paragraph("Could not find ${filename}"); + print_debug_as_html_paragraph("Could not find {$filename}"); } if ($a_configs === FALSE) { diff --git a/resources/load_semester_classes_from_database.php b/resources/load_semester_classes_from_database.php index 2b81284..ba25165 100644 --- a/resources/load_semester_classes_from_database.php +++ b/resources/load_semester_classes_from_database.php @@ -40,7 +40,7 @@ function load_semester_classes_from_database($s_year, $s_semester, $s_output_typ // build the query to load the classes $access_to_custom_class = "`subject`!='CUSTOM' OR `user_ids_with_access` LIKE '%|{$id},%'"; - $s_select_clause = "`subject`,`enroll` AS `Enroll`,`title` AS `Title`,`days` AS `Days`,`hours` AS `Hrs`,`limit` AS `Limit`,`location` AS `Location`,`time` AS `Time`,`parent_class`,`crn` AS `CRN`,`course` AS `Course`,`campus` AS `*Campus`,`seats` AS `Seats`,`instructor` AS `Instructor`,`user_ids_with_access` AS `accesses`"; + $s_select_clause = "`subject`,`enroll` AS `Enroll`,`title` AS `Title`,`days` AS `Days`,`hours` AS `Hrs`,`limit` AS `Limit`,`location` AS `Location`,`time` AS `Time`,`parent_class`,`crn` AS `CRN`,`course` AS `Course`,`campus` AS `*Campus`,`seats` AS `Seats`,`instructor` AS `Instructor`,`user_ids_with_access` AS `accesses`, 'course_fees' AS 'Course Fees'"; if ($b_just_count) { $s_select_clause = "COUNT(*) AS `count`"; } @@ -175,7 +175,8 @@ function save_custom_class_to_db($a_values, $i_user_id, $sem, $year) { "instructor"=>$a_values["Instructor"], "seats"=>0, "limit"=>$a_values["Limit"], - "enroll"=>0, + "enroll"=>0, + "course_fees"=>0, "parent_class"=>"", "subclass_identifier"=>"", "user_ids_with_access"=>"rwx|{$i_user_id},", diff --git a/scraping/php_to_mysql.php b/scraping/php_to_mysql.php index 54deddc..04d7d1e 100644 --- a/scraping/php_to_mysql.php +++ b/scraping/php_to_mysql.php @@ -202,7 +202,7 @@ function saveClasses($term) { $classes_to_save = array(); $subclasses_to_save = array(); foreach($term["classes"] as $a_class) { - fillClass($a_class, array("CRN"=>0, "subject"=>"", "Course"=>"", "*Campus"=>"", "Days"=>"", "Time"=>"", "Location"=>"", "Hrs"=>0, "Title"=>"", "Instructor"=>"", "Seats"=>0, "Limit"=>0, "Enroll"=>0)); + fillClass($a_class, array("CRN"=>0, "subject"=>"", "Course"=>"", "*Campus"=>"", "Days"=>"", "Time"=>"", "Location"=>"", "Hrs"=>0, "Title"=>"", "Instructor"=>"", "Seats"=>0, "Limit"=>0, "Enroll"=>0, "Course Fees"=>0)); $a_days = str_split(str_replace(" ", "", $a_class["Days"])); $a_days_times_locations = array(); foreach($a_days as $s_day) { @@ -237,6 +237,7 @@ function saveClasses($term) { "seats"=>$a_class["Seats"], "limit"=>$a_class["Limit"], "enroll"=>$a_class["Enroll"], + "Course Fees"=>$a_class["Course Fees"], "parent_class"=>$parent_class, "subclass_identifier"=>$subclass_id, "last_mod_time"=>$modtime); @@ -287,4 +288,4 @@ function saveClasses($term) { $term = loadTerm(getNextTerm()); } -?> \ No newline at end of file +?>