Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion js/course_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion js/jslists201330.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
4 changes: 2 additions & 2 deletions js/tab_custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ window.tabCustomClasses = {
var getDefaultDescription = function(propertyName) {
var randVal = o_listsTab.populateValuePlaceholder($("<input value='"+propertyName+"'>"), $("<input value='contains'>"), "", 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];
}
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion js/use_course_list.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions resources/database_structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -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" => ""),
Expand Down
6 changes: 3 additions & 3 deletions resources/db_query.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion resources/debug.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

function print_debug_as_html_paragraph($s_value) {
echo "DEBUG: <p>${s_value}</p>";
echo "DEBUG: <p>{$s_value}</p>";
}

?>
2 changes: 1 addition & 1 deletion resources/globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions resources/load_semester_classes_from_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -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`";
}
Expand Down Expand Up @@ -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},",
Expand Down
5 changes: 3 additions & 2 deletions scraping/php_to_mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -287,4 +288,4 @@ function saveClasses($term) {
$term = loadTerm(getNextTerm());
}

?>
?>