<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Exam_Standard_Model extends CI_Model{
    
    public $table = 'exam_standard';
    
    public function __construct() {
        parent::__construct();
    }
    
    public function get( $examStandard_ID = NULL ){
        if($examStandard_ID==NULL){
                $query = $this->db->get($this->table);
                return $query->result();
        }
        $query = $this->db->get_where( $this->table,array('exam_standard_ID' => $examStandard_ID));
        return $query->row();
    }
    
    public function insert(){
        $data = array(
                'standard_name' => $this->input->post('exam_standard')
                );

		return $this->db->insert($this->table,$data);
    }
    
    public function update(){
        $data = array(
		'standard_name' => $this->input->post('exam_standard')
		);
		$this->db->where('exam_standard_ID', $this->input->post('exam_standard_ID'));
		return $this->db->update($this->table,$data);
    }  
    
    
    public function delete($exam_standard_ID = NULL){
        return $this->db->delete( $this->table, array('exam_standard_ID' => $exam_standard_ID ));
    }
}
