<?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 * FROM customer WHERE company = "'. $arr['comnum'] .
                        '" AND customer_username = "' . $arr['uname'] . '" AND customer_password = "' . md5($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");
	}
}
?>
