stats.module

  1. 6.x modules/stats/stats.module
  2. 4.x modules/stats/stats.module
  3. 5.x modules/stats/stats.module

This module displays statistics and reports for FlightPath

File

modules/stats/stats.module
View source
  1. <?php
  2. /**
  3. * @file
  4. * This module displays statistics and reports for FlightPath
  5. *
  6. * @return unknown
  7. */
  8. /**
  9. * Implementation of hook_menu
  10. *
  11. * @return unknown
  12. */
  13. function stats_menu() {
  14. $items = array();
  15. $items["admin-tools/stats"] = array(
  16. "title" => "Usage Stats & Reports",
  17. "page_callback" => "stats_display_main",
  18. "access_arguments" => array("can_access_stats"),
  19. "page_settings" => array(
  20. "page_show_title" => TRUE,
  21. "menu_icon" => fp_theme_location() . "/images/popup.gif",
  22. "target" => "_blank",
  23. ),
  24. "type" => MENU_TYPE_NORMAL_ITEM,
  25. );
  26. $items["stats/reports/access"] = array(
  27. "title" => "Access Stats",
  28. "description" => "See recent access within the system. This can be useful to see if anyone is currently using the system.",
  29. "page_callback" => "stats_report_access_stats",
  30. "access_arguments" => array("can_access_stats"),
  31. "page_settings" => array(
  32. "page_show_title" => TRUE,
  33. "bool_print" => FALSE,
  34. "menu_links" => array(
  35. 0 => array(
  36. "text" => "Main menu",
  37. "path" => "admin-tools/stats",
  38. ),
  39. ),
  40. ),
  41. "type" => MENU_TYPE_NORMAL_ITEM,
  42. "weight" => 100,
  43. );
  44. $items["stats/reports/major-counts"] = array(
  45. "title" => "Major Counts",
  46. "description" => "Displays the number of students within each major or major/concentration.",
  47. "page_callback" => "stats_report_major_counts",
  48. "access_arguments" => array("can_access_stats"),
  49. "page_settings" => array(
  50. "page_show_title" => TRUE,
  51. "bool_print" => FALSE,
  52. "menu_links" => array(
  53. 0 => array(
  54. "text" => "Main menu",
  55. "path" => "admin-tools/stats",
  56. ),
  57. ),
  58. ),
  59. "type" => MENU_TYPE_NORMAL_ITEM,
  60. "weight" => 150,
  61. );
  62. /**
  63. *
  64. * Removing due to lack of use, and incompatibility with FP5
  65. *
  66. *
  67. $items["stats/reports/selected-degree-options"] = array(
  68. "title" => "Selected Degree Options",
  69. "description" => "This report will display information about which degree options students/advisors are selecting for particular majors
  70. (ex: General Studies)",
  71. "page_callback" => "stats_report_selected_degree_options",
  72. "access_arguments" => array("can_access_stats"),
  73. "page_settings" => array(
  74. "page_show_title" => TRUE,
  75. "bool_print" => FALSE,
  76. "menu_links" => array(
  77. 0 => array(
  78. "text" => "Main menu",
  79. "path" => "admin-tools/stats",
  80. ),
  81. ),
  82. ),
  83. "type" => MENU_TYPE_NORMAL_ITEM,
  84. "weight" => 200,
  85. );
  86. */
  87. $items["stats/reports/advisor-use"] = array(
  88. "title" => "Advisor Use",
  89. "description" => "How many students an advisor has advised over a specified time range.",
  90. "page_callback" => "stats_report_advisor_use",
  91. "access_arguments" => array("can_access_stats"),
  92. "page_settings" => array(
  93. "page_show_title" => TRUE,
  94. "bool_print" => FALSE,
  95. "menu_links" => array(
  96. 0 => array(
  97. "text" => "Main menu",
  98. "path" => "admin-tools/stats",
  99. ),
  100. ),
  101. ),
  102. "type" => MENU_TYPE_NORMAL_ITEM,
  103. "weight" => 250,
  104. );
  105. $system_name = variable_get("system_name", "FlightPath");
  106. $items["stats/reports/student-course-list"] = array(
  107. "title" => "Student Course List",
  108. "description" => "List courses a student has taken, which $system_name is aware of.",
  109. "page_callback" => "stats_report_student_course_list",
  110. "access_arguments" => array("can_access_stats"),
  111. "page_settings" => array(
  112. "page_show_title" => TRUE,
  113. "bool_print" => FALSE,
  114. "menu_links" => array(
  115. 0 => array(
  116. "text" => "Main menu",
  117. "path" => "admin-tools/stats",
  118. ),
  119. ),
  120. ),
  121. "type" => MENU_TYPE_NORMAL_ITEM,
  122. "weight" => 300,
  123. );
  124. $items["stats/reports/flightpath-use-summary"] = array(
  125. "title" => "$system_name Use Summary",
  126. "description" => "A detailed report on how $system_name is being used over a specified time range.",
  127. "page_callback" => "stats_report_flightpath_use_summary",
  128. "access_arguments" => array("can_access_stats"),
  129. "page_settings" => array(
  130. "page_show_title" => TRUE,
  131. "bool_print" => FALSE,
  132. "menu_links" => array(
  133. 0 => array(
  134. "text" => "Main menu",
  135. "path" => "admin-tools/stats",
  136. ),
  137. ),
  138. ),
  139. "type" => MENU_TYPE_NORMAL_ITEM,
  140. "weight" => 350,
  141. );
  142. $items["stats/reports/course-use-summary"] = array(
  143. "title" => "Course Use Summary",
  144. "description" => "A report of everywhere a particular course is used in $system_name (groups or degrees).",
  145. "page_callback" => "stats_report_course_use_summary",
  146. "access_arguments" => array("can_access_stats"),
  147. "page_settings" => array(
  148. "page_show_title" => TRUE,
  149. "bool_print" => FALSE,
  150. "menu_links" => array(
  151. 0 => array(
  152. "text" => "Main menu",
  153. "path" => "admin-tools/stats",
  154. ),
  155. ),
  156. ),
  157. "type" => MENU_TYPE_NORMAL_ITEM,
  158. "weight" => 450,
  159. );
  160. // Lets the user download a CSV file stored in the batch_queue table, with a batch_id.
  161. $items["stats/download-csv-from-batch/%"] = array(
  162. "page_callback" => "stats_download_csv_from_batch",
  163. "page_arguments" => array(2),
  164. "access_arguments" => array("can_access_stats"),
  165. "type" => MENU_TYPE_CALLBACK,
  166. );
  167. return $items;
  168. }
  169. /**
  170. * Lets the user download a CSV file from a completed batch.
  171. *
  172. * There are no permissions on this, except the can_access_stats permission.
  173. *
  174. * @param unknown_type $batch_id
  175. */
  176. function stats_download_csv_from_batch($batch_id) {
  177. $filename = fp_get_machine_readable(strtolower($_REQUEST["filename"]));
  178. $batch = batch_get($batch_id);
  179. // Give it to the browser...
  180. header('Content-type: text/csv');
  181. header('Content-Disposition: attachment; filename="' . $filename . '.csv"');
  182. print $batch["csv"];
  183. die;
  184. }
  185. /**
  186. * Lets me run a test...
  187. *
  188. */
  189. function stats_test() {
  190. $cwid = "17690589";
  191. $major_code = "AGRB";
  192. $catalog_year = 2011;
  193. $db = get_global_database_handler();
  194. // For later, let's get our requirement types from the pie chart config...
  195. $requirement_types = array();
  196. // Get the requested piecharts from our config...
  197. $temp = variable_get("pie_chart_config", "c ~ Core Requirements\nm ~ Major Requirements\ndegree ~ Degree Progress");
  198. $lines = explode("\n", $temp);
  199. foreach ($lines as $line) {
  200. if (trim($line) == "") continue;
  201. $temp = explode("~", $line);
  202. $requirement_type = trim($temp[0]);
  203. $label = trim($temp[1]);
  204. $requirement_types[$requirement_type] = $label;
  205. }
  206. //advise_init_advising_variables();
  207. // Load them up fully and calculate their percentages
  208. $student = new Student($cwid, $db);
  209. $degree_id = $db->get_degree_id($major_code, $catalog_year);
  210. if ($degree_id) {
  211. ///////////////////
  212. // Fully build up a FlightPath screen in memory, as if the student
  213. // were looking at this on a web page....
  214. //$degree_plan = new DegreePlan($degree_id);
  215. $degree_plan = new DegreePlan($degree_id, $db, false, $student->array_significant_courses);
  216. $student->load_student_substitutions();
  217. $student->load_unassignments();
  218. $student->list_courses_taken->sort_alphabetical_order();
  219. $student->list_courses_taken->sort_most_recent_first();
  220. $fp = new FlightPath($student, $degree_plan);
  221. $screen = new AdvisingScreen("", $fp);
  222. $screen->view = "year";
  223. $fp->flag_outdated_substitutions();
  224. $fp->assign_courses_to_semesters(); // bare degree plan. not groups.
  225. $fp->assign_courses_to_groups();
  226. $screen->build_screen_elements();
  227. ////////////////
  228. // Okay, perform the percentage calculations...
  229. $degree_plan->calculate_progress_hours();
  230. $degree_plan->calculate_progress_quality_points();
  231. foreach ($requirement_types as $requirement_type => $label) {
  232. // Okay, let's see if this degreeplan even has any data on this requirement type.
  233. $total_hours = $degree_plan->gpa_calculations[$requirement_type]["total_hours"]*1;
  234. $fulfilled_hours = $degree_plan->gpa_calculations[$requirement_type]["fulfilled_hours"]*1;
  235. $qpts_hours = $degree_plan->gpa_calculations[$requirement_type]["qpts_hours"]*1;
  236. $qpts = $degree_plan->gpa_calculations[$requirement_type]["qpts"]*1;
  237. $gpa = $percent = 0;
  238. if ($qpts_hours > 0) {
  239. $gpa = fp_truncate_decimals($qpts / $qpts_hours, 3);
  240. }
  241. if ($total_hours > 0) {
  242. $percent = round(($fulfilled_hours / $total_hours) * 100);
  243. }
  244. $batch["csv"] .= "$fulfilled_hours, $total_hours, $percent, $gpa, ";
  245. }
  246. }
  247. fpm($degree_plan->gpa_calculations["degree"]);
  248. }
  249. /**
  250. * Implementation of hook_perm().
  251. * Expects to return an array of permissions recognized by
  252. * this module.
  253. *
  254. * Ex: $a = array(
  255. * "deCanDoSomething" => array (
  256. * "title" => "Can Do Something",
  257. * "description" => "Allow the user to do something."
  258. * )
  259. * );
  260. *
  261. */
  262. function stats_perm() {
  263. $perms = array (
  264. "can_access_stats" => array(
  265. "title" => t("Can access/view stats"),
  266. "description" => t("This allows the user to access the stats module, letting them run
  267. reports on usage."),
  268. ),
  269. );
  270. return $perms;
  271. }
  272. /**
  273. * Return the HTML for a pulldown containing the catalog years available for selection.
  274. *
  275. * @param unknown_type $selected
  276. * @param unknown_type $display_submit
  277. */
  278. function stats_draw_catalog_year_pulldown($selected = "", $display_submit = FALSE) {
  279. $rtn = "";
  280. $rtn .= "
  281. <table border='0'>
  282. <td valign='middle'>
  283. <select name='catalog_year' id='catalog_year'><option value=''>
  284. " . t("Please select a catalog year") . "</option>
  285. <option value=''>-----------------------------------</option>";
  286. $current_catalog_year = variable_get("current_catalog_year", "");
  287. if ($selected == "") $selected = $current_catalog_year;
  288. $res = db_query("SELECT DISTINCT (catalog_year) FROM degrees
  289. WHERE exclude = '0'
  290. ORDER BY catalog_year DESC");
  291. while ($cur = db_fetch_array($res)) {
  292. $sel = ($cur["catalog_year"] == $selected) ? "selected=selected" : "";
  293. $rtn .= "<option value='{$cur["catalog_year"]}' $sel>{$cur["catalog_year"]}-" . ($cur["catalog_year"] + 1) . "</option>";
  294. }
  295. $rtn .= " </select> </td>";
  296. if ($display_submit == true)
  297. {
  298. $rtn .= "<td valign='middle'><input type='submit' value='" . t("Select") . "'></td>";
  299. }
  300. $rtn .= "</table>";
  301. return $rtn;
  302. }
  303. /**
  304. * This report will display everywhere a particular course is used in FlightPath (groups and degrees)
  305. *
  306. */
  307. function stats_report_course_use_summary() {
  308. $rtn = "";
  309. $draft = "";
  310. $use_draft = FALSE;
  311. $subject_id = trim(@$_GET["subject_id"]);
  312. $course_num = trim(@$_GET["course_num"]);
  313. $draft_check = @$_GET["draft"];
  314. if ($draft_check == "checked") {
  315. $draft = "draft_";
  316. $use_draft = TRUE;
  317. }
  318. $rtn .= "<form action='" . fp_url("stats/reports/course-use-summary") . "' method='GET' >";
  319. $rtn .= "Please enter a course's subject ID and course number to search:<br>
  320. <input type='text' name='subject_id' placeholder='subject ID' size='10' value='$subject_id'> &nbsp;
  321. <input type='text' name='course_num' placeholder='course num' size='10' value='$course_num'> &nbsp;
  322. <input type='checkbox' name='draft' value='checked' $draft_check>Check draft tables? &nbsp;
  323. <input type='submit' value='Search'>
  324. <br><b>Note:</b> This may take up to a minute to run, please be patient.";
  325. $rtn .= "</form>";
  326. if ($subject_id && $course_num) {
  327. $rtn .= "<hr>";
  328. // First, look up this course's ID.
  329. $db = get_global_database_handler();
  330. $course_id = $db->get_course_id($subject_id, $course_num);
  331. if ($course_id) {
  332. $rtn .= "<h2>Course $subject_id $course_num (id is $course_id)</h2>";
  333. // Groups
  334. $rtn .= "<div><b>Groups:</b></div>
  335. <table border='1'>
  336. <tr>
  337. <th>ID</th>
  338. <th>Name</th>
  339. <th>Title</th>
  340. <th>Year</th>
  341. </tr>";
  342. $res = db_query("SELECT * FROM {$draft}group_requirements WHERE course_id = ?
  343. order by `id`", $course_id);
  344. while ($cur = db_fetch_array($res)) {
  345. $group_id = $cur["group_id"];
  346. $group = new Group($group_id, $db, -1, false, $use_draft);
  347. if (!$group->title) {
  348. // This is possibly a child group. Look for its parent.
  349. $res2 = db_query("SELECT * FROM {$draft}group_requirements WHERE child_group_id = ?", $group_id);
  350. $cur2 = db_fetch_array($res2);
  351. if ($cur2["group_id"] != "") {
  352. $group_id = $cur2["group_id"];
  353. $group = new Group($group_id, $db, -1, false, $use_draft);
  354. }
  355. }
  356. $rtn .= "<tr>
  357. <td>$group_id</td>
  358. <td>$group->group_name</td>
  359. <td>$group->title</td>
  360. <td>$group->catalog_year</td>
  361. </tr>";
  362. }
  363. $rtn .= "</table>";
  364. // Now, look for degrees...
  365. $rtn .= "<br><br><br>
  366. <b>Degrees:</b>
  367. <table border='1'>
  368. <tr>
  369. <th>ID</th>
  370. <th>Title</th>
  371. <th>MAJR</th>
  372. <th>Track</th>
  373. <th>Sem</th>
  374. <th>Year</th>
  375. </tr>";
  376. $res = db_query("SELECT * FROM {$draft}degree_requirements WHERE course_id = ? ORDER BY `id`", $course_id);
  377. while ($cur = db_fetch_array($res)) {
  378. $degree_id = $cur["degree_id"];
  379. $degree = new DegreePlan($degree_id, $db, TRUE, FALSE, $use_draft);
  380. $rtn .= "<tr>
  381. <td>$degree_id</td>
  382. <td>$degree->title</td>
  383. <td>$degree->major_code</td>
  384. <td>$degree->track_code</td>
  385. <td>" . $cur["semester_num"] . "</td>
  386. <td>$degree->catalog_year</td>
  387. </tr>";
  388. }
  389. $rtn .= '</table>';
  390. } // if course_id
  391. else {
  392. $rtn .= "<div>Course could not be found. Check spelling.";
  393. }
  394. }
  395. return $rtn;
  396. }
  397. /**
  398. * This report will show which degree options are being selected for degrees which offer options.
  399. *
  400. * @return unknown
  401. */
  402. function z__stats_report_selected_degree_options() {
  403. $rtn = "";
  404. // What major have they selected?
  405. $major = trim(@$_GET["major"]);
  406. $rtn .= "<form action='" . fp_url("stats/reports/selected-degree-options") . "' method='GET' >";
  407. $rtn .= stats_draw_majors_pulldown($major, TRUE, TRUE, t("Please select a major with degree options"));
  408. $rtn .= "</form>";
  409. $db = get_global_database_handler();
  410. if ($major != "")
  411. {
  412. $count_in_major = 0;
  413. $degree_option_count = array();
  414. $sql = "SELECT * FROM students a, student_degrees b
  415. WHERE substring_index(major_code, '|', 1) = '?'
  416. AND rank_code IN %RANKIN%
  417. AND a.cwid = b.student_id
  418. %EXTRA_STUDENTSEARCH_CONDITIONS%
  419. GROUP BY a.cwid";
  420. $rank_in = "( '" . join("', '", csv_to_array($GLOBALS["fp_system_settings"]["allowed_student_ranks"])) . "' )";
  421. $sql = str_replace("%RANKIN%", $rank_in, $sql);
  422. $sql = str_replace("%EXTRA_STUDENTSEARCH_CONDITIONS%", @$GLOBALS["fp_system_settings"]["extra_student_search_conditions"], $sql);
  423. $result = db_query($sql, $major);
  424. while($cur = db_fetch_array($result))
  425. {
  426. extract($cur, 3, "db");
  427. $count_in_major++;
  428. $track = "";
  429. // Does this student have a track (degree option) specified?
  430. //$student_settings = $db->get_student_settings($db_cwid);
  431. $student_major_codes = $db->get_student_majors_from_db($db_cwid);
  432. // Look through all the major codes for this student, and see if any
  433. // have a |_ in them. If they do, that means they are a track.
  434. foreach ($student_major_codes as $mc) {
  435. if (strstr($mc, $major . "|_")) {
  436. $track = $mc; // Yes, so this is a track for this major.
  437. // Init if not already...
  438. if (!isset($degree_option_count[$track])) {
  439. $degree_option_count[$track] = 0;
  440. }
  441. $degree_option_count[$track]++;
  442. }
  443. }
  444. // No track found. Add that one, too.
  445. if ($track == "")
  446. {
  447. $track = t("None selected");
  448. // Init if not already...
  449. if (!isset($degree_option_count[$track])) {
  450. $degree_option_count[$track] = 0;
  451. }
  452. $degree_option_count[$track]++;
  453. }
  454. } // while db_fetch_array
  455. arsort($degree_option_count);
  456. $rtn .= "<table border='1'>
  457. <tr>
  458. <th>" . t("Degree Option") . "</th>
  459. <th>" . t("Count") . "</th>
  460. <th>" . t("Description") . "</th>
  461. </tr>";
  462. foreach($degree_option_count as $d_option => $value)
  463. {
  464. //$desc = get_track_title($major,$d_option);
  465. // figure out the title of the track...
  466. $temp = explode("-", $db_catalog_year);
  467. $cy = $temp[0];
  468. $degree_id = $db->get_degree_id($d_option, $cy);
  469. $dp = new DegreePlan();
  470. $dp->degree_id = $degree_id;
  471. $dp->load_descriptive_data();
  472. $desc = $dp->get_title2(TRUE, TRUE);
  473. $rtn .= "<tr><td valign='top'>
  474. $d_option
  475. </td>
  476. <td valign='top'>
  477. $value
  478. </td>
  479. <td valign='top'>
  480. $desc
  481. </td>
  482. </tr>";
  483. }
  484. $rtn .= "</table>" . t("Total number of students:") . " $count_in_major.";
  485. }
  486. return $rtn;
  487. }
  488. /**
  489. * Display a major selection pulldown, used by other reports.
  490. *
  491. * If bool_only_majors_with_tracks == TRUE, then we will only display the majors which
  492. * have tracks associated with them.
  493. *
  494. * If bool_exclude_tracks == TRUE, then we will skip over any major_code with a "_" in it,
  495. * meaning, this code describes a track and not the base major.
  496. *
  497. * If bool_only_current_catalog_year == TRUE, then only degrees from the current catalog year
  498. * will be displayed.
  499. *
  500. */
  501. function stats_draw_majors_pulldown($smajor = "", $display_submit = FALSE, $bool_only_majors_with_tracks = FALSE, $label = "Please select a major", $bool_exclude_tracks = FALSE, $bool_only_current_catalog_year = TRUE, $bool_return_options_array = FALSE)
  502. {
  503. $rtn = "";
  504. $db = get_global_database_handler();
  505. $major_array = array();
  506. $options_array = array();
  507. $current_catalog_year = variable_get("current_catalog_year", "");
  508. $m_a_count = 0;
  509. if ($bool_only_current_catalog_year) {
  510. $query = "SELECT * FROM degrees
  511. WHERE catalog_year = '?'
  512. AND `exclude`='0'
  513. ORDER BY `title` ";
  514. $result = db_query($query, $current_catalog_year);
  515. }
  516. else { // current catalog year not important.
  517. $query = "SELECT * FROM degrees
  518. WHERE `exclude`='0'
  519. GROUP BY major_code
  520. ORDER BY `title` ";
  521. $result = db_query($query);
  522. }
  523. while ($cur_row = $db->db_fetch_array($result)) {
  524. $major = trim($cur_row["major_code"]);
  525. if ($bool_exclude_tracks && strpos($major, "_")) {
  526. continue;
  527. }
  528. if ($bool_only_majors_with_tracks && !$db->get_degree_tracks($major, $current_catalog_year))
  529. { // only get majors that also have tracks!
  530. continue;
  531. }
  532. $description = trim($cur_row["title"]);
  533. $type = trim($cur_row["degree_type"]);
  534. $major_array[$m_a_count]["description"] = $description;
  535. $major_array[$m_a_count]["major"] = $major;
  536. $major_array[$m_a_count]["type"] = $type;
  537. $m_a_count++;
  538. }
  539. $rtn .= "
  540. <table border='0'>
  541. <td valign='middle'>
  542. <select name='major' id='major'>
  543. <option value=''>" . $label . "</option>
  544. <option value=''>-----------------------------------</option>";
  545. for ($t = 0; $t < $m_a_count; $t++)
  546. {
  547. $sel = "";
  548. if ($major_array[$t]["major"] == $smajor && $smajor != "")
  549. {
  550. $sel = "selected";
  551. }
  552. $hyph = "-";
  553. if ($major_array[$t]["type"] == "" || $major_array[$t]["type"] == "NA")
  554. {
  555. $hyph = "";
  556. $major_array[$t]["type"] = "";
  557. }
  558. $rtn .= "<option value='" . $major_array[$t]["major"] . "' $sel>(" . $major_array[$t]["major"] . ")
  559. " . $major_array[$t]["description"] . " $hyph " . $major_array[$t]["type"] . "
  560. </option>";
  561. $options_array[$major_array[$t]["major"]] = "(" . $major_array[$t]["major"] . ") " . $major_array[$t]["description"] . " $hyph " . $major_array[$t]["type"];
  562. }
  563. $rtn .= " </select> </td>";
  564. if ($display_submit == true)
  565. {
  566. $rtn .= "<td valign='middle'><input type='submit' value='" . t("Select") . "'></td>";
  567. }
  568. $rtn .= "</table>";
  569. if ($bool_return_options_array) return $options_array;
  570. return $rtn;
  571. }
  572. /**
  573. * Draws a simple form for entering a student's CWID, used by other reports.
  574. *
  575. * @param unknown_type $path
  576. * @param unknown_type $student_cwid
  577. * @return unknown
  578. */
  579. function stats_draw_student_cwid_form($path, $student_cwid = "") {
  580. $rtn = "";
  581. $rtn .= "<form action='" . fp_url($path) . "' method='GET' >
  582. " . t("Enter a student's CWID to see their courses") . "
  583. <br>
  584. <input type='textfield' value='$student_cwid' name='student_cwid'>
  585. <br>
  586. <input type='submit' value='" . t("Submit") . "'>
  587. </form> <hr>
  588. ";
  589. return $rtn;
  590. }
  591. /**
  592. * This report shows how many students are in each major.
  593. *
  594. * @return unknown
  595. */
  596. function stats_report_major_counts() {
  597. $rtn = "";
  598. $rtn .= "<table border='1'>
  599. <tr>
  600. <th>" . t("Major") . "</th>
  601. <th>" . t("Count") . "</th>
  602. <th colspan='2'>" . t("Description") . "</th>
  603. </tr>";
  604. $total = 0;
  605. $result = db_query("SELECT * FROM degrees
  606. GROUP BY major_code
  607. ORDER BY title, major_code ");
  608. while ($cur = db_fetch_array($result)) {
  609. $count = 0;
  610. $major_code = $cur["major_code"];
  611. $title = $cur["title"];
  612. $degree_type = $cur["degree_type"];
  613. // If this is a degree option, skip it, as we do not expect
  614. // the students table to record degree option choices.
  615. if (strstr($major_code, "|_")) continue;
  616. // Find out how many students have this major.
  617. $sql = "SELECT count(cwid) AS count FROM students a, student_degrees b
  618. WHERE b.major_code = ?
  619. AND a.cwid = b.student_id
  620. AND rank_code IN %RANKIN%
  621. %EXTRA_STUDENTSEARCH_CONDITIONS% ";
  622. $rank_in = "( '" . join("', '", csv_to_array(@$GLOBALS["fp_system_settings"]["allowed_student_ranks"])) . "' )";
  623. $sql = str_replace("%RANKIN%", $rank_in, $sql);
  624. $sql = str_replace("%EXTRA_STUDENTSEARCH_CONDITIONS%", @$GLOBALS["fp_system_settings"]["extra_student_search_conditions"], $sql);
  625. $res2 = db_query($sql, $major_code);
  626. $cur2 = db_fetch_array($res2);
  627. if (is_numeric($cur2["count"])) {
  628. $total += $cur2["count"];
  629. }
  630. $res_array[$major_code]["count"] = $cur2["count"] * 1;
  631. $res_array[$major_code]["desc"] = $title;
  632. $res_array[$major_code]["type"] = $degree_type;
  633. }
  634. foreach($res_array as $major => $value) {
  635. $rtn .= "<tr>
  636. <td valign='top' class='tenpt'>$major</td>
  637. <td valign='top' class='tenpt'>{$value["count"]}</td>
  638. <td valign='top' class='tenpt'>{$value["type"]}</td>
  639. <td valign='top' class='tenpt'>{$value["desc"]}</td>
  640. </tr>";
  641. }
  642. $rtn .= "</table>
  643. " . t("Total student records:") . " $total.";
  644. return $rtn;
  645. }
  646. /**
  647. * This report shows common usages in FlightPath by all users.
  648. *
  649. * This is a helpful report for determining which functionality is most popular
  650. * in FlightPath
  651. *
  652. * @return unknown
  653. */
  654. function stats_report_flightpath_use_summary() {
  655. $rtn = "";
  656. $start_date = trim(addslashes(@$_REQUEST["start_date"]));
  657. $end_date = trim(addslashes(@$_REQUEST["end_date"]));
  658. $rtn .= stats_draw_date_range_form("stats/reports/flightpath-use-summary", $start_date, $end_date);
  659. if ($start_date == "" || $end_date == "") {
  660. return $rtn;
  661. }
  662. $start_date .= " 00:00:00"; // make it start at midnight of the startDate.
  663. $end_date .= " 23:59:59"; // make it go through to midnight of the endDate.
  664. // Okay, now we get our various counts....
  665. // Logins...
  666. $u_student = stats_get_log_count("login","",true,$start_date,$end_date,true);
  667. $t_student = stats_get_log_count("login","",false,$start_date,$end_date,true);
  668. $u_staff = stats_get_log_count("login","",true,$start_date,$end_date,false);
  669. $t_staff = stats_get_log_count("login","",false,$start_date,$end_date,false);
  670. $rtn .= "<b>System Logins</b>
  671. <blockquote>
  672. Unique student logins: $u_student<br>
  673. Total student logins: $t_student<br>
  674. ------- <br>
  675. Unique faculty/staff logins: $u_staff<br>
  676. Total faculty/staff logins: $t_staff
  677. </blockquote>
  678. ";
  679. // Advisings...
  680. $regular_advisings = stats_get_log_count("save_adv_active","",false,$start_date,$end_date,false);
  681. $wi_advisings = stats_get_log_count("save_adv_active_whatif","",false,$start_date,$end_date,false);
  682. $total_advisings = $regular_advisings + $wi_advisings;
  683. $rtn .= "<b>Advisings</b>
  684. <blockquote>
  685. Total student advisings: $total_advisings <br>
  686. ------- <br>
  687. Regular advisings: $regular_advisings<br>
  688. What If advisings: $wi_advisings
  689. </blockquote>
  690. ";
  691. // Comments...
  692. $total = stats_get_log_count("save_comment","",false,$start_date,$end_date,false);
  693. $unique = stats_get_log_count("save_comment","",true,$start_date,$end_date,false);
  694. $rtn .= "<b>Comments</b>
  695. <blockquote>
  696. Total comments saved: $total <br>
  697. ------- <br>
  698. Unique faculty/staff commentors: $unique
  699. </blockquote>
  700. ";
  701. // Course search...
  702. $u_student = stats_get_log_count("course_search","",true,$start_date,$end_date,true);
  703. $um_student = stats_get_log_count("course_search","",true,$start_date,$end_date,true,true);
  704. $t_student = stats_get_log_count("course_search","",false,$start_date,$end_date,true);
  705. $tm_student = stats_get_log_count("course_search","",false,$start_date,$end_date,true, true);
  706. $u_staff = stats_get_log_count("course_search","",true,$start_date,$end_date,false);
  707. $t_staff = stats_get_log_count("course_search","",false,$start_date,$end_date,false);
  708. $tm_staff = stats_get_log_count("course_search","",false,$start_date,$end_date,false, true);
  709. $rtn .= "<b>Course Search</b>
  710. <blockquote>
  711. Unique student users: $u_student <span class='s-mobile'>($um_student mobile)</span><br>
  712. Total student uses: $t_student <span class='s-mobile'>($tm_student mobile)</span><br>
  713. ------- <br>
  714. Unique faculty/staff users: $u_staff<br>
  715. Total faculty/staff (and anonymous) uses: $t_staff <span class='s-mobile'>($tm_staff mobile)</span>
  716. </blockquote>
  717. ";
  718. // Degree search...
  719. $u_student = stats_get_log_count("blank_degrees","",true,$start_date,$end_date,true);
  720. $um_student = stats_get_log_count("blank_degrees","",true,$start_date,$end_date,true,true);
  721. $t_student = stats_get_log_count("blank_degrees","",false,$start_date,$end_date,true);
  722. $tm_student = stats_get_log_count("blank_degrees","",false,$start_date,$end_date,true, true);
  723. $u_staff = stats_get_log_count("blank_degrees","",true,$start_date,$end_date,false);
  724. $t_staff = stats_get_log_count("blank_degrees","",false,$start_date,$end_date,false);
  725. $tm_staff = stats_get_log_count("blank_degrees","",false,$start_date,$end_date,false, true);
  726. $rtn .= "<b>Degree Search (blank degrees)</b>
  727. <blockquote>
  728. Unique student users: $u_student <span class='s-mobile'>($um_student mobile)</span><br>
  729. Total student uses: $t_student <span class='s-mobile'>($tm_student mobile)</span><br>
  730. ------- <br>
  731. Unique faculty/staff users: $u_staff<br>
  732. Total faculty/staff (and anonymous) uses: $t_staff <span class='s-mobile'>($tm_staff mobile)</span>
  733. </blockquote>
  734. ";
  735. // View preferences
  736. $t_student_y = stats_get_log_count("view_by_year","",false,$start_date,$end_date,true);
  737. $tm_student_y = stats_get_log_count("view_by_year","",false,$start_date,$end_date,true, true);
  738. $u_student_y = stats_get_log_count("view_by_year","",true,$start_date,$end_date,true);
  739. $um_student_y = stats_get_log_count("view_by_year","",true,$start_date,$end_date,true, true);
  740. $t_staff_y = stats_get_log_count("view_by_year","",false,$start_date,$end_date,false);
  741. $t_student_t = stats_get_log_count("view_by_type","",false,$start_date,$end_date,true);
  742. $tm_student_t = stats_get_log_count("view_by_type","",false,$start_date,$end_date,true, true);
  743. $u_student_t = stats_get_log_count("view_by_type","",true,$start_date,$end_date,true);
  744. $um_student_t = stats_get_log_count("view_by_type","",true,$start_date,$end_date,true, true);
  745. $t_staff_t = stats_get_log_count("view_by_type","",false,$start_date,$end_date,false);
  746. $rtn .= "<b>View Preferences</b>
  747. <blockquote>
  748. Unique student view-by-year: $u_student_y <span class='s-mobile'>($um_student_y mobile)</span><br>
  749. Total student view-by-year: $t_student_y <span class='s-mobile'>($tm_student_y mobile)</span><br>
  750. Total faculty/staff view-by-year: $t_staff_y<br>
  751. ------- <br>
  752. Unqiue student view-by-type: $u_student_t <span class='s-mobile'>($um_student_t mobile)</span><br>
  753. Total student view-by-type: $t_student_t <span class='s-mobile'>($tm_student_t mobile)</span><br>
  754. Total faculty/staff view-by-type: $t_staff_t<br>
  755. </blockquote>
  756. ";
  757. // Substitutions
  758. $t_staff = stats_get_log_count("save_substitution","",false,$start_date,$end_date,false);
  759. $u_staff = stats_get_log_count("save_substitution","",true,$start_date,$end_date,false);
  760. $rtn .= "<b>Substitutions</b>
  761. <blockquote>
  762. Unique substitutors: $u_staff<br>
  763. Total substitutions: $t_staff<br>
  764. </blockquote>
  765. ";
  766. return $rtn;
  767. }
  768. /**
  769. * Used by the use_summary report. This function will simply return log counts
  770. * for the specified parameters in the watchdog table.
  771. *
  772. * @param unknown_type $action
  773. * @param unknown_type $action_array
  774. * @param unknown_type $bool_distinct
  775. * @param unknown_type $start_date
  776. * @param unknown_type $end_date
  777. * @param unknown_type $bool_students
  778. * @param unknown_type $bool_mobile_only
  779. * @return unknown
  780. */
  781. function stats_get_log_count($action = "", $action_array = "", $bool_distinct = false, $start_date, $end_date, $bool_students = true, $bool_mobile_only = false)
  782. {
  783. $action_line = " `type` = '$action' ";
  784. if (is_array($action_array) && count($action_array) > 1)
  785. {
  786. $action_line = "";
  787. $action_line .= "( ";
  788. foreach($action_array as $action)
  789. {
  790. $action_line .= " `type`='$action' OR";
  791. }
  792. $action_line = substr($action_line, 0, -2);
  793. $action_line .= ") ";
  794. }
  795. $count = "count(wid)";
  796. if ($bool_distinct)
  797. {
  798. $count = "count(distinct `user_id`)";
  799. }
  800. $user_type = "";
  801. if ($bool_students)
  802. {
  803. $user_type = " `is_student` = '1' ";
  804. } else {
  805. $user_type = " `is_faculty` = '1' ";
  806. }
  807. if ($bool_mobile_only) {
  808. $action_line .= " AND is_mobile = '1' ";
  809. }
  810. $start_ts = strtotime($start_date);
  811. $end_ts = strtotime($end_date);
  812. $res = db_query("SELECT $count AS count FROM watchdog
  813. WHERE
  814. `timestamp` > '$start_ts' AND `timestamp` < '$end_ts'
  815. AND $user_type
  816. AND
  817. $action_line
  818. ");
  819. $cur = db_fetch_array($res);
  820. return $cur["count"] * 1;
  821. }
  822. /**
  823. * Displays the HTML for the date range form used by several reports.
  824. * $path is what is the form's ACTION sending to.
  825. */
  826. function stats_draw_date_range_form($path, $start_date = "", $end_date = "") {
  827. $rtn = "";
  828. $rtn .= "<form action='" . fp_url($path) . "' method='GET' >
  829. " . t("Enter dates in the format YYYY-MM-DD (ex: 2012-01-01)") . "
  830. <br>
  831. " . t("Start date:") . " <input type='text' name='start_date' value='$start_date' id='start_date'>
  832. &nbsp; &nbsp;
  833. " . t("End date:") . " <input type='text' name='end_date' value='$end_date' id='end_date'>
  834. &nbsp; &nbsp;
  835. <input type='submit' value='" . t("Submit") . "'>
  836. </form> <hr>
  837. <script type='text/javascript'>
  838. $(function() {
  839. $('#start_date').datepicker({ dateFormat: 'yy-mm-dd'});
  840. $('#end_date').datepicker({ dateFormat: 'yy-mm-dd'});
  841. });
  842. </script>";
  843. return $rtn;
  844. }
  845. /**
  846. * This report shows which advisors are using FlightPath most often.
  847. *
  848. *
  849. * @return unknown
  850. */
  851. function stats_report_advisor_use() {
  852. $rtn = "";
  853. $start_date = trim(addslashes(@$_REQUEST["start_date"]));
  854. $end_date = trim(addslashes(@$_REQUEST["end_date"]));
  855. $rtn .= stats_draw_date_range_form("stats/reports/advisor-use", $start_date, $end_date);
  856. if ($start_date == "" || $end_date == "") {
  857. return $rtn;
  858. }
  859. $start_date .= " 00:00:00"; // make it start at midnight of the startDate.
  860. $end_date .= " 23:59:59"; // make it go through to midnight of the endDate.
  861. $start_ts = strtotime($start_date);
  862. $end_ts = strtotime($end_date);
  863. // Now, what we're doing here is we want the names of the advisors,
  864. // and how many advisings they actually completed for each,
  865. // as well as which college or department they belong to. They need
  866. // to be sorted by college/department.
  867. $f_array = array();
  868. $s_array = array();
  869. $result = db_query("SELECT * FROM watchdog a, faculty b, users c
  870. WHERE
  871. a.timestamp > '?' AND a.timestamp < '?'
  872. AND
  873. (a.type = 'save_adv_active' OR a.type = 'save_adv_active_whatif')
  874. AND a.cwid = b.cwid
  875. AND a.cwid = c.cwid
  876. AND c.is_faculty = 1
  877. ORDER BY b.department ", $start_ts, $end_ts);
  878. while($cur = db_fetch_array($result)) {
  879. $faculty_id = trim($cur["cwid"]);
  880. if (!isset($f_array[$faculty_id])) $f_array[$faculty_id] = 0;
  881. $f_array[$faculty_id] = intval($f_array[$faculty_id]); // make it a number.
  882. $f_array[$faculty_id]++;
  883. $s_array[$faculty_id]["dept_name"] = ucwords(strtolower(trim($cur["department"])));
  884. $s_array[$faculty_id]["college_name"] = ucwords(strtolower(trim($cur["college"])));
  885. $s_array[$faculty_id]["name"] = ucwords(strtolower(trim($cur["f_name"]) . " " . trim($cur["l_name"])));
  886. }
  887. // Sort based on who has advised the most...
  888. //arsort($f_array);
  889. $start_date = trim(addslashes($_REQUEST["start_date"]));
  890. $end_date = trim(addslashes($_REQUEST["end_date"]));
  891. // Now, output the results...
  892. $rtn .= "
  893. <table border='1' width='650'>
  894. <tr>
  895. <th>" . t("Name") . "</th>
  896. <th>" . t("Dept") . "</th>
  897. <th>#</th>
  898. </tr>";
  899. foreach($f_array as $faculty_id => $value)
  900. {
  901. $name = $s_array[$faculty_id]["name"];
  902. $college_name = $s_array[$faculty_id]["college_name"];
  903. $dept_name = $s_array[$faculty_id]["dept_name"];
  904. $rtn .= "<tr>
  905. <td valign='top'>$name</td>
  906. <td valign='top'>$dept_name</td>
  907. <td valign='top' align='center'>$value</td>
  908. </tr>
  909. ";
  910. }
  911. $rtn .= "</table>";
  912. return $rtn;
  913. }
  914. /**
  915. * This report shows recent activity in FlightPath. It can also be used to see
  916. * if anyone is "online" in that they would have activity less than 5 minutes old.
  917. *
  918. * @return unknown
  919. */
  920. function stats_report_access_stats() {
  921. $rtn = "";
  922. $min = trim(addslashes(@$_REQUEST["min"]));
  923. if ($min == "")
  924. {
  925. $min = "20";
  926. }
  927. $rtn .= "
  928. <form action='" . fp_url("stats/reports/access") . "' method='GET'>
  929. " . t("Activity over the last") . "
  930. <input type='text' name='min' value='$min' size='2'>
  931. ";
  932. $rtn .= t("minutes") . ": <input type='submit' value='->'>
  933. </form>
  934. " . t("Unique students in time frame") . ": <!--STUDENTS-->. " . t("Unique faculty/staff in time frame") . ": <!--STAFF--> <br>";
  935. $rtn .= "<table border='1' width='700'>
  936. <tr>
  937. <th>" . t("User") . "</th>
  938. <th>" . t("UID") . "</th>
  939. <th>" . t("CWID") . "</th>
  940. <th>" . t("Name") . "</th>
  941. <th>" . t("Type") . "</th>
  942. <th>" . t("Action") . "</th>
  943. <th>" . t("Extra") . "</th>
  944. <th>" . t("Time") . "</th>
  945. </tr>";
  946. $cwid_array = array();
  947. $student_actions = $staff_actions = 0;
  948. $interval = time() - ($min * 60);
  949. $res = db_query("SELECT * FROM watchdog
  950. WHERE `timestamp` > '?'
  951. ORDER BY `timestamp` DESC ", $interval);
  952. while ($cur = db_fetch_array($res)) {
  953. extract ($cur, 3, "db");
  954. $account = fp_load_user($db_user_id);
  955. $bgcol = "white";
  956. if ($account->is_student) {
  957. $bgcol = "lightblue";
  958. }
  959. else if ($account->is_faculty){
  960. $bgcol = "pink";
  961. }
  962. $minago = round((time() - $db_timestamp) / 60, 0);
  963. $extra_data = trim(substr($db_extra_data, 0, 18));
  964. if (strlen($extra_data) < strlen($db_extra_data))
  965. {
  966. $extra_data .= "...";
  967. }
  968. $pretty_date = format_date($db_timestamp);
  969. $user_type = "";
  970. if ($account->is_student) {
  971. $user_type .= "<div>" . t("student") . "</div>";
  972. }
  973. if ($account->is_faculty) {
  974. $user_type .= "<div>" . t("faculty") . "</div>";
  975. }
  976. $rtn .= "<tr style='background-color:$bgcol'>
  977. <td valign='top' class='tenpt'>$account->name</td>
  978. <td valign='top' class='tenpt'>$account->cwid</td>
  979. <td valign='top' class='tenpt'>$account->id</td>
  980. <td valign='top' class='tenpt'>$account->f_name $account->l_name</td>
  981. <td valign='top' class='tenpt'>$user_type</td>
  982. <td valign='top' class='tenpt'>$db_type</td>
  983. <td valign='top' class='tenpt'>" . t($db_message, unserialize($db_variables)) . "</td>
  984. <td valign='top' class='tenpt'>$minago " . t("min ago") . " &nbsp; <font size='1'>$pretty_date</font></td>
  985. </tr>";
  986. // Let's increase our counters, if this is a new CWID.
  987. if (!in_array($db_user_id, $cwid_array)) {
  988. $cwid_array[] = $db_user_id;
  989. if ($account->is_student) {
  990. $student_actions++;
  991. } else if ($account->is_faculty) {
  992. $staff_actions++;
  993. }
  994. }
  995. }
  996. // Add in our student and staff action counts
  997. $rtn = str_replace("<!--STUDENTS-->",$student_actions,$rtn);
  998. $rtn = str_replace("<!--STAFF-->",$staff_actions,$rtn);
  999. $rtn .= "</table>";
  1000. return $rtn;
  1001. }
  1002. /**
  1003. * This report shows a list of all of a student's courses which FlightPath is aware of.
  1004. *
  1005. * @return unknown
  1006. */
  1007. function stats_report_student_course_list() {
  1008. $rtn = "";
  1009. $student_cwid = trim(addslashes(@$_REQUEST["student_cwid"]));
  1010. $student_pidm = 0;
  1011. $rtn .= stats_draw_student_cwid_form("stats/reports/student-course-list", $student_cwid);
  1012. if ($student_cwid == "") {
  1013. return $rtn;
  1014. }
  1015. // If we have the banner_integration module installed, then get the pidm from banner too
  1016. if (function_exists("banner_integration_get_pidm_for_cwid")) {
  1017. $student_pidm = banner_integration_get_pidm_for_cwid($student_cwid);
  1018. }
  1019. $student_name = fp_get_student_name($student_cwid);
  1020. $student = new Student($student_cwid);
  1021. $rtn .= "
  1022. <style>
  1023. .zebra-even {
  1024. background-color: white;
  1025. }
  1026. .zebra-odd {
  1027. background-color: #ddd;
  1028. }
  1029. </style>
  1030. <h2>$student_name ($student_cwid)
  1031. ";
  1032. if ($student_pidm > 0) {
  1033. $rtn .= "<br>PIDM: $student_pidm";
  1034. }
  1035. $rtn .= "</h2>
  1036. <table border='0' cellspacing='0' cellpadding='6'>
  1037. <tr>
  1038. <th>Subject</th>
  1039. <th>Number</th>
  1040. <th>Grade</th>
  1041. <th>Hours</th>
  1042. <th>Term</th>
  1043. <th>Transfer?</th>
  1044. </tr>";
  1045. // So that we can sort our list of courses, we will add them to
  1046. // 2 arrays, one for local courses, one for transfer.
  1047. $local_array = array();
  1048. $transfer_array = array();
  1049. $pol = "even";
  1050. $local_hours = 0;
  1051. $transfer_hours = 0;
  1052. while($student->list_courses_taken->has_more()) {
  1053. $course = $student->list_courses_taken->get_next();
  1054. $subjectID = $course->subject_id;
  1055. $courseNum = $course->course_num;
  1056. $grade = $course->grade;
  1057. $hours = $course->get_hours_awarded();
  1058. $rnd = mt_rand(0,9999);
  1059. if (is_object($course->course_transfer)) {
  1060. $subjectID = $course->course_transfer->subject_id;
  1061. $courseNum = $course->course_transfer->course_num;
  1062. $grade = $course->course_transfer->grade;
  1063. $hours = $course->course_transfer->get_hours_awarded();
  1064. $transfer_hours += $hours;
  1065. }
  1066. else {
  1067. // local course
  1068. $local_hours += $hours;
  1069. }
  1070. $html_line = "
  1071. <td>$subjectID</td>
  1072. <td>$courseNum</td>
  1073. <td>$grade</td>
  1074. <td>$hours</td>
  1075. <td>$course->term_id</td>
  1076. <td>" . (($course->bool_transfer) ? "T" : "") . "</td>
  1077. ";
  1078. if ($course->bool_transfer) {
  1079. // The $rnd makes sure this is unique, in case a course is showing as repeated in the same term.
  1080. $transfer_array["$course->term_id~$subjectID~$courseNum~$rnd"] = $html_line;
  1081. }
  1082. else {
  1083. // The $rnd makes sure this is unique, in case a course is showing as repeated in the same term.
  1084. $local_array["$course->term_id~$subjectID~$courseNum~$rnd"] = $html_line;
  1085. }
  1086. }
  1087. // Okay, now let's sort our arrays and display them.
  1088. ksort($transfer_array);
  1089. ksort($local_array);
  1090. foreach($local_array as $line) {
  1091. $rtn .= "<tr class='zebra-$pol'>$line</tr>";
  1092. $pol = ($pol == "even")?"odd":"even";
  1093. }
  1094. foreach($transfer_array as $line) {
  1095. $rtn .= "<tr class='zebra-$pol'>$line</tr>";
  1096. $pol = ($pol == "even")?"odd":"even";
  1097. }
  1098. $rtn .= "</table>
  1099. <hr>
  1100. ";
  1101. $rtn .= "<p>" . count($local_array) . " local courses, with $local_hours hours.</p>";
  1102. $rtn .= "<p>" . count($transfer_array) . " transfer courses, with $transfer_hours hours.</p>";
  1103. return $rtn;
  1104. }
  1105. /**
  1106. * Main menu screen for this module.
  1107. *
  1108. * We will simply display the "menu block" for "stats/reports". That is,
  1109. * any path that begins with stats/reports will show up here.
  1110. *
  1111. * You can create a report in your custom module, and as long as the url begins
  1112. * with stats/reports, and the menu item is of type "MENU_TYPE_NORMAL_ITEM"
  1113. * it will appear on this page. Set the weight to be > 1000 to appear below this list,
  1114. * set weight < 100 to appear above.
  1115. *
  1116. * @return unknown
  1117. */
  1118. function stats_display_main() {
  1119. $rtn = "";
  1120. $rtn .= "<div class='stats-main-menu' style='font-size:1.2em;'>";
  1121. $rtn .= fp_render_menu_block("System Reports", "stats/reports");
  1122. $rtn .= "</div>";
  1123. // If we have other reports which have been exposed using the hook_stats_additional_menublocks function,
  1124. // display them here.
  1125. $reports = invoke_hook('stats_additional_menublocks');
  1126. if ($reports) {
  1127. foreach ($reports as $module_name => $temp) {
  1128. $rtn .= "<div class='stats-main-menu stats-additional-menublocks' style='font-size:1.2em;'>";
  1129. foreach($reports[$module_name] as $title => $menu_block_path) {
  1130. $rtn .= fp_render_menu_block($title, $menu_block_path);
  1131. }
  1132. $rtn .= "</div>";
  1133. }
  1134. }
  1135. return $rtn;
  1136. }

Functions

Namesort descending Description
stats_display_main Main menu screen for this module.
stats_download_csv_from_batch Lets the user download a CSV file from a completed batch.
stats_draw_catalog_year_pulldown Return the HTML for a pulldown containing the catalog years available for selection.
stats_draw_date_range_form Displays the HTML for the date range form used by several reports. $path is what is the form's ACTION sending to.
stats_draw_majors_pulldown Display a major selection pulldown, used by other reports.
stats_draw_student_cwid_form Draws a simple form for entering a student's CWID, used by other reports.
stats_get_log_count Used by the use_summary report. This function will simply return log counts for the specified parameters in the watchdog table.
stats_menu Implementation of hook_menu
stats_perm Implementation of hook_perm(). Expects to return an array of permissions recognized by this module.
stats_report_access_stats This report shows recent activity in FlightPath. It can also be used to see if anyone is "online" in that they would have activity less than 5 minutes old.
stats_report_advisor_use This report shows which advisors are using FlightPath most often.
stats_report_course_use_summary This report will display everywhere a particular course is used in FlightPath (groups and degrees)
stats_report_flightpath_use_summary This report shows common usages in FlightPath by all users.
stats_report_major_counts This report shows how many students are in each major.
stats_report_student_course_list This report shows a list of all of a student's courses which FlightPath is aware of.
stats_test Lets me run a test...
z__stats_report_selected_degree_options This report will show which degree options are being selected for degrees which offer options.