function _AdvisingScreen::display_toolbox_courses

4.x _AdvisingScreen.php _AdvisingScreen::display_toolbox_courses()
5.x _AdvisingScreen.php _AdvisingScreen::display_toolbox_courses()

Used in the Toolbox popup, this will display content of the tab which shows a student's courses which they have taken.

Return value

string

File

classes/_AdvisingScreen.php, line 1149

Class

_AdvisingScreen

Code

function display_toolbox_courses() 
 {
  $pC = "";

  $pC .= fp_render_curved_line(t("All Student Courses"));

  $csid = $_REQUEST ["current_student_id"];
  $order = $_REQUEST ["order"];
  if ($order == "name") 
   {
    $ns = "font-weight: bold; color: black; text-decoration: none;";
  }
  else {
    $os = "font-weight: bold; color: black; text-decoration: none;";
  }

  $pC .= "<div class='tenpt'>
				" . t("This window displays all of the student's courses
				which FlightPath is able to load.") . "					
				<br><br>
				" . t("Order by:") . " &nbsp; &nbsp;";
  $pC .= l(t("Name"), "advise/popup-toolbox/courses", "order=name&current_student_id=$csid", array("style" => $ns)) . "&nbsp; &nbsp;";
  $pC .= l(t("Date Taken"), "advise/popup-toolbox/courses", "order=date&current_student_id=$csid", array("style" => $os));

  $pC .= "<hr>
				<table border='0' cellpadding='2'>
					";
  $is_empty = true;
  if ($order == "name") 
   {
    $this->student->list_courses_taken->sort_alphabetical_order();
  }
  else {
    $this->student->list_courses_taken->sort_most_recent_first();
  }
  $this->student->list_courses_taken->reset_counter();
  while ($this->student->list_courses_taken->has_more()) 
   {
    $c = $this->student->list_courses_taken->get_next();

    if ($c->course_id > 0) 
     {
      $c->load_descriptive_data();
    }

    $l_s_i = $c->subject_id;
    $l_c_n = $c->course_num;
    $eqv_line = "";

    if ($c->course_transfer->course_id > 0) 
     {
      if ($c->course_id > 0) 
       {
        $eqv_line = "<tr>
							<td colspan='8' class='tenpt'
								style='padding-left: 20px;'>
								<i>*eqv to {$GLOBALS ["fp_system_settings"]["school_initials"]} $l_s_i $l_c_n</i></td>
							</tr>";
      }
      $l_s_i = $c->course_transfer->subject_id;
      $l_c_n = $c->course_transfer->course_num;

    }


    $l_title = $this->fix_course_title($c->title);
    $l_term = $c->get_term_description(true);

    $h = $c->get_hours_awarded();
    if ($c->bool_ghost_hour) {
      $h .= "(" . t("ghost") . "<a href='javascript:alertSubGhost()'>?</a>)";
    }

    $pC .= "<tr>
						<td valign='top' class='tenpt'>$l_s_i</td>
						<td valign='top' class='tenpt'>$l_c_n</td>
						<td valign='top' class='tenpt'>$h</td>
						<td valign='top' class='tenpt'>$c->grade</td>
						<td valign='top' class='tenpt'>$c->term_id</td>
						";
    $pC .= "<td valign='top' class='tenpt'>";

    if ($c->bool_transfer) {
      $pC .= "T ";
    }


    //if ($c->bool_substitution) {$pC .= "S ";}
    if ($c->get_bool_substitution()) {
      $pC .= "S ";
    }



    if ($c->bool_has_been_assigned) 
     {
      $pC .= "A:";
      //////////////////////////////
      // List all the groups/degrees this course has been assigned to!
      //if ($c->assigned_to_group_id == 0)
      if ($c->get_first_assigned_to_group_id() == "") 
       {
        $pC .= "degree plan";
      }
      else {
        $temp_group = new Group();
        //$temp_group->group_id = $c->assigned_to_group_id;
        $temp_group->group_id = $c->get_first_assigned_to_group_id();
        $temp_group->load_descriptive_data();
        $pC .= $temp_group->title;
      }


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



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

    $is_empty = false;
  }

  if ($is_empty == true) 
   {
    $pC .= "<div align='center'>" . t("No courses have been moved for this student.") . "</div>";
  }

  $pC .= "</table>";

  $pC .= "</div>";

  watchdog("toolbox", "courses", array(), WATCHDOG_DEBUG);

  return $pC;
}