function student_search_display_my_advisees

7.x student_search.module student_search_display_my_advisees($bool_only_return_adv_array = FALSE, $use_cwid = NULL, $force_school_id = NULL, $limit = 20)
6.x student_search.module student_search_display_my_advisees($bool_only_return_adv_array = FALSE, $use_cwid = NULL, $force_school_id = NULL, $limit = 20)
4.x student_search.module student_search_display_my_advisees()
5.x student_search.module student_search_display_my_advisees()

Displays this user's advisees, if there are any assigned.

File

modules/student_search/student_search.module, line 220

Code

function student_search_display_my_advisees() {
  global $user;
  $rtn = "";

  $rtn .= student_search_get_advanced_search_tips();

  $_SESSION ["student_search_last_tab"] = "my-advisees";

  $faculty_cwid = $user->cwid;


  $query = "SELECT u.user_id, f_name, u.cwid, l_name, major_code, rank_code, a.catalog_year
              FROM users u, students a, advisor_student c, student_degrees d
              WHERE 
                 c.faculty_id = :faculty_cwid
                 AND c.student_id = a.cwid
                 AND c.student_id = d.student_id
                 AND u.cwid = a.cwid
                 AND u.is_student = 1
                 AND u.is_disabled = 0                 
              AND rank_code IN %RANKIN%
              %EXTRA_STUDENTSEARCH_CONDITIONS%
              GROUP BY u.cwid
              ORDER BY %ORDERBY%
              
              ";

  $adv_array = student_search_query_advisees($query, array(":faculty_cwid" => $faculty_cwid));
  $s = (count($adv_array) == 1) ? "" : "s";
  $rtn .= student_search_render_advisees($adv_array, t("My Advisees Results") . "   ( " . count($adv_array) . " " . t("student$s") . " )");

  return $rtn;
}