function Student::load_student_data

7.x Student.php Student::load_student_data()
6.x Student.php Student::load_student_data()

This loads a student's personal data, like name and so forth.

1 call to Student::load_student_data()

File

classes/Student.php, line 510

Class

Student

Code

function load_student_data() {

  $cur = null;
  if (isset($GLOBALS ['load_student_data'][$this->student_id])) {
    $cur = $GLOBALS ['load_student_data'][$this->student_id];
  }
  else {
    $res = $this->db->db_query("SELECT * FROM students WHERE cwid = ? ", array($this->student_id));
    $cur = $this->db->db_fetch_array($res);
    $GLOBALS ['load_student_data'][$this->student_id] = $cur;
  }

  if ($cur) {
    $this->is_active = intval($cur ['is_active']);
    $this->cumulative_hours = $cur ['cumulative_hours'];
    $this->school_id = $this->db->get_school_id_for_student_id($this->student_id);
    $this->gpa = $cur ['gpa'];
    $this->db_rank = $cur ['rank_code'];
    $this->catalog_year = $cur ['catalog_year'];
    $this->rank = $this->get_rank_description($this->db_rank);
    $this->name = $this->db->get_student_name($this->student_id);
  }

  $this->major_code_array = fp_get_student_majors($this->student_id, FALSE);
  $this->major_code_csv = '';
  foreach ($this->major_code_array as $k => $v) {
    $this->major_code_csv .= $k . ',';
  }
  $this->major_code_csv = rtrim($this->major_code_csv, ',');



}