function _DegreePlan::get_title2

4.x _DegreePlan.php _DegreePlan::get_title2()
5.x _DegreePlan.php _DegreePlan::get_title2($bool_include_classification = FALSE, $bool_include_track_title = FALSE, $bool_include_html = TRUE)

File

classes/_DegreePlan.php, line 380

Class

_DegreePlan

Code

function get_title2() 
 {
  // This will simply return the degree's title.  If it does not
  // exist, it will try to find another degree with the same major_code.
  // This is to fix the problem with students with catalog years outside
  // of FlightPath's database, but with major codes that have titles.

  $this->load_descriptive_data();

  if ($this->title != "") 
   {
    return $this->title;
  }


  // Still no title?  Try to load ANY degree title with this degree's
  // major_code.
  $table_name = "degrees";
  if ($this->bool_use_draft) {
    $table_name = "draft_$table_name";
  }

  $res = $this->db->db_query("SELECT * FROM $table_name
            								WHERE major_code = '?' 
            								ORDER BY catalog_year DESC LIMIT 1", $this->major_code);
  $cur = $this->db->db_fetch_array($res);
  $this->title = $cur ["title"];

  return $this->title;

}