|
17 | 17 | require_once("../inc/config.php"); |
18 | 18 | require_once("../inc/databaseConn.php"); |
19 | 19 | require_once("../inc/timeFunctions.php"); |
20 | | -require_once("../inc/httphelper.php"); |
21 | 20 |
|
22 | 21 | $dbConn = mysqli_connect($DATABASE_SERVER, $DATABASE_USER, $DATABASE_PASS, $DATABASE_DB); |
23 | 22 |
|
@@ -163,7 +162,7 @@ function getTempSections($courseNum, $offerNum, $term, $sessionNum) { |
163 | 162 | // Query for the sections of the course |
164 | 163 | $query = "SELECT class_section,descr,topic,enrl_stat,class_stat,class_type,enrl_cap,enrl_tot,instruction_mode,schedule_print "; |
165 | 164 | $query .= "FROM classes WHERE crse_id={$courseNum} AND crse_offer_nbr={$offerNum} AND strm={$term} "; |
166 | | - $query .= "AND session_code={$sessionNum}"; |
| 165 | + $query .= "AND session_code='{$sessionNum}'"; |
167 | 166 | $results = mysqli_query($dbConn, $query); |
168 | 167 |
|
169 | 168 | // Check for errors |
@@ -299,7 +298,7 @@ function fileToTempTable($tableName, $file, $fields, $fileSize, $procFunc=NULL) |
299 | 298 | `crse_id` int(6) UNSIGNED NOT NULL, |
300 | 299 | `crse_offer_nbr` int(2) UNSIGNED NOT NULL, |
301 | 300 | `strm` int(4) UNSIGNED NOT NULL, |
302 | | - `session_code` int(1) UNSIGNED NOT NULL, |
| 301 | + `session_code` varchar(4) NOT NULL, |
303 | 302 | `class_section` varchar(4) NOT NULL, |
304 | 303 | `subject` int(4) UNSIGNED ZEROFILL NOT NULL, |
305 | 304 | `catalog_nbr` VARCHAR(4) NOT NULL, |
@@ -354,7 +353,7 @@ function procClassArray($lineSplit) { |
354 | 353 | `crse_id` int(6) NOT NULL, |
355 | 354 | `crse_offer_nbr` int(2) NOT NULL, |
356 | 355 | `strm` int(4) NOT NULL, |
357 | | - `session_code` int(1) NOT NULL, |
| 356 | + `session_code` varchar(4) NOT NULL, |
358 | 357 | `class_section` varchar(4) NOT NULL, |
359 | 358 | `class_mtg_nbr` int(2) NOT NULL, |
360 | 359 | `start_dt` date NOT NULL, |
@@ -406,7 +405,7 @@ function procMeetArray($lineSplit) { |
406 | 405 | `crse_id` int(6) NOT NULL, |
407 | 406 | `crse_offer_nbr` int(2) NOT NULL, |
408 | 407 | `strm` int(4) NOT NULL, |
409 | | - `session_code` int(1) NOT NULL, |
| 408 | + `session_code` varchar(4) NOT NULL, |
410 | 409 | `class_section` varchar(4) NOT NULL, |
411 | 410 | `class_mtg_nbr` int(2) NOT NULL, |
412 | 411 | `last_name` varchar(30) NOT NULL, |
@@ -526,7 +525,7 @@ function procInstrArray($lineSplit) { |
526 | 525 | // Grab each COURSE from the classes table |
527 | 526 | $courseQuery = "SELECT strm, subject, acad_org, catalog_nbr, descr, course_descrlong,"; |
528 | 527 | $courseQuery .= " crse_id, crse_offer_nbr, session_code"; |
529 | | -$courseQuery .= " FROM classes WHERE strm < 20130 GROUP BY crse_id, strm"; |
| 528 | +$courseQuery .= " FROM classes WHERE strm < 20130 GROUP BY crse_id, strm, session_code"; |
530 | 529 | debug("... Updating courses\n0%", false); |
531 | 530 | $courseResult = mysqli_query($dbConn, $courseQuery); |
532 | 531 | if(!$courseResult) { |
@@ -583,7 +582,7 @@ function procInstrArray($lineSplit) { |
583 | 582 | // Fetch the first instructor for the section |
584 | 583 | $instQuery = "SELECT CONCAT(first_name,' ',last_name) AS i FROM instructors"; |
585 | 584 | $instQuery .= " WHERE crse_id={$row['crse_id']} AND crse_offer_nbr={$row['crse_offer_nbr']}"; |
586 | | - $instQuery .= " AND strm={$row['strm']} AND session_code={$row['session_code']}"; |
| 585 | + $instQuery .= " AND strm={$row['strm']} AND session_code='{$row['session_code']}'"; |
587 | 586 | $instQuery .= " AND class_section='{$sect['class_section']}' LIMIT 1"; |
588 | 587 | $instResult = mysqli_query($dbConn, $instQuery); |
589 | 588 | if(!$instResult) { |
@@ -643,7 +642,7 @@ function procInstrArray($lineSplit) { |
643 | 642 | // Select all the meeting times of the section |
644 | 643 | $timeQuery = "SELECT bldg, room_nbr, meeting_time_start, meeting_time_end, mon, tues, wed, thurs, fri, sat, sun"; |
645 | 644 | $timeQuery .= " FROM meeting WHERE crse_id={$row['crse_id']} AND crse_offer_nbr={$row['crse_offer_nbr']}"; |
646 | | - $timeQuery .= " AND strm={$row['strm']} AND session_code={$row['session_code']}"; |
| 645 | + $timeQuery .= " AND strm={$row['strm']} AND session_code='{$row['session_code']}'"; |
647 | 646 | $timeQuery .= " AND class_section='{$sect['class_section']}'"; |
648 | 647 | $timeResult = mysqli_query($dbConn, $timeQuery); |
649 | 648 | if(!$timeResult) { |
|
0 commit comments