advise.history.inc

  1. 6.x modules/advise/advise.history.inc
  2. 7.x modules/advise/advise.history.inc
  3. 4.x modules/advise/advise.history.inc
  4. 5.x modules/advise/advise.history.inc

File

modules/advise/advise.history.inc
View source
  1. <?php
  2. /*
  3. * This file is responsible for the contents / functionality of the History tab.
  4. */
  5. /**
  6. * Displays the history tab on screen.
  7. */
  8. function advise_display_history() {
  9. global $current_student_id, $user;
  10. $student_id = $current_student_id;
  11. $db = get_global_database_handler();
  12. $school_id = db_get_school_id_for_student_id($student_id);
  13. fp_set_title('');
  14. $extra_style = $ast = "";
  15. $rtn = "";
  16. fp_add_css(fp_get_module_path("advise") . "/css/advise.css");
  17. fp_add_js(fp_get_module_path("advise") . "/js/advise.js");
  18. $rtn .= "<table class='fp-semester-table'>";
  19. // If coming here from a save, display info here.
  20. if (@$_REQUEST["adv_id_array_serialized"] != "") {
  21. $acount = 0;
  22. $click_links = "";
  23. $advising_session_id_array = unserialize($_REQUEST["adv_id_array_serialized"]);
  24. foreach($advising_session_id_array as $term_id=>$value) {
  25. $term_id = (string) $term_id; // Make sure term_id is a standard string
  26. $aid = $advising_session_id_array[$term_id];
  27. if ($aid != "")
  28. {
  29. $term_name = get_term_description($term_id, FALSE, $school_id);
  30. $turl = fp_url("advise/popup-display-summary", "advising_session_id=$aid");
  31. $click_links .= "<li class='just-saved-summary'>
  32. <a href='javascript: popupLargeIframeDialog(\"" . $turl . "\",\"" . t("Advising Session @term", array("@term" => $term_name)) . "\",\"\");'>
  33. <i class='fa fa-window-restore'></i> $term_name
  34. </a>
  35. </li>";
  36. $acount++;
  37. }
  38. }
  39. $group_link = "";
  40. if ($acount > 1) {
  41. $turl = fp_url("advise/popup-display-summary", "show_as_group=yes&advising_session_id=" . join(",", $advising_session_id_array));
  42. $on_click = "popupLargeIframeDialog(\"" . $turl . "\",\"" . t("Advising Sessions") . "\",\"\");";
  43. $group_link = "<a href='javascript:$on_click' class='advising-summary-group-link'><i class='fa fa-list-ul'></i> " . t("View Combined") . "</a>";
  44. }
  45. $acount = 0;
  46. $rtn .= "
  47. <tr>
  48. <td colspan='2' width='100%'>
  49. <div class='hypo'
  50. align='left' style='border: 1px solid black;
  51. margin: 10px 0px 10px 0px; padding: 10px;
  52. font-size: 12pt; font-weight: bold;'>
  53. " . t("You have successfully advised") . " " . $db->get_student_name($student_id) . " ($student_id).
  54. <br>" . t("Click to view a pop-up printable summary for:") . "
  55. <ul style='margin-top: 5px; margin-bottom: 5px;'>
  56. $click_links
  57. </ul>$group_link</div>
  58. </td>
  59. </tr>
  60. ";
  61. }
  62. $group_link = "";
  63. $rtn .= "<tr><td width='50%' valign='top' class='left-side' style='padding-right: 10px;'>
  64. ";
  65. ///////////////////////////////////////////////////
  66. //////////////////////////////////////////////////
  67. ///////// Advising History
  68. ///////////////////////////////////////////////////
  69. $rtn .= fp_render_section_title(t("Advising History"));
  70. $render_left = array(); // creating a new render array.
  71. $render_left["#id"] = "advise_history_left_column";
  72. $render_left["#student_id"] = $student_id;
  73. $school_id = db_get_school_id_for_student_id($student_id);
  74. $old_session_d_t = 0;
  75. $last_session_id = 0;
  76. $a_count = 0;
  77. $c = 0;
  78. $is_empty = TRUE;
  79. $first_style = "color: maroon; font-weight:bold;";
  80. $advising_session_id_array = array();
  81. $on_mouse_over = "
  82. onmouseover='$(this).addClass(\"selection_highlight\");'
  83. onmouseout='$(this).removeClass(\"selection_highlight\");'
  84. ";
  85. $advising_session_groups_array = array();
  86. $previous_sessions = array();
  87. $session_group_code = $old_session_group_code = "";
  88. // First, find all of the advising session "groups". That is, advising sessions over multiple
  89. // terms which were submitted together.
  90. $res = db_query("SELECT * FROM advising_sessions
  91. WHERE student_id = ?
  92. AND is_draft = 0
  93. AND is_empty = 0
  94. AND delete_flag = 0
  95. GROUP BY advising_session_token
  96. ORDER BY `posted` DESC
  97. ", $student_id);
  98. while($cur = db_fetch_array($res)) {
  99. $html = "";
  100. $is_empty = FALSE;
  101. $advtoken = $cur['advising_session_token'];
  102. $bool_is_empty = FALSE;
  103. $faculty_id = $cur['faculty_id'];
  104. $dt = date("m/d/Y g:ia",convert_time($cur['posted']));
  105. $group_link ="";
  106. // If this has more than one session for this token, then show a group_link
  107. $sessions_arr = advise_get_advising_sessions_for_advising_token($advtoken);
  108. if ($sessions_arr && count($sessions_arr) > 1) {
  109. $turl = fp_url("advise/popup-display-summary", "show_as_group=yes&advising_session_id=" . join(",",$sessions_arr));
  110. $on_click = "popupLargeIframeDialog(\"" . $turl . "\",\"" . t("Advising Sessions - @date", array("@date" => $dt)) . "\",\"\");";
  111. $group_link = "<a href='javascript:$on_click' class='advising-summary-group-link'><i class='fa fa-list-ul'></i> " . t("View Combined") . "</a>";
  112. }
  113. $advised_by = "<div class='history-advised-row history-advised-row-$a_count'>
  114. <strong>" . t("Advised by") . " " . fp_get_faculty_name($cur['faculty_id'], FALSE) . "</strong>$group_link
  115. </div>";
  116. $html .= "<div class=''>$advised_by</div>";
  117. $a_count++;
  118. if ($a_count > 1) {
  119. $first_style = "";
  120. }
  121. $res2 = db_query("SELECT * FROM advising_sessions
  122. WHERE advising_session_token = ?
  123. AND is_empty = 0
  124. AND delete_flag = 0
  125. ORDER BY term_id DESC", array($advtoken));
  126. while ($cur2 = db_fetch_array($res2)) {
  127. // Are we supposed to "delete" an advising session? We will double-check the user has all needed permissions if so.
  128. if (intval(@$_GET['deladv']) === intval($cur2['advising_session_id'])) {
  129. if (user_has_permission('can_advise_students') && user_has_permission('can_delete_own_advising_session_3_months') && $cur2['faculty_id'] == $user->cwid) {
  130. $del_range = strtotime("now -3 months");
  131. $then = intval($cur2["posted"]);
  132. if ($then > $del_range) {
  133. db_query("UPDATE advising_sessions
  134. SET delete_flag = 1
  135. WHERE advising_session_id = ?", array($cur2['advising_session_id']));
  136. fp_add_message(t("Advising session has been successfully deleted."));
  137. fp_goto("history", "current_student_id=$current_student_id");
  138. die; // redirect from fp_goto above anyway.
  139. }
  140. }
  141. } // if we are trying to delete
  142. $turl = fp_url("advise/popup-display-summary", "advising_session_id={$cur2['advising_session_id']}");
  143. $advising_session_id_array[] = $cur2['advising_session_id'];
  144. $term = get_term_description($cur2['term_id'], FALSE, $school_id);
  145. $on_click = "popupLargeIframeDialog(\"" . $turl . "\",\"" . t("Advising Session @term - @date", array("@term" => $term, "@date" => $dt)) . "\",\"\");";
  146. $delete_html = "";
  147. // Should we show the "delete" link?
  148. if (user_has_permission('can_advise_students') && user_has_permission('can_delete_own_advising_session_3_months') && $cur2['faculty_id'] == $user->cwid) {
  149. $del_range = strtotime("now -3 months");
  150. $then = intval($cur["posted"]);
  151. if ($then > $del_range) {
  152. $safe_term = $term;
  153. $safe_term = str_replace("'", "", $safe_term);
  154. $safe_term = str_replace('"', "", $safe_term);
  155. $safe_term = str_replace(';', "", $safe_term);
  156. $safe_term = str_replace('\\', "", $safe_term);
  157. $confirm_link = fp_get_js_confirm_link(t("Are you sure you wish to delete the advising session from @dt for @term? \\n\\nThis action cannot be undone.", array("@dt" => $dt, "@term" => $safe_term)),
  158. "window.location=\"" . fp_url("history", "current_student_id=$current_student_id&deladv=" . $cur2['advising_session_id']) . "\";", "<i class='fa fa-remove'></i>", "action-link-remove", t("Delete?"));
  159. $delete_html .= "<div class='delete-adv-wrapper'>
  160. $confirm_link
  161. </div>";
  162. }
  163. } // user had permission to delete
  164. $html .= "<div $on_mouse_over style='cursor: pointer; $first_style' class='advhist-row' onClick='$on_click'>
  165. <div class='advhist-term' style='display: inline-block; padding-left:20px; width:165px;'>$term</div>
  166. <div class='advhist-datetime' style='display: inline-block;'>$dt</div>
  167. </div>
  168. $delete_html";
  169. // If this is more than X number, let's hide the rest in a collapsible fieldset.
  170. if ($c < 5) {
  171. $render_left["advising_history_$c"] = array(
  172. "value" => $html,
  173. "weight" => $c,
  174. );
  175. }
  176. else {
  177. // Let's place in a collapsible fieldset!
  178. if (!isset($render_left["advising_history_fs"])) {
  179. $render_left["advising_history_fs"] = array(
  180. "type" => "cfieldset",
  181. "label" => t("Show complete advising history"),
  182. "start_closed" => TRUE,
  183. "elements" => array(),
  184. "weight" => $c,
  185. );
  186. }
  187. $render_left["advising_history_fs"]["elements"][] = array("advising_history_$c" => array(
  188. "value" => $html,
  189. ));
  190. }
  191. $html = "";
  192. $c++;
  193. } // while cur2
  194. } // while cur group by advising session token
  195. if ($is_empty == true) {
  196. //$rtn .= "<div class=' '>No advising history available.</div>";
  197. $render_left["markup_no_adv_history"] = array(
  198. "value" => t("No advising history available."),
  199. );
  200. }
  201. else {
  202. $print_all_url = fp_url("advise/popup-display-summary", "advising_session_id=" . join(",", $advising_session_id_array));
  203. $render_left["markup_print_all"] = array(
  204. "value" => "<a href='javascript: popupLargeIframeDialog(\"" . $print_all_url . "\",\"" . t("Complete Advising History") . "\",\"\");' class='view-print-all'>
  205. <i class='fa fa-window-restore'></i> " . t("View Complete History") . "
  206. </a>
  207. ",
  208. "weight" => -1,
  209. );
  210. }
  211. // Okay, we can render the left-hand side now.
  212. $rtn .= fp_render_content($render_left);
  213. //----------------------------------------------------------------------------------------
  214. //------------------------------ COMMENT HISTORY -----------------------------------------
  215. //----------------------------------------------------------------------------------------
  216. $rtn .= "</td><td width='50%' class='right-side' valign='top'>";
  217. $rtn .= fp_render_section_title(t("Comment History"));
  218. //$rtn .= "<table border='0' cellspacing='0'>";
  219. // Prepare a render array for the right-hand side.
  220. $render_right = array();
  221. $render_right["#id"] = "advise_history_right_column";
  222. $render_right["#student_id"] = $student_id;
  223. $html = "";
  224. $old_term_id = "";
  225. $first_style = "first";
  226. $is_empty = true;
  227. $has_admin_category = false;
  228. $access_line = "";
  229. //if (!user_has_permission("view_faculty_comments")) {
  230. // $access_line = "and `access_type`='public' ";
  231. //}
  232. $access_types = (user_has_permission("view_faculty_comments")) ? array("faculty", "public") : array("public");
  233. $turl = fp_url("comments/popup-display-all-comments");
  234. $html .= "<div class='advising-comments-header'>
  235. <!--STARTCOM--><div style='padding-top: 10px;'>
  236. <strong>" . t("Advising Comments") . "</strong>
  237. &nbsp;
  238. <a href='javascript: popupLargeIframeDialog(\"" . $turl . "\",\"" . t("All Comments for Student") . "\",\"\");' class='view-print-all'>
  239. <i class='fa fa-window-restore'></i> " . t("View All Comments") . "
  240. </a>
  241. </div><!--ENDCOM-->
  242. </div>";
  243. // Use the function comments_get_comments instead of a direct query.
  244. $res = comments_get_comments($student_id, FALSE, $access_types);
  245. foreach ($res as $cur)
  246. {
  247. $dt = format_date(convert_time($cur['posted']), 'custom', 'm/d/Y g:ia');
  248. if ($first_style == "first"){
  249. $first_style = "color: maroon; font-weight:bold;";
  250. }
  251. $turl = fp_url("comments/popup-display-comment", "id=" . $cur['id']);
  252. $on_click = "popupLargeIframeDialog(\"" . $turl . "\",\"" . t("Comment @date", array("@date" => $dt)) . "\",\"\");";
  253. $html .= "<div $on_mouse_over class='history-comment-row' style='cursor:pointer; $first_style $extra_style'
  254. onClick='$on_click'>
  255. <div class=' ' style='padding-left: 20px; width:165px; display:inline-block;'>
  256. " . fp_get_faculty_name($cur['faculty_id'], false) . "
  257. </div>
  258. <div class=' ' style='display: inline-block;'>
  259. $dt$ast
  260. </div>
  261. </div>";
  262. $is_empty = false;
  263. $first_style = "";
  264. }
  265. if ($is_empty == true) {
  266. $render_right["markup_no_comment_history"] = array(
  267. "value" => "<span class='no-comment-history-msg'>" . t("No comment history available.") . "</span>",
  268. );
  269. }
  270. $render_right["comment_history"] = array(
  271. "value" => "<span class='advising-comment-history-block'>" . $html . "</span>",
  272. "weight" => 0,
  273. );
  274. //$rtn .= "</table>";
  275. // Render our render array now...
  276. $rtn .= fp_render_content($render_right);
  277. $rtn .= "</td></tr>";
  278. $rtn .= "</table>";
  279. // Let's set our breadcrumbs
  280. $db = get_global_database_handler();
  281. $crumbs = array();
  282. $crumbs[] = array(
  283. 'text' => 'Students',
  284. 'path' => 'student-search',
  285. );
  286. $crumbs[] = array(
  287. 'text' => $db->get_student_name($current_student_id) . " ({$current_student_id})",
  288. 'path' => 'student-profile',
  289. 'query' => "current_student_id={$current_student_id}",
  290. );
  291. fp_set_breadcrumbs($crumbs);
  292. watchdog("advise", "display_history $current_student_id", array(), WATCHDOG_DEBUG);
  293. return $rtn;
  294. }
  295. /**
  296. * Displays the printable advising summary.
  297. *
  298. * If the advising_session_id is null, it gets that value from the REQUEST. Otherwise, we expect it to be a csv of the
  299. * sessions we are interested in.
  300. *
  301. * If bool_html is set to FALSE, then we will return results in plain text, suitable for email.
  302. * if bool_minimal_text is set to TRUE, then we will return a reduced amount of text.
  303. *
  304. */
  305. function advise_popup_display_summary($advising_session_id = NULL, $bool_html = TRUE, $bool_show_as_group = FALSE, $bool_minimal_text = TRUE) {
  306. $rtn = "";
  307. $txt = "";
  308. fp_add_css(fp_get_module_path("advise") . "/css/advise.css");
  309. $db = get_global_database_handler();
  310. if ($advising_session_id == NULL) {
  311. $advising_session_id = rtrim(trim($_REQUEST["advising_session_id"]), ",");
  312. }
  313. if (@$_REQUEST['show_as_group'] === 'yes') {
  314. $bool_show_as_group = TRUE;
  315. }
  316. $bool_multiple = FALSE;
  317. $bool_show_transaction_details = TRUE;
  318. $terms = $student_id = "";
  319. // If we have commas in our advising_session_id, it means we had more than one that were passed to us! We want to show
  320. // them all.
  321. if (!strstr($advising_session_id, ",")) {
  322. $res = db_query("SELECT * FROM advising_sessions
  323. WHERE advising_session_id = ? ", $advising_session_id);
  324. }
  325. else {
  326. $bool_multiple = TRUE;
  327. $session_array = csv_to_array($advising_session_id);
  328. $where = "";
  329. foreach ($session_array as $sid) {
  330. $where .= " advising_session_id = ? OR";
  331. }
  332. $where = rtrim($where, "OR");
  333. $res = db_query("SELECT * FROM advising_sessions
  334. WHERE $where
  335. ORDER BY `posted` DESC ", $session_array);
  336. }
  337. while ($cur = db_fetch_array($res)) {
  338. $dt = format_date(convert_time($cur['posted']), "pretty");
  339. $degree_title_line = "";
  340. $ds = "";
  341. $degree_plan = new DegreePlan();
  342. if ($cur['degree_id'] != DegreePlan::DEGREE_ID_FOR_COMBINED_DEGREE) {
  343. $degree_plan->degree_id = $cur['degree_id'];
  344. $degree_plan->load_descriptive_data();
  345. $degree_title_line = $degree_plan->get_title(true);
  346. }
  347. else {
  348. // This is a set of combined degrees. We need to load all of the
  349. // degrees in the major_code_csv to get their titles.
  350. $temp = explode(",", $cur['major_code_csv']);
  351. $ds = "s";
  352. foreach ($temp as $major_code) {
  353. if ($major_code == "") continue;
  354. $dp = $db->get_degree_plan($major_code, $cur['catalog_year']);
  355. if ($dp != null) {
  356. $degree_title_line .= $dp->get_title2(TRUE, TRUE) . ", ";
  357. }
  358. }
  359. $degree_title_line = rtrim($degree_title_line, ", ");
  360. }
  361. $student = new Student($cur['student_id'], $db);
  362. $student_id = $cur['student_id'];
  363. $school_id = db_get_school_id_for_student_id($student_id);
  364. $term = get_term_description($cur['term_id'], FALSE, $school_id);
  365. $terms .= "<div class='summary-term-desc-multi'>$term</div>";
  366. $what_if_message = "";
  367. if (intval($cur['is_whatif']) == 1) {
  368. $official_degree_title = "";
  369. $odsverb = " is";
  370. $c = 0;
  371. $majors = $db->get_student_majors_from_db($student->student_id);
  372. foreach ($majors as $major_code) {
  373. if ($major_code == "") continue;
  374. $dp = $db->get_degree_plan($major_code, $cur['catalog_year']);
  375. if ($dp != null) {
  376. $c++;
  377. $official_degree_title .= $dp->get_title2(TRUE, TRUE) . ", ";
  378. }
  379. }
  380. if ($c > 1) $odsverb = "s are";
  381. $official_degree_title = rtrim($official_degree_title, ", ");
  382. $what_if_message = "<b>" . t("Note:") . "</b>
  383. " . t("This advising was saved using <b>What If</b> mode
  384. for the degree$ds %degree_title. According to @initials records,
  385. the student's official degree$odsverb %official.", array("%degree_title" => $degree_title_line,
  386. "@initials" => variable_get_for_school("school_initials", "DEMO", $school_id),
  387. "%official" => $official_degree_title));
  388. }
  389. if (!$bool_minimal_text) {
  390. $txt .= "\n----- " . t("Advising Summary for") . " $term -----\n";
  391. $txt .= t("Student:") . " " . $db->get_student_name($cur['student_id'], false) . " ({$cur['student_id']}) \n";
  392. $txt .= t("Advisor:") . " " . fp_get_faculty_name($cur['faculty_id'], false) . "\n";
  393. $txt .= t("Term:") . " " . $term . "\n";
  394. }
  395. $rtn .= "<table class='adv-history-table' width='100%'><td valign='top'>";
  396. if ($bool_show_transaction_details) {
  397. $rtn .= "
  398. <table class=' summary-transaction-details' border='0' width='100%' cellpadding='3' cellspacing='0'>
  399. <tr height='7'>
  400. <td> </td>
  401. </tr>
  402. <tr>
  403. <td valign='top' width='15%'>" . t("Student:") . "</td>
  404. <td valign='top' width='40%'>" . $db->get_student_name($cur['student_id'], false) . " ({$cur['student_id']})</td>
  405. <td valign='top' rowspan='3'>
  406. <table width='100%' cellpadding='0' cellspacing='0'>
  407. <tr height='20'>
  408. <td width='100%' id='student-signature-line' valign='bottom'><hr noshade size='1' width='100%' color='black' style='margin: 0px;'></td>
  409. </tr>
  410. <tr height='20'>
  411. <td width='100%' id='student-signature-caption' valign='top' align='right'><span style='font-size: 8pt;'>" . t("Student signature") . "</span></td>
  412. </tr>
  413. <tr height='20'>
  414. <td width='100%' id='advisor-signature-line' valign='bottom'><hr noshade size='1' width='100%' color='black' style='margin: 0px;'></td>
  415. </tr>
  416. <tr>
  417. <td width='100%' id='advisor-signature-caption'valign='bottom' align='right'><span style='font-size: 8pt;'>" . t("Advisor signature") . "</span></td>
  418. </tr>
  419. <tr height='7'>
  420. <td> </td>
  421. </tr>
  422. </table>
  423. </td>
  424. </tr>
  425. <tr>
  426. <td valign='top' width='10%'>" . t("Advisor:") . "</td>
  427. <td valign='top'>" . fp_get_faculty_name($cur['faculty_id'], false) . "</td>
  428. </tr>
  429. <tr>
  430. <td valign='top'>" . t("Term(s):") . "</td>";
  431. $term_disp = $term;
  432. if ($bool_multiple && $bool_show_as_group) {
  433. $term_disp = "<!--group_terms-->";
  434. }
  435. $rtn .= "
  436. <td valign='top'>$term_disp</td>
  437. </tr>
  438. <tr>
  439. <td valign='top' colspan='2' id='summary-alternate-term'>
  440. " . t("Alternate Term(s):") . " ____________________________
  441. </td>
  442. </tr>
  443. <tr>
  444. <td valign='top' colspan='4'>
  445. ";
  446. if ($degree_title_line != "")
  447. {
  448. $rtn .= t("Degree$ds:") . " $degree_title_line";
  449. if (!$bool_minimal_text) {
  450. $txt .= "Degree$ds: " . $degree_title_line . "\n";
  451. }
  452. }
  453. $rtn .= "
  454. </tr>
  455. </table>
  456. <div class=' '><i>" . t("Submitted on") . " $dt.</i></div>
  457. <div class=' '>$what_if_message</div>
  458. <br>
  459. ";
  460. if ($bool_show_as_group) {
  461. $bool_show_transaction_details = FALSE;
  462. }
  463. } // bool_first_time_through
  464. if (!$bool_minimal_text) {
  465. $txt .= t("Submitted on") . " $dt \n";
  466. if ($what_if_message) {
  467. $txt .= " " . fp_reduce_whitespace(strip_tags($what_if_message)) . "\n";
  468. }
  469. }
  470. $rtn .= fp_render_section_title(t("Advised Courses for @term", array("@term" => $term)));
  471. if (!$bool_minimal_text) {
  472. $txt .= "\n" . t("Advised Courses:") . "\n";
  473. }
  474. else {
  475. $txt .= "" . t("Advised Courses for @term", array("@term" => $term)) . "\n";
  476. }
  477. $fp = new FlightPath($student,$degree_plan, $db);
  478. $fp->load_advising_session_from_database("","",false,false,$cur['advising_session_id']);
  479. $rtn .= "<table border='0' cellpadding='3' class='summary-advised-courses'>
  480. <tr>
  481. <td class=' course-si-cn' valign='top' width='25%'>
  482. <b>" . t("Course") . "</b>
  483. </td>
  484. <td class=' course-title' valign='top' width='70%'>
  485. <b>" . t("Title") . "</b>
  486. </td>
  487. <td class=' course-hours' valign='top'>
  488. <b>" . t("Hours") . "</b>
  489. </td>
  490. </tr>";
  491. // Get a courseList of all the courses which are set as advised to take.
  492. $advised_courses_list = $fp->course_list_advised_courses;
  493. $advised_courses_list->load_course_descriptive_data();
  494. $advised_courses_list->sort_alphabetical_order();
  495. $advised_courses_list->reset_counter();
  496. while ($advised_courses_list->has_more()) {
  497. $course = $advised_courses_list->get_next();
  498. // set the catalogYear from the term_id.
  499. $course->term_id = $cur['term_id'];
  500. $course->set_catalog_year_from_term_id();
  501. $course->load_descriptive_data(false);
  502. $rtn .= "<tr>
  503. <td class=' course-si-cn' valign='top'>
  504. $course->subject_id $course->course_num
  505. </td>
  506. <td class=' course-title' valign='top'>
  507. $course->title
  508. </td>
  509. <td class=' course-hours' valign='top' align='center'>
  510. " . $course->get_hours() . "
  511. </td>
  512. </tr>
  513. ";
  514. $txt .= " $course->subject_id $course->course_num - $course->title - " . $course->get_hours() . "hrs \n";
  515. }
  516. $rtn .= "</table>
  517. <div align='right' class=' total-advised-hours' style='padding-top: 10px; padding-right: 15px;'>
  518. <b>" . t("Total advised hours:") . " &nbsp; " . $advised_courses_list->count_hours() . "</b>
  519. </div>
  520. ";
  521. $txt .= "Total advised hours: " . $advised_courses_list->count_hours() . "\n\n\n";
  522. $rtn .= "</table>";
  523. if ($bool_show_transaction_details && $bool_multiple) {
  524. $rtn .= "<div class='history-summary-divider'>&nbsp;</div>";
  525. }
  526. } // while, for the query itself!
  527. $rtn .= "<br>";
  528. $rtn .= "<div class='summary-alternate-courses'>";
  529. $rtn .= fp_render_section_title(t("Alternate Courses"));
  530. $rtn .= "<div class=' alt-courses-desc-and-lines'>
  531. " . t("You may use this space to write in alternate courses
  532. the student should enroll in, in the event that an
  533. advised course is full or unavailable.") . "
  534. <br><br>
  535. ___________________________________________________________________ <br><br>
  536. ___________________________________________________________________
  537. </div> ";
  538. $rtn .= "</div>";
  539. if ($bool_multiple && $bool_show_as_group) {
  540. $rtn = str_replace("<!--group_terms-->", $terms, $rtn);;
  541. }
  542. // Are we NOT returning html?
  543. if (!$bool_html) {
  544. return $txt;
  545. }
  546. fp_set_title($db->get_student_name($student_id, FALSE) . " ($student_id) $term " . t("Advising Summary"));
  547. watchdog("advise", "popup_display_summary advising_session_id:$advising_session_id", array(), WATCHDOG_DEBUG);
  548. return $rtn;
  549. }

Functions

Namesort descending Description
advise_display_history Displays the history tab on screen.
advise_popup_display_summary Displays the printable advising summary.