<?php

namespace App\Models;

use CodeIgniter\Model;

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

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

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

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