#!/usr/bin/perl

$IMG_URL="http://particle.phys.uvic.ca/~web-atlas/atlas/feedthroughs/status/image/BrushedMetal.gif";
$BAS_URL="http://particle.phys.uvic.ca/~web-atlas/atlas/feedthroughs/status";
$DAT_URL="http://particle.phys.uvic.ca/~web-atlas/atlas/feedthroughs/status/ElectricalTests/pro/dat";

$query_string = $ENV{'QUERY_STRING'};
($FT, $FTYP) = split (/:/ ,$query_string);

$FTCT = "$DAT_URL/ColdTests/CrossTalk/ctxmima.dat.$FT";
$FTXT = "$DAT_URL/FinalTests/CrossTalk/ftxmima.dat.$FT";
$FTPH = "$DAT_URL/FinalTests/Phred/ftrmima.dat.$FT";
$RTXT = "$DAT_URL/ReceptionTests/CrossTalk/rtxmima.dat.$FT";
# $RTPH = "$DAT_URL/ReceptionTests/Phred/rtrmima.dat.$FT";
$WTXT = "$DAT_URL/WeldTests/CrossTalk/wtxmima.dat.$FT";

$PAGE='<html>
<body style="background-image: url(' . $IMG_URL . ')">
  <font face="Zurich BT" font size=+1 color=darkblue>

    <br> <center> <a href="' . $BAS_URL . '/status.html"> 
      Return to EndCap Signal FeedThrough Production Status </a> </center> <br>

    <center> <font face="Zurich BT" font size=+2 color=red>
      <br> <b> Data Summaries for ' . $FT . ' </b> <br> <br>
    </font> </center>

    <center>

    <hr>

    <br> A summary of component serial numbers, cable positions and types,
         and links to component data for ' . $FT . ' can be found 
         <a href="AtlFtComp.pl?' 
           . $FT . ':' . $FTYP . '">
         <b>here</b></a>. <br> <br>

    <hr>

    <br> Data from cold tests of ' . $FT . ' measured in Victoria <br> <br>

    <table border=1 cellspacing=1 cellpadding=10 cols=3 align=center width=700
      style="background-image: url(BrushedMetal.gif)">
      <tr align=center>
      <td> <a href="' . $FTCT . '"> CrossTalk Data Summary </a> </td>
      <td> <a href="AtlFtMkForm.pl?ColdTests:CrossTalk:' . $FT . ':' . $FTYP . '">View Raw Data</a> </td>
      <td> <a href="AtlFtMkCTLg.pl"> legend </a> </td>
      </tr>
    </table>

    <br><hr>

    <br> Data from the completed ' . $FT . ' measured in Victoria <br> <br>

    <table border=1 cellspacing=1 cellpadding=10 cols=3 align=center width=700
      style="background-image: url(BrushedMetal.gif)">
      <tr align=center>
      <td> <a href="' . $FTXT . '"> CrossTalk Data Summary </a> </td>
      <td> <a href="AtlFtMkForm.pl?FinalTests:CrossTalk:' . $FT . ':' . $FTYP . '">View Raw Data</a> </td>
      <td> <a href="AtlFtMkXTLg.pl"> legend </a> </td>
      </tr>
      <tr align=center>
      <td> <a href="' . $FTPH . '"> Resistance Data Summary </a> </td>
      <td> <a href="AtlFtMkForm.pl?FinalTests:Phred:' . $FT . ':' . $FTYP . '">View Raw Data</a> </td>
      <td> <a href="AtlFtMkPRLg.pl"> legend </a> </td>
      </tr>
    </table>

    <br><hr>

    <br> Data from the completed ' . $FT . ' measured at CERN <br> <br>

    <table border=1 cellspacing=1 cellpadding=10 cols=3 align=center width=700
      style="background-image: url(BrushedMetal.gif)">
      <tr align=center>
      <td> <a href="' . $RTXT . '"> CrossTalk Data Summary </a> </td>
      <td> <a href="AtlFtMkForm.pl?ReceptionTests:CrossTalk:' . $FT . ':' . $FTYP . '">View Raw Data</a> </td>
      <td> <a href="AtlFtMkXTLg.pl"> legend </a> </td>
      </tr>
    </table>

    <br><hr>

    <br> Data from the installed ' . $FT . ' measured at CERN <br> <br>

    <table border=1 cellspacing=1 cellpadding=10 cols=3 align=center width=700
      style="background-image: url(BrushedMetal.gif)">
      <tr align=center>
      <td> <a href="' . $WTXT . '"> CrossTalk Data Summary </a> </td>
      <td> <a href="AtlFtMkForm.pl?WeldTests:CrossTalk:' . $FT . ':' . $FTYP . '">View Raw Data</a> </td>
      <td> <a href="AtlFtMkXTLg.pl"> legend </a> </td>
      </tr>
    </table>

    <br><hr>

    </center>

</body>
</html>';

print "Content-type: text/html\n\n";
print $PAGE;

exit(0);
