<?php

namespace App\Models;

use CodeIgniter\Model;

class LoginModel extends Model
{
    protected $DBGroup = 'default';

    public function verify($username, $password)
    {
       
        $user = $this->db->table('tbl_management')
            ->where('username', $username)
            ->where('password', $password)
            ->get()
            ->getRow();

        if ($user) {
            return $user;
        }

        // ---- USER LOGIN ----
        return $this->db->table('tbl_users')
            ->where('username', $username)
            ->where('password', $password)
            ->get()
            ->getRow();
    }
}
