<?php 

namespace App\Models;
use CodeIgniter\Database\ConnectionInterface;

class CIAuthModel {
    
    protected $db;
    
    public function __construct(ConnectionInterface & $db){
        $this->db =& $db;
    }
    
    function validateAdmin($username){
        $sql = "SELECT * FROM tbl_admin WHERE username = '".$username."'";       
        $query = $this->db->query($sql);   
        if($query->getNumRows() > 0) {  
            return $query->getRow();
        } else {
            return null;
        }
    }
    
}