2003-12-12 22:17:19 +00:00
< ? php
2007-11-12 22:28:17 +00:00
require_once ( " ../inc/boinc_db.inc " );
2004-02-02 23:34:39 +00:00
require_once ( " ../inc/util.inc " );
2005-01-31 20:35:12 +00:00
require_once ( " ../inc/translation.inc " );
2003-12-12 22:17:19 +00:00
init_session ();
2007-11-12 22:28:17 +00:00
$platforms = BoincPlatform :: enum ( " deprecated=0 " );
2003-12-12 22:17:19 +00:00
2007-03-19 00:10:36 +00:00
$xml = $_GET [ 'xml' ];
if ( $xml ) {
require_once ( '../inc/xml.inc' );
xml_header ();
echo " <app_versions> \n " ;
} else {
2007-11-02 14:43:02 +00:00
page_head ( tra ( " Applications " ));
echo tra ( " %1 currently has the following applications. When you participate in %1, work for one or more of these applications will be assigned to your computer. The current version of the application will be downloaded to your computer. This happens automatically; you don't have to do anything. " , PROJECT ) . " <br><br>
2007-03-19 00:10:36 +00:00
" ;
start_table ();
}
2003-12-12 22:17:19 +00:00
2007-11-12 22:28:17 +00:00
$apps = BoincApp :: enum ( " deprecated=0 " );
2003-12-12 22:17:19 +00:00
2007-11-12 22:28:17 +00:00
foreach ( $apps as $app ) {
2007-03-19 00:10:36 +00:00
if ( $xml ) {
echo " <application> \n " ;
echo " <name> $app->user_friendly_name </name> \n " ;
} else {
echo "
< tr >< th colspan = 3 > $app -> user_friendly_name </ th ></ tr >
2007-11-02 14:43:02 +00:00
< tr >< th > " .tra( " Platform " ). " </ th >< th > " .tra( " Current version " ). " </ th >< th > " .tra( " Installation time " ). " </ th ></ tr > \n
2007-03-19 00:10:36 +00:00
" ;
}
2003-12-12 22:17:19 +00:00
for ( $i = 0 ; $i < sizeof ( $platforms ); $i ++ ) {
$platform = $platforms [ $i ];
$newest = null ;
2007-11-12 22:28:17 +00:00
$avs = BoincAppVersion :: enum ( " appid= $app->id and platformid = $platform->id and deprecated=0 " );
foreach ( $avs as $av ) {
2003-12-12 22:17:19 +00:00
if ( ! $newest || $av -> version_num > $newest -> version_num ) {
$newest = $av ;
}
}
if ( $newest ) {
$y = pretty_time_str ( $newest -> create_time );
2007-03-19 00:10:36 +00:00
if ( $xml ) {
echo " <version> \n " ;
2007-03-19 20:03:06 +00:00
echo " <platform_short> $platform->name </platform_short> \n " ;
echo " <platform_long> $platform->user_friendly_name </platform_long> \n " ;
2007-03-19 00:10:36 +00:00
echo " <version_num> $newest->version_num </version_num> \n " ;
echo " <date> $y </date> \n " ;
2007-03-19 20:03:06 +00:00
echo " <date_unix> $newest->create_time </date_unix> \n " ;
2007-03-19 00:10:36 +00:00
echo " </version> \n " ;
} else {
$x = sprintf ( " %0.2f " , $newest -> version_num / 100 );
echo " <tr>
< td > $platform -> user_friendly_name </ td >
< td > $x </ td >
< td > $y </ td >
</ tr >
" ;
}
2003-12-12 22:17:19 +00:00
}
}
2007-03-19 00:10:36 +00:00
if ( $xml ) {
echo " </application> \n " ;
}
2003-12-12 22:17:19 +00:00
}
2007-11-12 22:28:17 +00:00
2007-03-19 00:10:36 +00:00
if ( $xml ) {
echo " </app_versions> \n " ;
} else {
end_table ();
page_tail ();
}
2003-12-12 22:17:19 +00:00
?>