<?php 

class classroom_model extends CI_Model
{

	public function __construct()
	{
		parent::__construct();

		$this->db = $this->load->database('classroom', TRUE);
	}

	public function get_table_info($table_name, $where = '', $sqlQry = '', $order = 'DESC', $limit = FALSE, $offset = FALSE)
	{

		if ($limit)
			$this->db->limit($limit, $offset);

		if ($where != '')
			$this->db->where($where);

		$this->db->order_by($table_name . '.id', $order);
		$query = $this->db->get($table_name);

		if ($sqlQry != '')
			$query = $this->db->query($sqlQry);

		return $query->result_array();
	}

	public function get_table_info_row($table_name, $where = '', $sqlQry = '', $order = 'DESC', $limit = FALSE, $offset = FALSE)
	{

		if ($limit)
			$this->db->limit($limit, $offset);

		if ($where != '')
			$this->db->where($where);

		$this->db->order_by($table_name . '.id', $order);
		$query = $this->db->get($table_name);

		if ($sqlQry != '')
			$query = $this->db->query($sqlQry);

		return $query->row_array();
	}

	public function get_logo_from_setting()
	{
		$this->db->select('*');
		$this->db->from('school_settings');
		$query = $this->db->get();
		return $query->row_array();
	}

}

 ?>