<?php

namespace App\Models;

use CodeIgniter\Model;

class Model_agama extends Model
{
    public function all_data()
    {
        return $this->db->table('tbl_agama')
            ->orderBy('id_agama', 'DESC')
            ->get()
            ->getResultArray();
    }

    public function add($data)
    {
        $this->db->table('tbl_agama')->insert($data);
    }

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

    public function delete_data($data)
    {
        $this->db->table('tbl_agama')
            ->where('id_agama', $data['id_agama'])
            ->delete($data);
    }
}
