<?php
class MLogin extends CI_Model
{
    function __construct()
    {
        parent::__construct();
    }

    function auth_siswa($username, $password) {
        // Validasi input
        if (empty($username) || empty($password)) {
            return false;
        }

        $query = $this->db->query("SELECT * FROM tbl_siswa WHERE nis = ? AND password = ? LIMIT 1", array($username, $password));
        $siswa = $query->row();

        if ($siswa) {
            return $siswa;
        }

        return false;
    }
}
?>
