function _AdvisingScreen::draw_popup_group_subject_select

4.x _AdvisingScreen.php _AdvisingScreen::draw_popup_group_subject_select($subject_array, $group_id, $semester_num, $group_hours_remaining = 0)
5.x _AdvisingScreen.php _AdvisingScreen::draw_popup_group_subject_select($subject_array, $group_id, $semester_num, $group_hours_remaining = 0, $req_by_degree_id = 0)

When the groupSelect has too many courses, they are broken down into subjects, and the user first selects a subject. This function will draw out that select list.

Parameters

array $subject_array:

int $group_id:

int $semester_num:

int $group_hours_remaining:

Return value

string

1 call to _AdvisingScreen::draw_popup_group_subject_select()
_AdvisingScreen::display_popup_group_select in classes/_AdvisingScreen.php
This function displays the popup which lets a user select a course to be advised into a group.

File

classes/_AdvisingScreen.php, line 4043

Class

_AdvisingScreen

Code

function draw_popup_group_subject_select($subject_array, $group_id, $semester_num, $group_hours_remaining = 0) 
 {
  $csid = $GLOBALS ["current_student_id"];
  $blank_degree_id = "";
  if ($this->bool_blank) 
   {
    $blank_degree_id = $this->degree_plan->degree_id;
  }
  $pC .= "<tr><td colspan='8' class='tenpt'>";
  $pC .= "<form action='" . base_path() . "/advise/popup-group-select' method='GET' style='margin:0px; padding:0px;' id='theform'>
					<input type='hidden' name='window_mode' value='popup'>
					<input type='hidden' name='group_id' value='$group_id'>
					<input type='hidden' name='semester_num' value='$semester_num'>
					<input type='hidden' name='group_hours_remaining' value='$group_hours_remaining'>
					<input type='hidden' name='current_student_id' value='$csid'>
					<input type='hidden' name='blank_degree_id' value='$blank_degree_id'>
		
					" . t("Please begin by selecting a subject from the list below.") . "
					<br><br>
					<select name='selected_subject'>
					<option value=''>" . t("Please select a subject...") . "</option>
					<option value=''>----------------------------------------</option>
					";
  $new_array = array();
  foreach ($subject_array as $key => $subject_id) 
   {

    if ($title = $this->flightpath->get_subject_title($subject_id)) {
      $new_array [] = "$title ~~ $subject_id";
    }
    else {
      $new_array [] = "$subject_id ~~ $subject_id";
    }

  }

  sort($new_array);

  foreach ($new_array as $key => $value) 
   {
    $temp = explode(" ~~ ", $value);
    $title = trim($temp [0]);
    $subject_id = trim($temp [1]);
    $pC .= "<option value='$subject_id'>$title ($subject_id)</option>";
  }

  $pC .= "</select>
				<div style='margin: 20px;' align='left'>
				" . fp_render_button(t("Next") . " ->", "document.getElementById(\"theform\").submit();") . "
				</div>
					<!-- <input type='submit' value='submit'> -->
					
			  			</form>
			  ";
  $pC .= "</td></tr>";

  return $pC;
}