<?php

class Login{

	/*
		The find static method selects categories
		from the database and returns them as
		an array of Category  objects.
	*/
    
	public static function find($arr = array()){
            
		global $db;

		//if (empty($arr)){
                //future ---
                //$sql = 'SELECT uname,access,comp,active,fsize,aapp,bapp FROM user WHERE uname = "'.
                //        $arr['uname'] . '" AND pwd = "' . md5 ($arr['pword']) . '"';
                $sql = 'SELECT uname,access,company,active,fontsize FROM user WHERE uname = "'.
                        $arr['uname'] . '" AND pwd = "' . $arr['pword'] . '"';
                //print_r($sql);
                $st = $db->prepare($sql);

		$test1=$st->execute();
                //print($test);

		// Returns an array of Category objects:
		return $st->fetchAll(PDO::FETCH_CLASS, "Login");
	}
}
?>
