function _AdvisingScreen::display_semester

4.x _AdvisingScreen.php _AdvisingScreen::display_semester(Semester $semester, $bool_display_hour_count = false)
5.x _AdvisingScreen.php _AdvisingScreen::display_semester(Semester $semester, $bool_display_hour_count = false)

Given a Semester object, this will generate the HTML to draw it out to the screen.

Parameters

Semester $semester:

bool $bool_display_hour_count:

  • If set to TRUE, it will display a small "hour count" message at the bottom of each semester, showing how many hours are in the semester. Good for debugging purposes.

Return value

string

2 calls to _AdvisingScreen::display_semester()
_AdvisingScreen::build_added_courses in classes/_AdvisingScreen.php
Constructs the HTML to show which courses have been added by an advisor.
_AdvisingScreen::build_semester_list in classes/_AdvisingScreen.php
Constructs the HTML to display the list of semesters for the student.

File

classes/_AdvisingScreen.php, line 2260

Class

_AdvisingScreen

Code

function display_semester(Semester $semester, $bool_display_hour_count = false) 
 {
  // Display the contents of a semester object
  // on the screen (in HTML)
  $pC = "";
  $pC .= $this->draw_semester_box_top($semester->title);

  $count_hoursCompleted = 0;

  // First, display the list of bare courses.

  $semester->list_courses->sort_alphabetical_order();
  $semester->list_courses->reset_counter();

  while ($semester->list_courses->has_more()) 
   {
    $course = $semester->list_courses->get_next();
    // Is this course being fulfilled by anything?


    if (!($course->course_list_fulfilled_by->is_empty)) 
     { // this requirement is being fulfilled by something the student took...


      $pC .= $this->draw_course_row($course->course_list_fulfilled_by->get_first());
      $course->course_list_fulfilled_by->get_first()->bool_has_been_displayed = true;


      if ($course->course_list_fulfilled_by->get_first()->display_status == "completed") 
       { // We only want to count completed hours, no midterm or enrolled courses.
        $h = $course->course_list_fulfilled_by->get_first()->hours_awarded;
        if ($course->course_list_fulfilled_by->get_first()->bool_ghost_hour == TRUE) {
          $h = 0;
        }
        $count_hoursCompleted += $h;
      }

    }
    else {
      // This requirement is not being fulfilled...
      $pC .= $this->draw_course_row($course);

    }

    //$pC .= "</td></tr>";

  }


  // Now, draw all the groups.
  $semester->list_groups->sort_alphabetical_order();
  $semester->list_groups->reset_counter();
  while ($semester->list_groups->has_more()) 
   {

    $group = $semester->list_groups->get_next();
    $pC .= "<tr><td colspan='8'>";
    $pC .= $this->display_group($group);
    $count_hoursCompleted += $group->hours_fulfilled_for_credit;
    $pC .= "</td></tr>";
  }

  // Add hour count to the bottom...
  if ($bool_display_hour_count == true && $count_hoursCompleted > 0) 
   {
    $pC .= "<tr><td colspan='8'>
				<div class='tenpt' style='text-align:right; margin-top: 10px;'>
				Completed hours: $count_hoursCompleted
				</div>
				";
    $pC .= "</td></tr>";
  }


  // Does the semester have a notice?
  if ($semester->notice != "") 
   {
    $pC .= "<tr><td colspan='8'>
					<div class='hypo tenpt' style='margin-top: 15px; padding: 5px;'>
						<b>Important Notice:</b> $semester->notice
					</div>
					</td></tr>";
  }

  $pC .= $this->draw_semester_box_bottom();

  return $pC;
}