course_search.edit.inc

  1. 6.x modules/course_search/course_search.edit.inc
  2. 4.x modules/course_search/course_search.edit.inc
  3. 5.x modules/course_search/course_search.edit.inc

This file contains functions relating to editing the course info, like rotation schedule and syllabus

File

modules/course_search/course_search.edit.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * This file contains functions relating to editing the course info, like rotation schedule
  5. * and syllabus
  6. */
  7. /**
  8. * This form lets the user edit the course's syllabus or rotation schedule
  9. */
  10. function course_search_edit_course_details_form() {
  11. $form = array();
  12. fp_add_css(fp_get_module_path("course_search") . "/css/course_search_style.css");
  13. $weight = 0;
  14. $course_id = $_REQUEST["course_id"];
  15. $subject_id = $_REQUEST["subject_id"];
  16. $course_num = $_REQUEST["course_num"];
  17. $db = get_global_database_handler();
  18. $school_id = $db->get_school_id_for_course_id($course_id);
  19. $catalog_year = variable_get_for_school("current_catalog_year", 2006, $school_id);
  20. $course = new Course($course_id,false,null,false,$catalog_year);
  21. $course->load_descriptive_data(false, true, false, true);
  22. $school_code = "School #" . $school_id;
  23. if (module_enabled("schools")) {
  24. $school_code = schools_get_school_code_for_id($school_id);
  25. fp_set_title(t("Edit Course Info for @course - School @school", array("@course" => "$subject_id $course_num", "@school" => $school_code)));
  26. }
  27. else {
  28. fp_set_title(t("Edit Course Info for @course", array("@course" => "$subject_id $course_num")));
  29. }
  30. $form["#attributes"] = array("enctype" => "multipart/form-data");
  31. $form["course_id"] = array(
  32. "type" => "hidden",
  33. "value" => $course_id,
  34. );
  35. $form["subject_id"] = array(
  36. "type" => "hidden",
  37. "value" => $subject_id,
  38. );
  39. $form["course_num"] = array(
  40. "type" => "hidden",
  41. "value" => $course_num,
  42. );
  43. $form["school_id"] = array(
  44. "type" => "hidden",
  45. "value" => $school_id,
  46. );
  47. $course->catalog_year = $catalog_year;
  48. // Find out filename/link of current syllabus.
  49. $filelink = "- None currently entered -";
  50. $filename = "";
  51. if ($syllabus_details = course_search_get_course_syllabus_details($course_id)) {
  52. $filename = $syllabus_details["filename"];
  53. }
  54. $bool_delete_cb = FALSE;
  55. if ($filename != "") {
  56. $filelink = $filename;
  57. $bool_delete_cb = TRUE;
  58. }
  59. $form["mark_course_title_and_description"] = array(
  60. "value" => "<strong>$course->title (" . $course->get_catalog_hours() . " " . t("hrs.") . ")</strong>
  61. <div>$course->description</div>
  62. ",
  63. 'weight' => $weight++,
  64. );
  65. $form["syllabus"] = array(
  66. "type" => "file",
  67. "label" => t("Submit new sample course syllabus:"),
  68. "prefix" => "<hr>" . t("Current sample syllabus:") . " " . $filelink,
  69. "description" => t("Note: selecting a new file will replace any existing
  70. syllabus. Remember to click Submit after selecting a file."),
  71. 'weight' => $weight++,
  72. );
  73. if ($bool_delete_cb) {
  74. $form["del_syllabus"] = array(
  75. "type" => "checkboxes",
  76. "options" => array("yes" => t("Delete the existing syllabus?")),
  77. 'weight' => $weight++,
  78. );
  79. }
  80. if ($filename != "") {
  81. $s_url = $syllabus_details["url"];
  82. $form["mark_syl_download_info"] = array(
  83. "value" => "<p>" . t("Syllabus may be downloaded using this address: ") . "<a href='$s_url'>$s_url</a></p>",
  84. 'weight' => $weight++,
  85. );
  86. }
  87. $form["mark_rotation_and_capacity"] = array(
  88. "value" => "<b>" . t("Course Rotation Schedule & Seat Capacity:") . "</b>
  89. <br>" . t("Select semesters/terms in which this Course
  90. will be offered for the next five years, as well as how many seats are expected. Seat capacity will only be saved for courses
  91. which are checked as being offered."),
  92. 'weight' => $weight++,
  93. );
  94. $term_array = csv_to_array(variable_get_for_school("course_search_avail_term_id_suffix_order", '', $school_id));
  95. $form["mark_cb_wrapper"] = array(
  96. "value" => "<div class='rotation-form-checkboxes'>",
  97. 'weight' => $weight++,
  98. );
  99. $term_structures = get_term_structures($school_id);
  100. $y = 1;
  101. for ($t = $catalog_year; $t <= $catalog_year + 5; $t++) {
  102. $form["year$y"] = array(
  103. "type" => "hidden",
  104. "value" => $t,
  105. );
  106. foreach($term_array as $x) {
  107. $check_year = $t;
  108. $term_id = $check_year . $x;
  109. // Should we make any adjustments based on the term_structure?
  110. // Does the term suffix ($x) call for the year to be
  111. // subtracted by 1? This is the case at ULM for fall.
  112. // Ex: 201340 is Fall of *2012*, not 2013.
  113. // We can tell this because the term structure (from admin settings)
  114. if (@strtoupper($term_structures[$x]["disp_adjust"]) == "[Y-1]") {
  115. $term_id = ($check_year + 1) . $x;
  116. }
  117. $cb_disp_name = get_term_description($term_id, TRUE, $school_id);
  118. $cbname = $term_id;
  119. $cb_default_val = array();
  120. $capacity_default_val = "";
  121. // See if this box should be checked...
  122. $res = db_query("select * from course_rotation_schedule
  123. where `course_id`='?'
  124. and `term_id`='$term_id' ", $course_id);
  125. if (db_num_rows($res) > 0) {
  126. $cb_default_val = array("yes" => "yes");
  127. $cur = db_fetch_array($res);
  128. if (intval($cur['capacity']) > 0) {
  129. $capacity_default_val = intval($cur['capacity']);
  130. }
  131. }
  132. $form['mark_start_' . $cbname] = array(
  133. 'value' => "<div class='course-search-edit-term-wrapper'>",
  134. 'weight' => $weight++,
  135. );
  136. $form["cb_$cbname"] = array(
  137. "type" => "checkboxes",
  138. "options" => array("yes" => $cb_disp_name),
  139. "value" => $cb_default_val,
  140. 'weight' => $weight++,
  141. );
  142. $form["capacity_$cbname"] = array(
  143. "type" => "textfield",
  144. "attributes" => array("placeholder" => t("# Seats"), "class" => "capacity-textfield"),
  145. "value" => $capacity_default_val,
  146. 'weight' => $weight++,
  147. );
  148. $form['mark_end_' . $cbname] = array(
  149. 'value' => "</div>",
  150. 'weight' => $weight++,
  151. );
  152. } // foreach term_array
  153. $form["mark_horizontal_line"] = array(
  154. "value" => "<hr style='border:1px dashed #ccc;'><br>",
  155. 'weight' => $weight++,
  156. );
  157. $y++;
  158. }
  159. $form["mark_close_cb_wrapper"] = array(
  160. "value" => "</div>",
  161. 'weight' => $weight++,
  162. );
  163. // Not anticipated check.
  164. $default_val = array();
  165. $res = db_query("SELECT * FROM course_rotation_schedule
  166. WHERE `course_id`='?'
  167. AND `term_id`='NOTA' ", $course_id);
  168. //debug_c_t("$t$x");
  169. if (db_num_rows($res) > 0)
  170. {
  171. $default_val = array("yes" => "yes");
  172. }
  173. $form["not_anticipated"] = array(
  174. "type" => "checkboxes",
  175. "label" => t("Not Anticipated:"),
  176. "options" => array("yes" => t("This course is not anticipated.")),
  177. "value" => $default_val,
  178. "description" => t("Checking this box means that the course is not
  179. anticipated to be offered within the time range above.
  180. This will override any selections made above."),
  181. 'weight' => $weight++,
  182. );
  183. $form["submit"] = array(
  184. "type" => "submit",
  185. "value" => t("Submit"),
  186. "prefix" => "<hr>",
  187. 'weight' => $weight++,
  188. );
  189. return $form;
  190. }
  191. function course_search_edit_course_details_form_submit($form, $form_state) {
  192. global $user;
  193. $faculty_id = $user->cwid;
  194. $course_id = $form_state["values"]["course_id"];
  195. $subject_id = $form_state["values"]["subject_id"];
  196. $course_num = $form_state["values"]["course_num"];
  197. $school_id = intval($form_state["values"]["school_id"]);
  198. $_SESSION['last_saved_school_id'] = $school_id;
  199. $term_array = csv_to_array(variable_get_for_school("course_search_avail_term_id_suffix_order", '', $school_id));
  200. for ($t = 1; $t <= 6; $t++) {
  201. $year = $form_state["values"]["year$t"];
  202. // delete the existing entries for this year & course here.
  203. db_query("DELETE FROM course_rotation_schedule
  204. WHERE `course_id`= ?
  205. AND `term_id` LIKE ? ", $course_id, "$year%");
  206. /////////////////////////
  207. // Now, for x = 1 to 5,
  208. // if ($_request["cb_$year$x"] == "yes")
  209. // then insert into table... blah blah...
  210. foreach($term_array as $x) {
  211. if (isset($form_state["values"]["cb_$year$x"]) && $form_state["values"]["cb_$year$x"]["yes"] == "yes") {
  212. $capacity = intval($form_state["values"]["capacity_$year$x"]);
  213. db_query("INSERT INTO course_rotation_schedule
  214. (faculty_id, course_id, term_id, entry_value, posted, capacity)
  215. VALUES (?, ?, ?, ?, ?, ?) ", $faculty_id, $course_id, "$year$x", "$subject_id~$course_num", time(), $capacity);
  216. }
  217. }
  218. }
  219. // Not anticipated check?
  220. // delete first...
  221. db_query("DELETE FROM course_rotation_schedule
  222. WHERE course_id = ?
  223. AND term_id = 'NOTA' ", $course_id);
  224. if (isset($form_state["values"]["not_anticipated"]) && $form_state["values"]["not_anticipated"]["yes"] == "yes") {
  225. db_query("INSERT INTO course_rotation_schedule
  226. (faculty_id, course_id, term_id, entry_value, posted)
  227. VALUES (?, ?, ?, ?, ?) ", $faculty_id, $course_id, "NOTA", "$subject_id~$course_num", time());
  228. }
  229. // Should we delete the current syllabus?
  230. if (isset($form_state["values"]["del_syllabus"]) && $form_state["values"]["del_syllabus"]["yes"] == "yes") {
  231. if ($details = course_search_get_course_syllabus_details($course_id)) {
  232. $filename = $details["filename"];
  233. if ($filename != "") {
  234. unlink("./custom/files/syllabi/$filename");
  235. db_query("DELETE FROM course_syllabi
  236. WHERE `course_id`= ? ", $course_id);
  237. }
  238. }
  239. }
  240. // Did the user try to upload a file?
  241. if (trim($_FILES["syllabus"]["tmp_name"][0]) != "")
  242. {
  243. $test = course_search_upload_attachment($course_id, $subject_id, $course_num);
  244. if (!$test)
  245. {
  246. fp_add_message(t("There was an error uploading attachment. It is possible this is a write-permission
  247. issue with the server."));
  248. } else {
  249. // success.
  250. }
  251. }
  252. watchdog('course_search', "edit_course_details course_id:$course_id, subject_id:$subject_id, course_num:$course_num, school_id:$school_id", array());
  253. fp_add_message(t("This course's details have been updated successfully."));
  254. }
  255. function course_search_upload_attachment($course_id, $subject_id, $course_num) {
  256. // If any files were attached, go ahead and upload them.
  257. $datetime = date("_Y-j-m_g-i-sa", time());
  258. $tmp_filename = $_FILES["syllabus"]["tmp_name"][0];
  259. if (trim($tmp_filename) != "") {
  260. // Meaning, yes, a file was uploaded.
  261. $suffix = $datetime;
  262. // Create the new filename, based on the id's its been assigned.
  263. $original_filename = $_FILES["syllabus"]["name"][0];
  264. // replace problem characters...
  265. $original_filename = str_replace("'", "", $original_filename);
  266. $original_filename = str_replace('"', '', $original_filename);
  267. $original_filename = str_replace(",", "", $original_filename);
  268. $temp = explode(".", $original_filename);
  269. $ext = $temp[count($temp) - 1]; // get the original extension.
  270. $new_filename = trim(substr($original_filename, 0, 30)) . ".$suffix.$ext";
  271. // Does the directory/files/syllabi exist?
  272. // If not, we will create it.
  273. $files_path = $GLOBALS["fp_system_settings"]["file_system_path"];
  274. if (!is_dir("$files_path/custom/files/syllabi")) {
  275. if (!mkdir("$files_path/custom/files/syllabi")) {
  276. return FALSE;
  277. }
  278. }
  279. // Try to copy...
  280. if (!copy($tmp_filename, "$files_path/custom/files/syllabi/$new_filename")) {
  281. return FALSE;
  282. }
  283. // If we are here, then there is success! We should update the
  284. // table with the new filename, which is $new_filename.
  285. // delete the existing entry, if any.
  286. // We need to unlink any existing syllabus file...
  287. if ($file_details = course_search_get_course_syllabus_details($course_id)) {
  288. $filename = $file_details["filename"];
  289. if (!unlink("$files_path/custom/files/syllabi/$filename")) {
  290. fp_add_message(t("Unable to delete existing file:") . " $filename");
  291. }
  292. }
  293. db_query("DELETE FROM course_syllabi
  294. WHERE course_id = '?' ", $course_id);
  295. // Okay, now add the new entry.
  296. db_query("INSERT INTO course_syllabi
  297. (course_id, course_perm_id, filename, posted)
  298. values (?, ?, ?, ? )", $course_id, $subject_id . '_' . $course_num, $new_filename, time());
  299. }
  300. return TRUE;
  301. }
  302. /**
  303. * Display a plain list of courses, making it easier for admins to edit schedules and details in one spot.
  304. *
  305. */
  306. function course_search_display_edit_courses()
  307. {
  308. $rtn = "";
  309. $school_id = 0;
  310. if (@$_REQUEST['school_id'] != '') {
  311. $school_id = intval($_REQUEST['school_id']);
  312. }
  313. if (module_enabled("schools")) { // The schools module is enabled. We need to first ask what school we want to look at.
  314. $rtn .= "<div class='current-school'>" . t("Current school: ") . "<strong>" . schools_get_school_name_for_id($school_id) . "</strong>
  315. - " . l(t("Change?"), "tools/course-search") . "</div><br>";
  316. }
  317. $current_catalog_year = variable_get_for_school("current_catalog_year", "", $school_id);
  318. // catalog_year is always just whatever the current year is.
  319. $catalog_year = $current_catalog_year;
  320. $cc = 1;
  321. // Get the "upper range" (UR) and
  322. // lower range (LR) of the courses in question...
  323. $ur = trim(@$_GET["ur"]);
  324. $lr = trim(@$_GET["lr"]);
  325. if ($ur == "")
  326. { // meaning, no range was set. Use A - AZZZZZ, so, all of the A's.
  327. $ur = @$_SESSION["dec_ur"];
  328. $lr = @$_SESSION["dec_lr"];
  329. if ($ur == "")
  330. { // if still blank, assign it..
  331. $ur = "A";
  332. $lr = "AZZZZ";
  333. }
  334. }
  335. $_SESSION["dec_ur"] = $ur;
  336. $_SESSION["dec_lr"] = $lr;
  337. $rtn .= "
  338. <div class='tenpt' style='margin-bottom: 20px;'>
  339. " . t("To update a course's sample syllabus or schedule,
  340. please select the course from the list below.") . "
  341. </div>
  342. ";
  343. $letter_ranges = array(
  344. "A" => array("A", "AZZZZ"),
  345. "B" => array("B", "BZZZZ"),
  346. "C-CN" => array("C", "CNZZZ"),
  347. "CO-CZ" => array("CO", "CZZZZ"),
  348. "D" => array("D", "DZZZZ"),
  349. "E" => array("E", "EZZZZ"),
  350. "F" => array("F", "FZZZZ"),
  351. "G" => array("G", "GZZZZ"),
  352. "H" => array("H", "HZZZZ"),
  353. "I-L" => array("I", "LZZZZ"),
  354. "M-MR" => array("M", "MRZZZ"),
  355. "MS-MZ" => array("MS", "MZZZZ"),
  356. "N-O" => array("N", "OZZZZ"),
  357. "P" => array("P", "PZZZZ"),
  358. "Q-R" => array("Q", "RZZZZ"),
  359. "S-SO" => array("S", "SOZZZ"),
  360. "SP-SZ" => array("SP", "SZZZZ"),
  361. "T-Z" => array("T", "ZZZZZ"),
  362. );
  363. $rtn .= "<div class='admin-courses-select-letter-bar'>
  364. ";
  365. foreach($letter_ranges as $disp => $vals) {
  366. $rtn .= l($disp, "tools/course-search/edit-list", "school_id=$school_id&ur=" . $vals[0] . "&lr=" . $vals[1], array("class" => "admin-courses-letter-link")) . " &nbsp; ";
  367. }
  368. $rtn .= "</div>
  369. <hr>";
  370. $rtn .= "<table border='0' cellpadding='3' cellspacing='0' width='100%'>
  371. <tr>
  372. <th class='tenpt'>Course</td>";
  373. if (module_enabled('schools')) {
  374. $rtn .= "
  375. <th class='tenpt' align='center'>School</td>
  376. ";
  377. }
  378. $rtn .= "
  379. <th class='tenpt' align='center'>Sched</td>
  380. <th class='tenpt' align='center'>Syl</td>
  381. <th class='tenpt' align='center'>Updated</td>
  382. </tr>";
  383. $res = db_query("SELECT * FROM courses
  384. WHERE catalog_year = ?
  385. AND subject_id BETWEEN ? AND ?
  386. AND delete_flag = 0
  387. AND exclude = 0
  388. AND school_id = ?
  389. ORDER BY subject_id, course_num ", $catalog_year, $ur, $lr, $school_id);
  390. while ($cur = db_fetch_array($res)) {
  391. extract($cur, 3, "db");
  392. $syl = $sch = $school = $updated = "";
  393. // Right here, maybe check to see if this course has
  394. // a syllabus and/or schedule entered?
  395. $school = "#" . $cur['school_id'];
  396. if (module_enabled("schools")) {
  397. $school = schools_get_school_code_for_id($school_id);
  398. }
  399. $syllabus_details = course_search_get_course_syllabus_details($db_course_id);
  400. $filename = @$syllabus_details["filename"];
  401. if ($filename != "") {
  402. $url = $syllabus_details["url"];
  403. $syl = "<a href='$url'><i class='fa fa-file-o'></i></a>";
  404. $updated = $syllabus_details["posted"];
  405. }
  406. $schedule_array = course_search_get_course_rotation_schedule($db_course_id, $catalog_year, 100, TRUE);
  407. $not_ant = course_search_get_course_rotation_schedule_not_anticipated($db_course_id);
  408. if (count($schedule_array) > 0 || $not_ant == true) {
  409. $sch = "<img src='" . fp_theme_location() . "/images/small_check.gif'>";
  410. if ($not_ant) {
  411. $sch = "NA";
  412. }
  413. // When was the schedule last updated?
  414. $res2 = db_query("SELECT * FROM course_rotation_schedule
  415. WHERE course_id = ?
  416. LIMIT 1", $db_course_id);
  417. $cur2 = db_fetch_array($res2);
  418. if ($cur2) {
  419. $updated2 = $cur2["posted"];
  420. if ($updated2 > $updated) {
  421. $updated = $updated2;
  422. }
  423. }
  424. }
  425. if ($updated != "") {
  426. $updated = date("n/d/Y",$updated);
  427. }
  428. $hrs = $db_min_hours;
  429. if (trim($db_min_hours) != trim($db_max_hours)) {
  430. $hrs .= " - $db_max_hours";
  431. }
  432. $hrs .= " hrs.";
  433. $rep_hours = "";
  434. if ($db_repeat_hours > $db_min_hours)
  435. {
  436. $rep_hours = " rep to $db_repeat_hours hrs.";
  437. }
  438. // remove special chars from subject_id...
  439. $display_subject_id = $db_subject_id;
  440. $db_subject_id = urlencode($db_subject_id);
  441. $rtn .= "<tr>
  442. <td valign='top' >";
  443. /*$rtn .= "<div style='padding:3px;'>
  444. <a href='$moduleActionURL&performAction=editSpecificCourse&courseID=$db_course_id&subjectID=$db_subject_id&courseNum=$db_course_num'>$displaySubjectID $db_course_num - $db_title</a><!-- - $hrs$repHours --></div>";
  445. */
  446. $rtn .= l("$display_subject_id $db_course_num - $db_title", "tools/course-search/edit-info-details", "school_id=$school_id&course_id=$db_course_id&subject_id=$db_subject_id&course_num=$db_course_num");
  447. // https://orion.ulm.edu/flightpath/tools/course-search/edit-info-details?course_id=468798&subject_id=ACCT&course_num=1010
  448. $rtn .= "</td>";
  449. if (module_enabled('schools')) {
  450. $rtn .= " <td >$school</td>";
  451. }
  452. $rtn .= "
  453. <td >$sch</td>
  454. <td >$syl</td>
  455. <td >$updated</td>
  456. </tr>";
  457. } // while
  458. $rtn .= "</table>";
  459. return $rtn;
  460. }
  461. function z__course_search_display_view_reports() {
  462. $rtn = "";
  463. $rtn .= "<h2 class='title'>" . t("View Reports") . "</h2>";
  464. $rtn .= "<ul>";
  465. $rtn .= "<li>" . l(t("[CSV] Anticipated Offerings - All Courses"), "tools/course-search/get-offering-csv") . "</a>
  466. - " . t("This report shows all courses in the catalog's anticipated offerings
  467. for the next 5 years. Will be downloaded as a CSV file.
  468. <b>May take up to a minute to load.</b>") . "</li> ";
  469. $rtn .= "</ul>";
  470. return $rtn;
  471. }
  472. function z__course_search_get_offering_csv($school_id = 0) {
  473. $csv = "";
  474. $csv .= "SUBJ, NUM, COL, DEPT, SYL UPDATED, ";
  475. $catalog_year = variable_get_for_school("current_catalog_year", "", $school_id);
  476. $course_term_array = array();
  477. $check_term_array = array();
  478. $term_array = csv_to_array(variable_get("course_search_avail_term_id_suffix_order"));
  479. for ($t = $catalog_year; $t <= $catalog_year + 5; $t++)
  480. {
  481. foreach($term_array as $x)
  482. {
  483. $check_year = $t;
  484. $term_id = $check_year . $x;
  485. $check_term_array[] = $term_id;
  486. $new_course = new Course();
  487. $new_course->term_id = $term_id;
  488. $new_course->school_id = $school_id;
  489. $disp_name = $new_course->get_term_description(TRUE);
  490. $csv .= " " . $disp_name . " ($term_id) ,";
  491. // While we are here, we are going to get an array of ALL the courses
  492. // which have an entry for this term in our table. This should make
  493. // it faster to look up later.
  494. $res = db_query("SELECT * FROM course_rotation_schedule
  495. WHERE term_id = ? ", $term_id);
  496. while ($cur = db_fetch_array($res)) {
  497. $course_term_array[$term_id][$cur["course_id"]] = TRUE;
  498. }
  499. }
  500. }
  501. // Take off last comma of csv.
  502. $csv = substr($csv, 0, -1);
  503. $csv .= "\n";
  504. $result = db_query("SELECT * FROM courses
  505. WHERE
  506. catalog_year = ?
  507. AND delete_flag = 0
  508. AND exclude = 0
  509. AND school_id = ?
  510. ORDER BY subject_id, course_num ", $catalog_year, $school_id);
  511. while ($cur = db_fetch_array($result)) {
  512. extract($cur, 3, "db");
  513. //debugCT($db_subject_id . $db_course_num);
  514. $csv .= "$db_subject_id, $db_course_num, ";
  515. // What college does this course belong to?
  516. $res2 = db_query("SELECT * FROM subjects
  517. WHERE subject_id = ?
  518. AND school_id = ? ", $db_subject_id, $school_id);
  519. $cur2 = db_fetch_array($res2);
  520. $college = $cur2["college"];
  521. $dept_name = $cur2["title"];
  522. $csv .= "$college, $dept_name, ";
  523. // Also, when was their last syllabus submitted?
  524. $syl = "";
  525. $res2 = db_query("SELECT * FROM course_syllabi WHERE course_id = '?'", $db_course_id);
  526. $cur2 = db_fetch_array($res2);
  527. $syl = format_date($cur2["posted"]);
  528. $csv .= "$syl, ";
  529. // Now, get course offerings for the next X terms...
  530. foreach ($check_term_array as $term_id) {
  531. // See if this term is offered for this course
  532. if ($course_term_array[$term_id][$db_course_id] == TRUE) {
  533. $csv .= " X,";
  534. }
  535. else {
  536. $csv .= ",";
  537. }
  538. }
  539. // Take off last comma of csv.
  540. $csv = substr($csv, 0, -1);
  541. $csv .= "\n";
  542. }
  543. header('Content-type: text/csv');
  544. header('Content-Disposition: attachment; filename="report_ant_offering.csv"');
  545. print $csv;
  546. die;
  547. }

Functions

Namesort descending Description
course_search_display_edit_courses Display a plain list of courses, making it easier for admins to edit schedules and details in one spot.
course_search_edit_course_details_form This form lets the user edit the course's syllabus or rotation schedule
course_search_edit_course_details_form_submit
course_search_upload_attachment
z__course_search_display_view_reports
z__course_search_get_offering_csv