<?php
defined('BASEPATH') or exit('No direct script access allowed');

class Sejarah_model extends CI_Model
{
    public function get_data($table)
    {
        return $this->db->get($table);
    }

    public function get_sejarah()
    {
        $this->db->select('sejarah');
        $this->db->from('tb_sejarah');
        $query = $this->db->get();

        return $query->result(); // Mengembalikan semua baris sejarah
    }

    public function update_data($data, $table)
    {
        $this->db->where('id_sejarah', $data['id_sejarah']);
        $this->db->update($table, $data);
    }

    public function delete($where, $table)
    {
        $this->db->where($where);
        $this->db->delete($table);
    }
}
