MIF_E31222680/application/models/InformasiSPP_model.php

39 lines
892 B
PHP

<?php
defined('BASEPATH') or exit('No direct script access allowed');
class InformasiSPP_model extends CI_Model
{
public function get_data($table)
{
return $this->db->get($table);
}
public function get_informasispp()
{
$this->db->order_by('bulan', 'ASC');
return $this->db->get('tb_informasispp')->result();
}
public function insert_data($data, $table)
{
$this->db->insert($table, $data);
}
public function update_data($data, $table)
{
$this->db->where('id_spp', $data['id_spp']);
$this->db->update($table, $data);
}
public function get_data_by_id($id_spp)
{
return $this->db->get_where('tb_informasispp', array('id_spp' => $id_spp))->row();
}
public function delete($where, $table)
{
$this->db->where($where);
$this->db->delete($table);
}
}