I'm training to build a login system and I have 2 errors:
Undefined variable
And
Call to private method Database::connect()
Database connect file:
class Database 
{
    private $host;
    private $user;
    private $password;
    private $database;
    function __construct($filename)
    {
        if(is_file($filename))
            include $filename;
        else
            throw new Exception("Error!");
        $this->host     = $host;
        $this->user     = $user;
        $this->password = $password;
        $this->database = $database; 
        $this->connect();
    }
    private function connect()
    {
        // connect to the server
        if(!mysqli_connect($this->host,$this->user, $this->password,$this->database))
            throw new Exception("Error: not connected to the server.");
    }
    function close()
    {
        mysql_close();
    }
}
login model:
class Login
{
    private $username;
    private $password;
    private $cxn;
    public function __construct($username,$password)
    {
        $this->setData($username,$password);
        $this->connectToDb();
        $this->getData();
    }
    private function setData($username,$password)
    {
        $this->username = $username;
        $this->password = $password;
    }
    private function connectToDb()
    {
        include   '../model/database.php';
        $config = "../model/config.php";
        $ok = new Database($config);
        $co = $ok->connect();
    }
    public function getData()
    {
        $query =    "SELECT * FROM admin
                    WHERE 
                    'username' = '$this->username' 
                    AND 
                    'password' = '$this->password'";
        $sql   = mysqli_query($ok,$query);
        if (mysqli_num_rows($sql) > 0)
        {
            return  TRUE;
        }
        else
        {
            throw new Exception("Error Processing Request");            
        }
    }
    public function close()
    {
        $this->cxn->close();
    }
}
login controller:
include '../view/login.php';
if (isset($_POST['sub'])) 
{
    $_POST['user'] = $username;
    $_POST['pass'] = $password;
    try 
    {
        include'../model/login.php';
        $login = new login($username,$password);    
        if ($login == TRUE) {
            session_start();
            $_SESSION['username'] = $username;
            header('Location:../view/index.php');
        }
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
 
    