McGansWebsite/admin/application/models/Semester_model.php
dotwingssoftware f34f7c5bdb 20230125
Correction in Semester
2023-01-25 18:17:55 +05:30

84 lines
1.8 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;
}
}