commitall
This commit is contained in:
56
hr/application/models/School_model.php
Normal file
56
hr/application/models/School_model.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
class School_model extends CI_Model
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->db = $this->load->database('schoolSetting', TRUE);
|
||||
}
|
||||
|
||||
public function get_table_info($table_name, $where = '', $sqlQry = '', $order = 'ASC', $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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user