admin.courses.inc

  1. 6.x modules/admin/admin.courses.inc
  2. 4.x modules/admin/admin.courses.inc
  3. 5.x modules/admin/admin.courses.inc

File

modules/admin/admin.courses.inc
View source
  1. <?php
  2. /* Functions related to working with Course data in FP */
  3. /**
  4. * This function displays all of our courses for us to edit.
  5. */
  6. function admin_display_courses() {
  7. $rtn = "";
  8. // Do this using $render array, so it can be altered
  9. // by hook_content_alter
  10. $render = array();
  11. $render['#id'] = 'admin_display_courses';
  12. $de_catalog_year = admin_get_de_catalog_year();
  13. fp_add_css(fp_get_module_path("admin") . "/css/admin.css");
  14. $cc = 1;
  15. $show_hidden = trim(@$_GET["show_hidden"]);
  16. if ($show_hidden != "") {
  17. $_SESSION["dehidden"] = $show_hidden;
  18. }
  19. else {
  20. $show_hidden = @$_SESSION["dehidden"];
  21. }
  22. // Get the "upper range" (UR) and
  23. // lower range (LR) of the courses in question...
  24. $ur = trim(@$_GET["ur"]);
  25. $lr = trim(@$_GET["lr"]);
  26. if ($ur == "") {
  27. // meaning, no range was set. Use A - AZZZZZ, so, all of the A's.
  28. $ur = @$_SESSION["dec_ur"];
  29. $lr = @$_SESSION["dec_lr"];
  30. if ($ur == "") {
  31. // if still blank, assign it..
  32. $ur = "A";
  33. $lr = "AZZZZ";
  34. }
  35. }
  36. $_SESSION["dec_ur"] = $ur;
  37. $_SESSION["dec_lr"] = $lr;
  38. //fp_set_title(t("Courses for @year", array("@year" => $de_catalog_year)));
  39. $render['title_top'] = array(
  40. 'value' => "<h2 class='title'>" . t("Courses for @year", array("@year" => $de_catalog_year)) . "</h2>",
  41. );
  42. $html = "";
  43. $letter_ranges = array(
  44. "A" => array("A", "AZZZZ"),
  45. "B" => array("B", "BZZZZ"),
  46. "C-CN" => array("C", "CNZZZ"),
  47. "CO-CZ" => array("CO", "CZZZZ"),
  48. "D" => array("D", "DZZZZ"),
  49. "E" => array("E", "EZZZZ"),
  50. "F" => array("F", "FZZZZ"),
  51. "G" => array("G", "GZZZZ"),
  52. "H" => array("H", "HZZZZ"),
  53. "I-L" => array("I", "LZZZZ"),
  54. "M-MR" => array("M", "MRZZZ"),
  55. "MS-MZ" => array("MS", "MZZZZ"),
  56. "N-O" => array("N", "OZZZZ"),
  57. "P" => array("P", "PZZZZ"),
  58. "Q-R" => array("Q", "RZZZZ"),
  59. "S-SO" => array("S", "SOZZZ"),
  60. "SP-SZ" => array("SP", "SZZZZ"),
  61. "T-Z" => array("T", "ZZZZZ"),
  62. );
  63. $html .= "<div class='admin-courses-select-letter-bar'>
  64. ";
  65. foreach($letter_ranges as $disp => $vals) {
  66. $html .= l($disp, "admin/courses", "de_catalog_year=$de_catalog_year&ur=" . $vals[0] . "&lr=" . $vals[1], array("class" => "admin-courses-letter-link")) . " &nbsp; ";
  67. }
  68. $html .= "</div>
  69. <div class='tenpt'>
  70. <div style='padding: 5px;'>
  71. " . l(t("Add a course for @year", array("@year" => $de_catalog_year)), "admin/courses/edit-course", "course_id=new&de_catalog_year=$de_catalog_year") . "
  72. </div>
  73. Legend: <br>&nbsp; &nbsp;[e] = Course has at least one add'l excluded name.
  74. &nbsp; &nbsp;[v] = Course has at least one add'l valid name.
  75. </div>
  76. ";
  77. $exclude_line = "and exclude != 1";
  78. if ($show_hidden == "yes") {
  79. $html .= "<div class='tenpt'><b>" . t("Showing excluded courses.") . " ";
  80. $html .= l(t("Hide?"), "admin/courses", "de_catalog_year=$de_catalog_year&show_hidden=no");
  81. $html .= "</b></div>";
  82. $exclude_line = "";
  83. }
  84. else {
  85. $html .= "<div class='tenpt'><b>" . t("Hiding excluded courses.") . " ";
  86. $html .= l(t("Show?"), "admin/courses", "de_catalog_year=$de_catalog_year&show_hidden=yes");
  87. $html .= "</b></div>";
  88. }
  89. $html .= "<hr><br>";
  90. $render['upper_links'] = array(
  91. 'value' => $html,
  92. );
  93. $render['courses_table_top'] = array(
  94. 'value' => "<table border='0' cellpadding='3' cellspacing='0' class='disp-courses-table'>",
  95. );
  96. $q = "SELECT * FROM draft_courses
  97. WHERE
  98. catalog_year = '?'
  99. AND subject_id BETWEEN '?' AND '?'
  100. AND delete_flag = '0'
  101. $exclude_line
  102. ORDER BY subject_id, course_num";
  103. $result = db_query($q, $de_catalog_year, $ur, $lr);
  104. while ($cur = db_fetch_array($result)) {
  105. extract($cur, 3, "db");
  106. $ex_names = "";
  107. $val_names = "";
  108. // Check to see if this course has more than one name...
  109. // removed AND `catalog_year`='$de_catalog_year' from query,
  110. // because we don't care what other cat year it came from.
  111. $res2 = db_query("SELECT * FROM draft_courses
  112. WHERE course_id = '?'
  113. ", $db_course_id);
  114. while ($cur2 = db_fetch_array($res2)) {
  115. if ($cur2["subject_id"] == $db_subject_id && $cur2["course_num"] == $db_course_num) {
  116. continue;
  117. }
  118. if ($cur2["exclude"] == "1") {
  119. $ex_names = "[e]";
  120. }
  121. else {
  122. $val_names = "[v]";
  123. }
  124. }
  125. $spanstyle = "";
  126. if ($db_exclude == "1") {
  127. $spanstyle = "background-color: #ddd;";
  128. }
  129. $temp_course = new Course();
  130. $db_title = $temp_course->fix_title($db_title);
  131. $db_min_hours = $db_min_hours*1;
  132. $db_max_hours = $db_max_hours*1;
  133. $db_repeat_hours = $db_repeat_hours*1;
  134. $hrs = $db_min_hours;
  135. if (trim($db_min_hours) != trim($db_max_hours)) {
  136. $hrs .= " - $db_max_hours";
  137. }
  138. $hrs .= " hrs.";
  139. $rep_hours = "";
  140. if ($db_repeat_hours > $db_min_hours) {
  141. $rep_hours = " rep to $db_repeat_hours hrs.";
  142. }
  143. // remove special chars from subject_id...
  144. $display_subject_id = $db_subject_id;
  145. $db_subject_id = str_replace("&","_A_",$db_subject_id);
  146. $render['course_row_' . $db_course_id] = array(
  147. 'value' => "
  148. <tr style='$spanstyle'>
  149. <td valign='top' width='90%'>
  150. <a name='course_$db_course_id'></a>
  151. <div style='$spanstyle padding:3px;'>
  152. " . l("$display_subject_id $db_course_num - $db_title", "admin/courses/edit-course", "course_id=$db_course_id&subject_id=$db_subject_id&course_num=$db_course_num&de_catalog_year=$de_catalog_year") . " - $hrs$rep_hours</div>
  153. </td>
  154. <td valign='top' width='5%'>
  155. $ex_names
  156. </td>
  157. <td valign='top' width='5%'>
  158. $val_names
  159. </td>
  160. </tr>",
  161. 'data' => array(
  162. 'course_id' => $db_course_id,
  163. 'catalog_year' => $de_catalog_year,
  164. 'db_row' => $cur,
  165. 'subject_id' => $db_subject_id,
  166. 'course_num' => $db_course_num,
  167. ),
  168. );
  169. } // while
  170. $render['courses_table_bottom'] = array(
  171. 'value' => "</table>",
  172. );
  173. $rtn .= fp_render_content($render);
  174. return $rtn;
  175. }
  176. /**
  177. * This form lets the user edit details about a course.
  178. */
  179. function admin_edit_course_form() {
  180. $form = array();
  181. $de_catalog_year = admin_get_de_catalog_year();
  182. $course_id = @$_REQUEST["course_id"];
  183. $subject_id = @$_REQUEST["subject_id"];
  184. $subject_id = str_replace("_A_","&",$subject_id);
  185. $course_num = @$_REQUEST["course_num"];
  186. $m = 0;
  187. fp_set_title(t("Edit Course @course", array("@course" => "$subject_id $course_num ($de_catalog_year)")));
  188. fp_add_css(fp_get_module_path("admin") . "/css/admin.css");
  189. fp_add_js(fp_get_module_path("admin") . "/js/admin.js");
  190. $form["de_catalog_year"] = array(
  191. "type" => "hidden",
  192. "value" => $de_catalog_year,
  193. );
  194. $form["course_id"] = array(
  195. "type" => "hidden",
  196. "value" => $course_id,
  197. );
  198. $form["subject_id"] = array(
  199. "type" => "hidden",
  200. "value" => $subject_id,
  201. );
  202. $form["course_num"] = array(
  203. "type" => "hidden",
  204. "value" => $course_num,
  205. );
  206. $form["perform_action2"] = array(
  207. "type" => "hidden",
  208. "value" => "",
  209. );
  210. // Begin the form...
  211. // TODO: implement this!
  212. if (@$_SESSION["de_advanced_mode"] == true)
  213. {
  214. $pC .= " <span class='tenpt' style='background-color: yellow; margin-left: 20px;'>
  215. adv: course_id = $course_id. Used by:
  216. <a href='javascript: popupWindow(\"admin.php?performAction=popup_degrees_using_course&course_id=$course_id\")'>[degrees]</a>
  217. <a href='javascript: popupWindow(\"admin.php?performAction=popup_groups_using_course&course_id=$course_id\")'>[groups]</a>
  218. <a href='javascript: popupWindow(\"admin.php?performAction=popup_students_using_course&course_id=$course_id\")'>[students]</a>
  219. </span>";
  220. }
  221. $course = new Course($course_id,false,null,false,$de_catalog_year, true);
  222. $course->catalog_year = $de_catalog_year; // Since it may be 1900, force it!
  223. $course->load_descriptive_data(false, true, false, true, true);
  224. $course->catalog_year = $de_catalog_year; // Since it may be 1900, force it!
  225. $all_names = $course->get_all_names(true);
  226. $warn_eqv = "";
  227. if (strstr($all_names, ",")) {
  228. $warn_eqv = "yes";
  229. }
  230. // Correct ghosthours, if they exist.
  231. if ($course->bool_ghost_hour) {
  232. $course->max_hours = 0;
  233. }
  234. if ($course->bool_ghost_min_hour) {
  235. $course->min_hours = 0;
  236. }
  237. $form["course_names"] = array(
  238. "type" => "textfield",
  239. "label" => t("Course names(s):"),
  240. "required" => TRUE,
  241. "value" => $all_names,
  242. "popup_description" => t("These are the possible display names for this course. Typically,
  243. there will be only one name. Ex: ACCT 110. You must place a space
  244. between the subject ID and course number.
  245. If this course is known by another name (has an eqv course)
  246. then enter it as well using a comma.
  247. Ex: ACCT 110, MATH 110A
  248. Add the word 'exclude' to prevent it from showing in course
  249. selection windows in FlightPath.
  250. Ex: ACCT 110, MATH 110A exclude
  251. IMPORTANT: Course names are updated for ALL YEARS of a course."),
  252. "weight" => 10,
  253. );
  254. $form["title"] = array(
  255. "type" => "textfield",
  256. "label" => t("Title:"),
  257. "value" => $course->title,
  258. "popup_description" => t("The title of the course displayed in FlightPath."),
  259. "weight" => 20,
  260. );
  261. $form["min_hours"] = array(
  262. "type" => "textfield",
  263. "label" => t("Min hours:"),
  264. "size" => 10,
  265. "value" => $course->min_hours,
  266. "popup_description" => t("The min and max hours for a course will usually be the same
  267. number. Ex: 3. If they differ, it means the course has
  268. variable hours.
  269. For example, if you have a course
  270. worth 1-6 hours, enter 1 for min, and 6 for max."),
  271. "weight" => 30,
  272. );
  273. $form["max_hours"] = array(
  274. "type" => "textfield",
  275. "label" => t("Max hours:"),
  276. "size" => 10,
  277. "value" => $course->max_hours,
  278. "popup_description" => t("The min and max hours for a course will usually be the same
  279. number. Ex: 3. If they differ, it means the course has
  280. variable hours.
  281. For example, if you have a course
  282. worth 1-6 hours, enter 1 for min, and 6 for max."),
  283. "weight" => 40,
  284. );
  285. $form["repeat_hours"] = array(
  286. "type" => "textfield",
  287. "label" => t("Repeat hours:"),
  288. "size" => 10,
  289. "value" => $course->repeat_hours,
  290. "popup_description" => t("This is the number of hours a course may be repeated for credit.
  291. For example, if a course is worth 3 hours, but may be repeated
  292. for up to 9 hours of credit, enter a 9 in this box.
  293. If a course CANNOT be repeated for credit, this would
  294. be the same number as the min and max, or simply blank.
  295. If you are unsure what to enter, leave it blank."),
  296. "weight" => 50,
  297. );
  298. $form["description"] = array(
  299. "type" => "textarea",
  300. "label" => t("Description"),
  301. "value" => $course->description,
  302. "rows" => 4,
  303. "cols" => 80,
  304. "weight" => 60,
  305. );
  306. $form["all_years"] = array(
  307. "type" => "checkboxes",
  308. "label" => t("Update for all years?"),
  309. "options" => array("yes" => t("Update title, description, and hour info for all years of this course.")),
  310. "popup_description" => t("Check this box and press Submit to update title, description, and hour information
  311. for all available years of this course. Note that course name is automatically
  312. updated for all years, regardless if you check this box or not."),
  313. "weight" => 70,
  314. );
  315. $form["data_entry_comment"] = array(
  316. "type" => "textarea",
  317. "label" => t("Optional Comment: (only seen by other FlightPath administrators)"),
  318. "rows" => 3,
  319. "cols" => 80,
  320. "value" => $course->data_entry_comment,
  321. "weight" => 80,
  322. );
  323. $form["submit"] = array(
  324. "type" => "submit",
  325. "value" => t("Save for @year", array("@year" => $de_catalog_year)),
  326. "prefix" => "<hr>",
  327. "weight" => 90,
  328. );
  329. // Only show delete option based on permission
  330. if (user_has_permission("can_delete_data_entry")) {
  331. $form["mark" . $m++] = array(
  332. "type" => "markup",
  333. "value" => "<div align='right' class='courses-delete-course-wrapper'>
  334. " . t("Delete this course?") . " <input type='button' value='X'
  335. onClick='adminDeleteCourse(\"$course_id\",\"$de_catalog_year\",\"$warn_eqv\");'>
  336. </div>",
  337. "weight" => 100,
  338. );
  339. }
  340. return $form;
  341. }
  342. function admin_edit_course_form_submit(&$form, $form_submit) {
  343. $values = $form_submit["values"];
  344. $de_catalog_year = $values["de_catalog_year"];
  345. $course_id = trim($values["course_id"]);
  346. $course_names = trim($values["course_names"]);
  347. $db = get_global_database_handler();
  348. if ($course_names == "") {
  349. $course_names = $values["subject_id"] . " " . $values["course_num"];
  350. }
  351. $title = trim($values["title"]);
  352. $min_hours = floatval(trim($values["min_hours"]));
  353. $max_hours = floatval(trim($values["max_hours"]));
  354. $repeat_hours = floatval(trim($values["repeat_hours"]));
  355. //$exclude = trim($_POST["exclude"]);
  356. $description = trim($values["description"]);
  357. $data_entry_comment = trim($values["data_entry_comment"]);
  358. // Since we are making a change to the draft table(s), let's add a row
  359. // to draft instructions.
  360. $db->add_draft_instruction("-");
  361. // Unlike the degrees and the groups, course_ids are not
  362. // unique. Only a course_id + catalog_year pair are unique. This
  363. // is so we can handle equivalent courses more gracefully.
  364. // So, the first thing we need to do is delete *all* courses with the
  365. // course_id and catalog_year listed above. For most courses, this will
  366. // only be one row. For eqv courses, this will delete more than one row.
  367. if ($course_id != "new") {
  368. // Don't delete! Temporarily transfer to a temporary course_id.
  369. // Will possibly delete later.
  370. $res = db_query("UPDATE draft_courses
  371. SET course_id = '-12345'
  372. WHERE course_id = '?'
  373. AND catalog_year = '?' ", $course_id, $de_catalog_year);
  374. }
  375. if ($values["perform_action2"] == "delete_course" && user_has_permission("can_delete_data_entry")) {
  376. // That's it. All we wanted to do was delete the course.
  377. $query = "DELETE FROM draft_courses
  378. WHERE course_id = '-12345'
  379. ";
  380. $res = db_query($query);
  381. fp_add_message(t("Course %course successfully deleted for %year", array("%course" => $course_names, "%year" => $de_catalog_year)));
  382. // Redirect us to the list of courses.
  383. $form["#redirect"] = array(
  384. "path" => "admin/courses",
  385. "query" => "de_catalog_year=$de_catalog_year",
  386. );
  387. return;
  388. }
  389. // If the $course_id == new then create a new one.
  390. if ($course_id == "new") {
  391. $course_id = $db->request_new_course_id();
  392. $values["course_id"] = $course_id;
  393. // change the $form redirect so we get sent to the new course on save.
  394. $form["#redirect"] = array(
  395. "path" => "admin/courses/edit-course",
  396. "query" => "de_catalog_year=$de_catalog_year&course_id=$course_id",
  397. );
  398. }
  399. // Now, we will split the courseNames on commas, and for each
  400. // token, we will insert a row into the database.
  401. $courses = explode(",", $course_names);
  402. foreach($courses as $course) {
  403. $course = str_replace(" ", " ", $course);
  404. $course = str_replace(" ", " ", $course);
  405. $course = str_replace(" ", " ", $course);
  406. $course = trim($course);
  407. if ($course == "") { continue; }
  408. $temp = explode(" ", $course);
  409. $subject_id = trim($temp[0]);
  410. $course_num = trim($temp[1]);
  411. ////////////
  412. /// Error conditions...
  413. if (strtolower($course_num) == "exclude" || $course_num == "") {
  414. form_error("course_names", t("It appears you specified an excluded course
  415. without a course number. You entered %course.
  416. Notice there is no course number. Please re-enter.", array("%course" => "$subject_id $course_num")));
  417. continue;
  418. }
  419. ////////////////
  420. $exclude = 0;
  421. // Do we exclude?
  422. if (strtolower(trim($temp[2])) == "exclude") {
  423. $exclude = 1;
  424. // Set ALL courses with this subject_id and course_num to exclude!
  425. $res = db_query("UPDATE draft_courses
  426. SET exclude = '1'
  427. WHERE subject_id = '?'
  428. AND course_num = '?'
  429. ", $subject_id, $course_num);
  430. }
  431. else {
  432. // Aet all courses with this subject_id and course_num to NOT exclude!
  433. $res = db_query("UPDATE draft_courses
  434. SET exclude = '0'
  435. WHERE subject_id = '?'
  436. AND course_num = '?'
  437. ", $subject_id, $course_num);
  438. }
  439. // Did the user specify a course which already exists? If so,
  440. // mark that course's ID as -12345...
  441. $res = db_query("UPDATE draft_courses
  442. SET course_id = '-12345'
  443. WHERE subject_id = '?'
  444. AND course_num = '?'
  445. AND catalog_year = '?' ", $subject_id, $course_num, $de_catalog_year);
  446. // We now have enough information to make an insertion into
  447. // the table.
  448. $query = "INSERT INTO draft_courses
  449. (`course_id`,`subject_id`,`course_num`,`catalog_year`,
  450. `title`,`description`,`min_hours`,`max_hours`,`repeat_hours`,
  451. `exclude`,`data_entry_comment`)
  452. values ('?','?','?','?','?','?','?','?','?','?','?') ";
  453. //debug_c_t($query);
  454. $res = db_query($query, $course_id,$subject_id,$course_num,$de_catalog_year,
  455. $title,$description,$min_hours,$max_hours,$repeat_hours,
  456. $exclude,$data_entry_comment);
  457. // Now, this part is tricky. Are there any courses which already
  458. // existed with this subject_id and course_num, but not this course_id?
  459. // This would happen if we add an eqv for a course that already existed
  460. // elsewhere. We want to change that existing course's ID to match the
  461. // new one, but we also need to update EVERY table that used the old
  462. // course_id with the new course_id, including degree plans, groups,
  463. // substitutions, etc.
  464. // query for subject_id and course_num but != course_id.
  465. // get oldCourseID.
  466. // call function update_course_id(oldCourseID, newCourseID)
  467. $res2 = db_query("SELECT * FROM draft_courses WHERE
  468. subject_id = '?'
  469. AND course_num = '?'
  470. AND course_id != '?'
  471. AND course_id != '-12345' ", $subject_id, $course_num, $course_id);
  472. while ($cur2 = db_fetch_array($res2)) {
  473. $old_course_id = $cur2["course_id"];
  474. // Now, update all the existing references to $old_course_id
  475. // with the new course_id.
  476. $db2 = new DatabaseHandler();
  477. $db2->update_course_id($old_course_id, $course_id, true);
  478. // Now, add it to our list of things to update when we apply
  479. // the draft changes...
  480. $db2->add_draft_instruction("update_course_id,$old_course_id,$course_id");
  481. }
  482. }
  483. // We have to accomodate the situation that there used to be an
  484. // eqv set up (multiple course names were set) but now there is not.
  485. // In other words, someone wanted to undo an eqv.
  486. // We used to have: ACCT 101, MATH 101
  487. // But they took out the comma. So, only ACCT 101 just got written
  488. // to the database, while MATH 101 has been marked as -12345 and is
  489. // destined to be deleted.
  490. // -- we need to give MATH 101 a new course_id and update that course_id
  491. // for all years.
  492. // Then, we need to go through all our tables and update where it was
  493. // actually spelled out that "MATH 101" be used with the new course_id.
  494. // -- This process will ensure that no previous existing courses
  495. // will get deleted. That they will remain as their own unique
  496. // courses.
  497. // First thing's first. Go through all the courses with the course_id
  498. // of -12345. If we find one that does not have the same subject_id
  499. // and course_num with the new ID, then this is a removed eqv, and
  500. // that is our cue that it should be it's own course.
  501. $res = db_query("SELECT * FROM draft_courses
  502. WHERE course_id = '-12345' ");
  503. while ($cur = db_fetch_array($res)) {
  504. $found_s_i = $cur["subject_id"];
  505. $found_c_n = $cur["course_num"];
  506. $db2 = new DatabaseHandler();
  507. $res2 = $db2->db_query("SELECT * FROM draft_courses
  508. WHERE course_id = '?'
  509. AND subject_id = '?'
  510. AND course_num = '?'
  511. AND catalog_year = '?' ", $course_id, $found_s_i, $found_c_n, $de_catalog_year);
  512. if ($db2->db_num_rows($res2) == 0) {
  513. // Meaning, this course name is not listed with the course_id,
  514. // so this is a broken eqv.
  515. // We should make a new course_id and all that for this course,
  516. // for all available years.
  517. $new_course_id = $db2->request_new_course_id();
  518. $db3 = new DatabaseHandler();
  519. $res3 = $db3->db_query("UPDATE draft_courses
  520. SET course_id = '?'
  521. WHERE subject_id = '?'
  522. AND course_num = '?' ", $new_course_id, $found_s_i, $found_c_n);
  523. // removed WHERE `course_id`='-12345' from query. We want to UPDATE
  524. // this across all years for this course.
  525. // And also UPDATE every other table that specified foundSI &CN
  526. // as a requirement.
  527. $db3->update_course_requirement_from_name($found_s_i, $found_c_n, $new_course_id);
  528. $db3->add_draft_instruction("update_course_requirement_from_name,$found_s_i,$found_c_n,$new_course_id");
  529. }
  530. }
  531. // Was the "all_years" box checked? If it was, then update all instances
  532. // of this course, across all available catalog years.
  533. if (is_array($values["all_years"]) && $values["all_years"]["yes"] == "yes") {
  534. $res = db_query("UPDATE draft_courses
  535. SET title = '?',
  536. description = '?',
  537. min_hours = '?',
  538. max_hours = '?',
  539. repeat_hours = '?'
  540. WHERE course_id = '?' ", $title, $description, $min_hours, $max_hours, $repeat_hours, $course_id);
  541. }
  542. // Clean up. Delete the temporary course_id...
  543. $res = db_query("DELETE FROM draft_courses WHERE course_id = '-12345' ");
  544. fp_add_message("Course updated successfully.");
  545. }

Functions

Namesort descending Description
admin_display_courses This function displays all of our courses for us to edit.
admin_edit_course_form This form lets the user edit details about a course.
admin_edit_course_form_submit