<?php
class InvoiceModel extends CI_Model {
    public function get_item_data($id,$table){
        $info=array();
        $this->db->select('*');
        $this->db->from($table);
        $this->db->where('id',$id);
        $info=$this->db->get()->result_array();
        return $info;     
    }
    
    public function get_fee_data($fee_no){
        $table='student_fee';
        $info=array();
        $this->db->select('*');
        $this->db->from($table);
        $this->db->where('fee_no',$fee_no);
        $info=$this->db->get()->result_array();
        return $info;
    }
    
    public function get_opening_fee_data($id){
        $table='opening_balance_fee';
        $info=array();
        $this->db->select('*');
        $this->db->from($table);
        $this->db->where('id',$id);
        $info=$this->db->get()->result_array();
        return $info;
    }
    
    public function get_fee_structure($fee_head_id,$acedemic_session,$course_id){
        $table='fee_structure';
        $info=array();
        $this->db->select('*');
        $this->db->from($table);
        $this->db->where('fee_head',$fee_head_id);
        $this->db->where('acedemic_session',$acedemic_session);
        $this->db->where('course_id',$course_id);
        $info=$this->db->get()->result_array();
        return $info;
    }

    public function get_table_data($table){
        $info=array();
        $this->db->select('*');
        $this->db->from($table);
        $info=$this->db->get()->result_array();
        return $info;     
    }
    
}