db->select('s.id,s.name,s.year'); $this->db->from('semester as s'); $this->db->where(array('s.status'=>1,)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } function listSubject() { $this->db->select('id,name'); $this->db->from('subject'); $this->db->where(array('status'=>1)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } function listDepartment() { $this->db->select('id,name'); $this->db->from('department'); $this->db->where(array('status'=>1)); $query = $this->db->get(); return $query; } function listDegree() { $this->db->select('id,name'); $this->db->from('degree'); $this->db->where(array('status'=>1)); $query = $this->db->get(); return $query; } function viewSemester($id) { $this->db->select('s.id,s.name,s.year'); $this->db->from('semester as s'); $this->db->where(array('s.status'=>1,'s.id'=>$id)); $query = $this->db->get(); return $query; } function getSemester($id) { $this->db->select('*'); $this->db->from('semester'); $this->db->where(array('status'=>1,'id'=>$id)); $query = $this->db->get(); return $query; } function getSemesterDetail($id) { $this->db->select('*'); $this->db->from('semesterdetail'); $this->db->where(array('status'=>1,'semesterId'=>$id)); $query = $this->db->get(); return $query; } function get_subject($id) { $this->db->select('*'); $this->db->from('subject'); $this->db->where(array('status'=>1,'id'=>$id)); $query = $this->db->get(); return $query; } function getDegree($semesterId) { $this->db->select('deg.id as degId,deg.name as degName,sub.id as subjectId'); $this->db->from('semesterdetail as sd'); $this->db->join('degree as deg','deg.id=sd.degreeId','INNER'); $this->db->join('subject as sub ','sub.id=sd.subjectId','INNER'); $this->db->where(array('sd.status'=>1,'sd.semesterId'=>$semesterId)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } }