<?PHP
/******************************************************
    user_ebuilds class

- used to retreive the users ebuild information
******************************************************/

class user_ebuilds{
    
    var 
$packages = array();
    
    function 
user_ebuilds($packages){
        
$this->packages $packages;
    }
    
    function 
get_all(){
        
$data = array();
        
        if(
count($this->packages) > 0){
            
$sql "SELECT package_title, category_title, package_p, ebuild_description, MAX(ebuild_display) ebuild_display
                    FROM ebuild, package, category 
                    WHERE package_f = package_p 
                        AND category_f = category_p 
                        AND `ebuild`.`_removed` IS NULL 
                        AND package_p IN ("
.implode(','$this->packages).")
                    GROUP BY package_p
                    ORDER BY category_title, package_title"
;
            
            
$results mysql_query($sql) or die(mysql_error());
            while(
$row mysql_fetch_assoc($results)){
                
$data[] = $row;
            }
        }
        
        return 
$data;
    }
    
}

?>