2023-01-10 09:41:20 +00:00
|
|
|
<?php
|
|
|
|
if (!defined('BASEPATH'))
|
|
|
|
exit('No direct script access allowed');
|
|
|
|
|
|
|
|
class Semester_model extends CI_Model {
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
parent::__construct();
|
|
|
|
}
|
|
|
|
|
2023-01-21 13:41:47 +00:00
|
|
|
function list_semester()
|
2023-01-10 09:41:20 +00:00
|
|
|
{
|
2023-01-25 12:47:55 +00:00
|
|
|
$this->db->select('s.id,s.name,s.year');
|
2023-01-24 10:05:16 +00:00
|
|
|
$this->db->from('semester as s');
|
2023-01-21 13:41:47 +00:00
|
|
|
$this->db->where(array('s.status'=>1,));
|
2023-01-10 09:41:20 +00:00
|
|
|
$query = $this->db->get();
|
2023-01-25 12:47:55 +00:00
|
|
|
//echo $this->db->last_query();exit;
|
2023-01-10 09:41:20 +00:00
|
|
|
return $query;
|
|
|
|
}
|
2023-02-07 13:11:26 +00:00
|
|
|
|
2023-01-25 12:47:55 +00:00
|
|
|
function listSubject()
|
2023-01-21 13:41:47 +00:00
|
|
|
{
|
|
|
|
$this->db->select('id,name');
|
|
|
|
$this->db->from('subject');
|
|
|
|
$this->db->where(array('status'=>1));
|
|
|
|
$query = $this->db->get();
|
2023-01-25 12:47:55 +00:00
|
|
|
//echo $this->db->last_query();exit;
|
2023-01-21 13:41:47 +00:00
|
|
|
return $query;
|
|
|
|
}
|
2023-01-25 12:47:55 +00:00
|
|
|
|
|
|
|
function listDepartment()
|
2023-01-21 13:41:47 +00:00
|
|
|
{
|
|
|
|
$this->db->select('id,name');
|
|
|
|
$this->db->from('department');
|
|
|
|
$this->db->where(array('status'=>1));
|
|
|
|
$query = $this->db->get();
|
|
|
|
return $query;
|
2023-01-25 12:47:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function listDegree()
|
2023-01-21 13:41:47 +00:00
|
|
|
{
|
|
|
|
$this->db->select('id,name');
|
|
|
|
$this->db->from('degree');
|
|
|
|
$this->db->where(array('status'=>1));
|
|
|
|
$query = $this->db->get();
|
|
|
|
return $query;
|
2023-01-24 10:05:16 +00:00
|
|
|
}
|
2023-01-25 12:47:55 +00:00
|
|
|
|
2023-01-24 10:05:16 +00:00
|
|
|
function viewSemester($id)
|
|
|
|
{
|
2023-01-25 12:47:55 +00:00
|
|
|
$this->db->select('s.id,s.name,s.year');
|
2023-01-24 10:05:16 +00:00
|
|
|
$this->db->from('semester as s');
|
|
|
|
$this->db->where(array('s.status'=>1,'s.id'=>$id));
|
|
|
|
$query = $this->db->get();
|
|
|
|
return $query;
|
2023-01-21 13:41:47 +00:00
|
|
|
}
|
2023-01-25 12:47:55 +00:00
|
|
|
|
|
|
|
function getSemester($id)
|
2023-01-10 09:41:20 +00:00
|
|
|
{
|
|
|
|
$this->db->select('*');
|
|
|
|
$this->db->from('semester');
|
2023-01-21 13:41:47 +00:00
|
|
|
$this->db->where(array('status'=>1,'id'=>$id));
|
2023-01-10 09:41:20 +00:00
|
|
|
$query = $this->db->get();
|
|
|
|
return $query;
|
|
|
|
}
|
2023-01-25 12:47:55 +00:00
|
|
|
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)
|
2023-01-24 10:05:16 +00:00
|
|
|
{
|
|
|
|
$this->db->select('*');
|
|
|
|
$this->db->from('subject');
|
|
|
|
$this->db->where(array('status'=>1,'id'=>$id));
|
|
|
|
$query = $this->db->get();
|
|
|
|
return $query;
|
|
|
|
}
|
2023-02-07 13:11:26 +00:00
|
|
|
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;
|
|
|
|
}
|
2023-01-10 09:41:20 +00:00
|
|
|
}
|