McGansWebsite/admin/application/models/Semester_model.php
dotwingssoftware f2a40c268b 20230207
1. Have to test and deploy in server.  2. add faculty detail into employee table and student detail  into employee table, 3. Change Teaching Assistant into multiple select 4. User Profile
2023-02-07 18:41:26 +05:30

95 lines
2.2 KiB
PHP

<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Semester_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_semester()
{
$this->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;
}
}