32 lines
630 B
PHP
32 lines
630 B
PHP
|
<?php
|
||
|
if (!defined('BASEPATH'))
|
||
|
exit('No direct script access allowed');
|
||
|
|
||
|
class Subject_model extends CI_Model {
|
||
|
|
||
|
public function __construct() {
|
||
|
parent::__construct();
|
||
|
}
|
||
|
|
||
|
function list_sub()
|
||
|
{
|
||
|
$this->db->select('*');
|
||
|
$this->db->from('subject');
|
||
|
$this->db->where(array('status'=>1));
|
||
|
$query = $this->db->get();
|
||
|
//echo $this->db->last_query();exit;
|
||
|
return $query;
|
||
|
}
|
||
|
|
||
|
function get_sub($id)
|
||
|
{
|
||
|
$this->db->select('*');
|
||
|
$this->db->from('subject');
|
||
|
$this->db->where(array('status'=>1,'id'=>$id));
|
||
|
$query = $this->db->get();
|
||
|
//echo $this->db->last_query();exit;
|
||
|
return $query;
|
||
|
}
|
||
|
|
||
|
}
|