#!/usr/bin/perl -w
use CGI::Carp qw(fatalsToBrowser);

# ------------------------------------------------------------ #
use DBI ;
use CGI qw(:standard);
require "conf/connect.cgi" ;
require "conf/css.cgi"     ;

# ------------------------------------------------------------ #

$style = &getStyle(param('style'));

$trackurl = 'http://mtm2.com/~tracks';

print "Content-type: text/html\n\n";


# ------------------------------------------------------------ #

# HereDoc output
print <<EOM;
<HTML>
  <head>
    <title>expo2003 - Tracks</title>
      <script language="Javascript">
        if (top.location != location) top.location.href = location.href; 
      </script>
    <script TYPE="text/javascript" LANGUAGE="JavaScript" src="jscommon.js"></script>
  </head>
  <BODY id=all>

<br>
EOM

# ------------------------------------------------------------ #
&ro_connect('tracks');

$SQL = <<SQL;
	SELECT *       
	FROM   tracks
	WHERE   (contest = 'expo 2003' ) 
	ORDER by track ASC
SQL
&Do_SQL;

# ------------------------------------------------------------ #
print <<EOM;
    <table align=center cellspacing=0 cellpadding=5>
      <tr class=header2>
        <td colspan=5>$rv tracks</td>
      </tr>
      <tr class=header1>
        <td>Track/Info</td>
        <td>Maker</td>
        <td>Type/Revue</td>
        <td>Size/Pic</td>
      </tr>
EOM
# ------------------------------------------------------------ #

while ($ary = $sth->fetchrow_hashref) {
	$ID  = $ary->{'ID'} ;
#	$status = $ary->{'status'} ;
	$mtmg = $ary->{'mtmg'} ;
#	$dir = $ary->{'dir'} ;
#	$file = $ary->{'file'} ;
	$track = $ary->{'track'} ;
	$maker = $ary->{'maker'} ;
#	$date = $ary->{'date'} ;
	$type = $ary->{'type'} ;
	$size = $ary->{'size'} ;
#	$DL  = $ary->{'DL'} ;
	$phpbb = $ary->{'phpbb'} ; 
	$pic = $ary->{'pic'} ;
#	$description = $ary->{'description'} ;
	$brief = $ary->{'brief'} ;

if (defined $mtmg) {
$down = qq(<a href="javascript:details($ID)"><font class=nf>${track}</font></a> &nbsp; <font face=wingdings>O</font>);
}
else {
$down = qq(<a href="${trackurl}/dl.cgi?dl=${ID}"><font class=nf>${track}</font></a>);
}

if (defined $brief) {
$detail = qq(<a href="javascript:void(0)" onClick="MyRev($ID)"><font class=nf>$type</font></a>);
}
elsif  ((defined $phpbb) && ($phpbb != '') ) {
$detail = qq(<a href="${forum}${phpbb}" target="_blank"><font class=nf>$type</font></a>);
}
else {
$detail = $type;
}

if ( (defined $pic) && ($pic =~ /\.jpg/i) ) {
$info = qq(<a href="javascript:void(0)" onClick="MyPic($ID)"><font class=nf>${size}</font></a>);
}
else {
$info = $size;
}

print qq(<tr><td nowrap>${down}</td><td nowrap>${maker}</td><td>${detail}</td><td>${info}k</td></tr>\n);
}



# ------------------------------------------------------------ #

# HereDoc output
print <<EOM;
      </table>
    <br>
  </BODY>
</HTML>
EOM

# ------------------------------------------------------------ #

$sth->finish() ;
$dbh->disconnect();

$op_03 = $op_02 = $op_01 = $op_00 = $op_99 = $op_98 = $op_97 = undef ;
$op_a = $op_d = $op_n = $op_m = $op_t = $op_s = $op_w = undef ;
$y = $d = $s = undef ;
$forum = $whatever = $direction = $sortcriteria = undef ;
$rv = $SQL = $ary = $sth = $dbh = undef ;
$ID = $mtmg = $track = $maker = $type = $size = $review = $pic = $brief = undef ;
$down = $detail = $info = undef ;
$style = undef ;

# EOF



