db->select('id, name'); $this->db->from('degree'); $this->db->where(array('status'=>1)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } function facultyList() { $this->db->select('id,name'); $this->db->from('faculty'); $this->db->where(array('status'=>1)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } function list_subject() { $this->db->select('s.id ,s.name,s.code,d.name as depName'); $this->db->from('subject as s'); $this->db->join('degree as d','d.id=s.degreeId','INNER'); $this->db->where(array('s.status'=>1,'d.status'=>1)); $query = $this->db->get(); return $query; } function get_sub($id) { $this->db->select('*'); $this->db->from('subject'); $this->db->where(array('status'=>1,'id'=>$id)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } function viewSubject($id) { $this->db->select('sub.*,deg.name as degName,f.id as facId,f.name as facName'); $this->db->from('subject as sub'); $this->db->join('degree as deg','deg.id=sub.degreeId','INNER'); $this->db->join('faculty as f','f.id=sub.facultyId','INNER'); $this->db->where(array('sub.status'=>1,'sub.id'=>$id)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } function get_faculty($id) { $this->db->select('*'); $this->db->from('faculty'); $this->db->where(array('id'=>$id)); $query = $this->db->get(); //echo $this->db->last_query(); return $query; } }