function advise_display_what_if_selection

4.x advise.module advise_display_what_if_selection($bool_undergrad_only = TRUE)

Displays the pulldown select list for picking a new What If degree. Returns HTML.

Return value

string

1 call to advise_display_what_if_selection()
advise_display_view in modules/advise/advise.module
This is the page which actually displays the "view" for the user to see their advising session, or for an advisor to advise them.

File

modules/advise/advise.module, line 830

Code

function advise_display_what_if_selection($bool_undergrad_only = TRUE) {
  global $screen, $current_student_id;

  $rtn = "";

  if ($screen->bool_print) {
    return "";
  }

  $db = get_global_database_handler();

  $rtn .= "<form action='" . base_path() . "/what-if' id='mainform' method='POST'>";
  $rtn .= fp_render_curved_line("What if I change my major to...");

  $rtn .= "<br>
      Major: <select name='what_if_major_code' class='what-if-selector'>
        <option value=''>Please select a major</option>
        <option value=''>------------------------------</option>\n
        ";
  $settings = fp_get_system_settings();
  $current_catalog_year = $settings ["current_catalog_year"];
  //$bool_use_draft = $GLOBALS["fp_advising"]["bool_use_draft"];
  $bool_use_draft = FALSE; // leave as false for now.  Because you can't select
  // degree options, and if you click submit it really does
  // save it.  Better to just use blank degrees.
  if ($degree_array = $db->get_degrees_in_catalog_year($current_catalog_year, false, $bool_use_draft, $bool_undergrad_only)) {
    foreach ($degree_array as $major_code => $value) {
      if (trim($value ["title"]) == "") {
        continue;
      }
      $rtn .= "<option value='$major_code'>{$value ["title"]}</option> \n";
    }
  }

  $rtn .= "</select>
      <br><br>";

  $rtn .= "
      <div align='right'>
      " . fp_render_button("Try It Out!", "showUpdate(true);submitForm();") . "       
   
      </div>
      <br><br>
      <div class='hypo tenpt'>
       <b>Important Notice:</b> What If displays degree plans
       from the most recent catalog year ($current_catalog_year-" . ($current_catalog_year + 1) . "), 
       as any major change would place the student into the 
       most recent catalog. 
      </div>";


  // Include only certain variables, so we don't overwrite our selection of what_if_major_code.
  $rtn .= "
          <input type='hidden' name='load_from_cache' value='no'>
          <input type='hidden' name='window_mode' value='screen'>
          <input type='hidden' id='scroll_top'>
          <input type='hidden' id='perform_action' name='perform_action'>
          <input type='hidden' id='advising_what_if' name='advising_what_if' value='yes'>
          <input type='hidden' id='current_student_id' name='current_student_id' value='$current_student_id'>
  
        ";

  $rtn .= "</form>
      ";


  return $rtn;
}