advise.history.inc

  1. 7.x modules/advise/advise.history.inc
  2. 6.x modules/advise/advise.history.inc
  3. 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']) . "</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']) . "
  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. fp_set_standard_advising_breadcrumbs();
  281. watchdog("advise", "display_history $current_student_id", array(), WATCHDOG_DEBUG);
  282. return $rtn;
  283. }
  284. /**
  285. * Displays the printable advising summary.
  286. *
  287. * If the advising_session_id is null, it gets that value from the REQUEST. Otherwise, we expect it to be a csv of the
  288. * sessions we are interested in.
  289. *
  290. * If bool_html is set to FALSE, then we will return results in plain text, suitable for email.
  291. * if bool_minimal_text is set to TRUE, then we will return a reduced amount of text.
  292. *
  293. */
  294. function advise_popup_display_summary($advising_session_id = NULL, $bool_html = TRUE, $bool_show_as_group = FALSE, $bool_minimal_text = TRUE) {
  295. $rtn = "";
  296. $txt = "";
  297. $term = '';
  298. fp_add_css(fp_get_module_path("advise") . "/css/advise.css");
  299. $db = get_global_database_handler();
  300. if ($advising_session_id == NULL) {
  301. $advising_session_id = rtrim(fp_trim(@$_REQUEST["advising_session_id"]), ",");
  302. }
  303. if (@$_REQUEST['show_as_group'] === 'yes') {
  304. $bool_show_as_group = TRUE;
  305. }
  306. $bool_multiple = FALSE;
  307. $bool_show_transaction_details = TRUE;
  308. $terms = $student_id = "";
  309. // 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
  310. // them all.
  311. if (!strstr($advising_session_id, ",")) {
  312. $res = db_query("SELECT * FROM advising_sessions
  313. WHERE advising_session_id = ? ", $advising_session_id);
  314. }
  315. else {
  316. $bool_multiple = TRUE;
  317. $session_array = csv_to_array($advising_session_id);
  318. $where = "";
  319. foreach ($session_array as $sid) {
  320. $where .= " advising_session_id = ? OR";
  321. }
  322. $where = rtrim($where, "OR");
  323. $res = db_query("SELECT * FROM advising_sessions
  324. WHERE $where
  325. ORDER BY `posted` DESC ", $session_array);
  326. }
  327. while ($cur = db_fetch_array($res)) {
  328. $dt = format_date(convert_time($cur['posted']), "pretty");
  329. $degree_title_line = "";
  330. $ds = "";
  331. $degree_plan = new DegreePlan();
  332. if ($cur['degree_id'] != DegreePlan::DEGREE_ID_FOR_COMBINED_DEGREE) {
  333. $degree_plan->degree_id = $cur['degree_id'];
  334. $degree_plan->load_descriptive_data();
  335. $degree_title_line = $degree_plan->get_title(true);
  336. }
  337. else {
  338. // This is a set of combined degrees. We need to load all of the
  339. // degrees in the major_code_csv to get their titles.
  340. $temp = explode(",", $cur['major_code_csv']);
  341. $ds = "s";
  342. foreach ($temp as $major_code) {
  343. if ($major_code == "") continue;
  344. $dp = $db->get_degree_plan($major_code, $cur['catalog_year']);
  345. if ($dp != null) {
  346. $degree_title_line .= $dp->get_title2(TRUE, TRUE) . ", ";
  347. }
  348. }
  349. $degree_title_line = rtrim($degree_title_line, ", ");
  350. }
  351. $student = new Student($cur['student_id'], $db);
  352. $student_id = $cur['student_id'];
  353. $school_id = db_get_school_id_for_student_id($student_id);
  354. $term = get_term_description($cur['term_id'], FALSE, $school_id);
  355. $terms .= "<div class='summary-term-desc-multi'>$term</div>";
  356. $what_if_message = "";
  357. if (intval($cur['is_whatif']) == 1) {
  358. $official_degree_title = "";
  359. $odsverb = " is";
  360. $c = 0;
  361. $majors = $db->get_student_majors_from_db($student->student_id);
  362. foreach ($majors as $major_code) {
  363. if ($major_code == "") continue;
  364. $dp = $db->get_degree_plan($major_code, $cur['catalog_year']);
  365. if ($dp != null) {
  366. $c++;
  367. $official_degree_title .= $dp->get_title2(TRUE, TRUE) . ", ";
  368. }
  369. }
  370. if ($c > 1) $odsverb = "s are";
  371. $official_degree_title = rtrim($official_degree_title, ", ");
  372. $what_if_message = "<b>" . t("Note:") . "</b>
  373. " . t("This advising was saved using <b>What If</b> mode
  374. for the degree$ds %degree_title. According to @initials records,
  375. the student's official degree$odsverb %official.", array("%degree_title" => $degree_title_line,
  376. "@initials" => variable_get_for_school("school_initials", "DEMO", $school_id),
  377. "%official" => $official_degree_title));
  378. }
  379. if (!$bool_minimal_text) {
  380. $txt .= "\n----- " . t("Advising Summary for") . " $term -----\n";
  381. $txt .= t("Student:") . " " . $db->get_student_name($cur['student_id'], false) . " ({$cur['student_id']}) \n";
  382. $txt .= t("Advisor:") . " " . fp_get_faculty_name($cur['faculty_id']) . "\n";
  383. $txt .= t("Term:") . " " . $term . "\n";
  384. }
  385. $rtn .= "<table class='adv-history-table' width='100%'><td valign='top'>";
  386. if ($bool_show_transaction_details) {
  387. $rtn .= "
  388. <table class=' summary-transaction-details' border='0' width='100%' cellpadding='3' cellspacing='0'>
  389. <tr height='7'>
  390. <td> </td>
  391. </tr>
  392. <tr>
  393. <td valign='top' width='15%'>" . t("Student:") . "</td>
  394. <td valign='top' width='40%'>" . $db->get_student_name($cur['student_id'], false) . " ({$cur['student_id']})</td>
  395. <td valign='top' rowspan='3'>
  396. <table width='100%' cellpadding='0' cellspacing='0'>
  397. <tr height='20'>
  398. <td width='100%' id='student-signature-line' valign='bottom'><hr noshade size='1' width='100%' color='black' style='margin: 0px;'></td>
  399. </tr>
  400. <tr height='20'>
  401. <td width='100%' id='student-signature-caption' valign='top' align='right'><span style='font-size: 8pt;'>" . t("Student signature") . "</span></td>
  402. </tr>
  403. <tr height='20'>
  404. <td width='100%' id='advisor-signature-line' valign='bottom'><hr noshade size='1' width='100%' color='black' style='margin: 0px;'></td>
  405. </tr>
  406. <tr>
  407. <td width='100%' id='advisor-signature-caption'valign='bottom' align='right'><span style='font-size: 8pt;'>" . t("Advisor signature") . "</span></td>
  408. </tr>
  409. <tr height='7'>
  410. <td> </td>
  411. </tr>
  412. </table>
  413. </td>
  414. </tr>
  415. <tr>
  416. <td valign='top' width='10%'>" . t("Advisor:") . "</td>
  417. <td valign='top'>" . fp_get_faculty_name($cur['faculty_id']) . "</td>
  418. </tr>
  419. <tr>
  420. <td valign='top'>" . t("Term(s):") . "</td>";
  421. $term_disp = $term;
  422. if ($bool_multiple && $bool_show_as_group) {
  423. $term_disp = "<!--group_terms-->";
  424. }
  425. $rtn .= "
  426. <td valign='top'>$term_disp</td>
  427. </tr>
  428. <tr>
  429. <td valign='top' colspan='2' id='summary-alternate-term'>
  430. " . t("Alternate Term(s):") . " ____________________________
  431. </td>
  432. </tr>
  433. <tr>
  434. <td valign='top' colspan='4'>
  435. ";
  436. if ($degree_title_line != "")
  437. {
  438. $rtn .= t("Degree$ds:") . " $degree_title_line";
  439. if (!$bool_minimal_text) {
  440. $txt .= "Degree$ds: " . $degree_title_line . "\n";
  441. }
  442. }
  443. $rtn .= "
  444. </tr>
  445. </table>
  446. <div class=' '><i>" . t("Submitted on") . " $dt.</i></div>
  447. <div class=' '>$what_if_message</div>
  448. <br>
  449. ";
  450. if ($bool_show_as_group) {
  451. $bool_show_transaction_details = FALSE;
  452. }
  453. } // bool_first_time_through
  454. if (!$bool_minimal_text) {
  455. $txt .= t("Submitted on") . " $dt \n";
  456. if ($what_if_message) {
  457. $txt .= " " . fp_reduce_whitespace(strip_tags($what_if_message)) . "\n";
  458. }
  459. }
  460. $rtn .= fp_render_section_title(t("Advised Courses for @term", array("@term" => $term)));
  461. if (!$bool_minimal_text) {
  462. $txt .= "\n" . t("Advised Courses:") . "\n";
  463. }
  464. else {
  465. $txt .= "" . t("Advised Courses for @term", array("@term" => $term)) . "\n";
  466. }
  467. $fp = new FlightPath($student,$degree_plan, $db);
  468. $fp->load_advising_session_from_database("","",false,false,$cur['advising_session_id']);
  469. $rtn .= "<table border='0' cellpadding='3' class='summary-advised-courses'>
  470. <tr>
  471. <td class=' course-si-cn' valign='top' width='25%'>
  472. <b>" . t("Course") . "</b>
  473. </td>
  474. <td class=' course-title' valign='top' width='70%'>
  475. <b>" . t("Title") . "</b>
  476. </td>
  477. <td class=' course-hours' valign='top'>
  478. <b>" . t("Hours") . "</b>
  479. </td>
  480. </tr>";
  481. // Get a courseList of all the courses which are set as advised to take.
  482. $advised_courses_list = $fp->course_list_advised_courses;
  483. $advised_courses_list->load_course_descriptive_data();
  484. $advised_courses_list->sort_alphabetical_order();
  485. $advised_courses_list->reset_counter();
  486. while ($advised_courses_list->has_more()) {
  487. $course = $advised_courses_list->get_next();
  488. // set the catalogYear from the term_id.
  489. $course->term_id = $cur['term_id'];
  490. $course->set_catalog_year_from_term_id();
  491. $course->load_descriptive_data(false);
  492. $rtn .= "<tr>
  493. <td class=' course-si-cn' valign='top'>
  494. $course->subject_id $course->course_num
  495. </td>
  496. <td class=' course-title' valign='top'>
  497. $course->title
  498. </td>
  499. <td class=' course-hours' valign='top' align='center'>
  500. " . $course->get_hours() . "
  501. </td>
  502. </tr>
  503. ";
  504. $txt .= " $course->subject_id $course->course_num - $course->title - " . $course->get_hours() . "hrs \n";
  505. }
  506. $rtn .= "</table>
  507. <div align='right' class=' total-advised-hours' style='padding-top: 10px; padding-right: 15px;'>
  508. <b>" . t("Total advised hours:") . " &nbsp; " . $advised_courses_list->count_hours() . "</b>
  509. </div>
  510. ";
  511. $txt .= "Total advised hours: " . $advised_courses_list->count_hours() . "\n\n\n";
  512. $rtn .= "</table>";
  513. if ($bool_show_transaction_details && $bool_multiple) {
  514. $rtn .= "<div class='history-summary-divider'>&nbsp;</div>";
  515. }
  516. } // while, for the query itself!
  517. $rtn .= "<br>";
  518. $rtn .= "<div class='summary-alternate-courses'>";
  519. $rtn .= fp_render_section_title(t("Alternate Courses"));
  520. $rtn .= "<div class=' alt-courses-desc-and-lines'>
  521. " . t("You may use this space to write in alternate courses
  522. the student should enroll in, in the event that an
  523. advised course is full or unavailable.") . "
  524. <br><br>
  525. ___________________________________________________________________ <br><br>
  526. ___________________________________________________________________
  527. </div> ";
  528. $rtn .= "</div>";
  529. if ($bool_multiple && $bool_show_as_group) {
  530. $rtn = str_replace("<!--group_terms-->", $terms, $rtn);;
  531. }
  532. // Are we NOT returning html?
  533. if (!$bool_html) {
  534. return $txt;
  535. }
  536. fp_set_title($db->get_student_name($student_id, FALSE) . " ($student_id) $term " . t("Advising Summary"));
  537. watchdog("advise", "popup_display_summary advising_session_id:$advising_session_id", array(), WATCHDOG_DEBUG);
  538. return $rtn;
  539. }

Functions

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