function _DegreePlan::load_descriptive_data

4.x _DegreePlan.php _DegreePlan::load_descriptive_data()
5.x _DegreePlan.php _DegreePlan::load_descriptive_data()
2 calls to _DegreePlan::load_descriptive_data()

File

classes/_DegreePlan.php, line 411

Class

_DegreePlan

Code

function load_descriptive_data() 
 {
  $table_name = "degrees";
  if ($this->bool_use_draft) {
    $table_name = "draft_$table_name";
  }

  $res = $this->db->db_query("SELECT * FROM $table_name
								               WHERE degree_id = '?' ", $this->degree_id);

  if ($this->db->db_num_rows($res) > 0) 
   {
    $cur = $this->db->db_fetch_array($res);
    $this->major_code = $cur ["major_code"];
    $this->title = $cur ["title"];
    $this->public_note = $cur ["public_note"];
    $this->catalog_year = $cur ["catalog_year"];
    $this->degree_type = trim($cur ["degree_type"]);
    $this->db_exclude = trim($cur ["exclude"]);

    // Get the semester titles.
    $temp = trim($cur ["semester_titles_csv"]);
    $this->array_semester_titles = explode(",", $temp);

    if (strstr($this->major_code, "_")) 
     {
      // This means that there is a track.  Get all the information
      // you can about it.
      $temp = explode("_", $this->major_code);
      $this->track_code = trim($temp [1]);
      $this->major_code = trim($temp [0]);

      // The major_code might now have a | at the very end.  If so,
      // get rid of it.
      if (substr($this->major_code, strlen($this->major_code) -1, 1) == "|") 
       {
        $this->major_code = str_replace("|", "", $this->major_code);
      }
      // Now, look up information on the track.
      $table_name = "degree_tracks";
      if ($this->bool_use_draft) {
        $table_name = "draft_$table_name";
      }

      $res = $this->db->db_query("SELECT * FROM $table_name
                								WHERE major_code = '?'
                								AND track_code = '?'
                								AND catalog_year = '?' ", $this->major_code, $this->track_code, $this->catalog_year);
      $cur = $this->db->db_fetch_array($res);

      $this->track_title = $cur ["track_title"];
      $this->track_description = $cur ["track_description"];

    }

    // Does this major have any tracks at all?  If so, set a bool.
    if ($this->db->get_degree_tracks($this->major_code, $this->catalog_year)) 
     {
      $this->bool_has_tracks = true;
    }

  }

}