McGansWebsite/admin/application/models/Semester_model.php

84 lines
1.8 KiB
PHP
Raw Normal View History

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();
}
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');
$this->db->from('semester as s');
$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-01-25 12:47:55 +00:00
function listSubject()
{
$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;
return $query;
}
2023-01-25 12:47:55 +00:00
function listDepartment()
{
$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()
{
$this->db->select('id,name');
$this->db->from('degree');
$this->db->where(array('status'=>1));
$query = $this->db->get();
return $query;
}
2023-01-25 12:47:55 +00:00
function viewSemester($id)
{
2023-01-25 12:47:55 +00:00
$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;
}
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');
$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)
{
$this->db->select('*');
$this->db->from('subject');
$this->db->where(array('status'=>1,'id'=>$id));
$query = $this->db->get();
return $query;
}
2023-01-10 09:41:20 +00:00
}