function _DegreePlan::get_available_tracks

4.x _DegreePlan.php _DegreePlan::get_available_tracks()
5.x _DegreePlan.php _DegreePlan::get_available_tracks()

Returns a simple array with values seperated by " ~~ " in this order: track_code ~~ track_title ~~ trackDesc ~~ track's degree id

Return value

array

File

classes/_DegreePlan.php, line 1067

Class

_DegreePlan

Code

function get_available_tracks() 
 {
  $rtn_array = array();

  $rtn_array [] = "  ~~ None ~~ Select this option to display
						the base degree plan (may not be available for all majors).";
  $table_name = "degree_tracks";
  $table_name2 = "degrees";
  if ($this->bool_use_draft) {
    $table_name = "draft_$table_name";
  }
  if ($this->bool_use_draft) {
    $table_name2 = "draft_$table_name2";
  }

  $res = db_query("SELECT track_code, track_title, track_description FROM $table_name
              								WHERE major_code = '?'
              								AND catalog_year = '?' 
              								ORDER BY track_title ", $this->major_code, $this->catalog_year);
  while ($cur = db_fetch_array($res)) 
   {

    $track_code = $cur ["track_code"];
    $track_title = $cur ["track_title"];
    $track_description = $cur ["track_description"];
    //adminDebug($track_code);

    // Let's also get the degree_id for this particular track.
    $track_degree_id = $this->db->get_degree_id($this->major_code . "|_" . $track_code, $this->catalog_year, $this->bool_use_draft);

    // Also find out what is the degree_class for this degree_id.
    $degree_class = @trim(db_result(db_query("SELECT degree_class FROM $table_name2
                        WHERE degree_id = ?", $track_degree_id)));


    $rtn_array [] = "$track_code ~~ $track_title ~~ $track_description ~~ $track_degree_id ~~ $degree_class";
  }

  if (count($rtn_array) > 1) // we're going to have at least 1 because of the "none" option.  Let's skip that one.
   {
    return $rtn_array;
  }
  else {
    return false;
  }


}