<%doc>
=head1 NAME

missing_exposures.html

=head1 SYNOPSIS

Use:
    missing_exposures.html?exp="exposure1"&exp="exposure2"&...&exp="exposureN"
    
=head1 Description

This mason component displays the status of the exposures specified using the 
python script written by Serge Chastel.

=head1 ARGUMENTS

=over 4

=item exp

Exposure whose status is to be retrieved.
    
=back

=head1 AUTHOR

Denver Green, E<lt>dgreen@ifa.hawaii.eduE<gt>.

=head1 COPYRIGHT

Copyright 2012 by Institute for Astronomy, University of Hawaii.

=head1 DATE

17-Feb-2012

=cut
</%doc>
<style type="text/css">
	table { color: #000; font-family: 'Lucida Grande', Geneva, Arial, Verdana, sans-serif; font-size: 11px; margin: 0}
	td { color: #000; font-family: 'Lucida Grande', Geneva, Arial, Verdana, sans-serif; font-size: 11px; margin: 0}

	td.htable { width: 3.5em; }
	td.htable1 { width: 3.5em; background-color: #EEEEEE; }
	td.htable2 { width: 3.5em; }
 .darkheader { background-color: #919599; margin-top: 5px; margin-bottom: 5px; font-family: 'Lucida Grande', Geneva, Arial, Verdana, sans-serif; font-weight: bold; font-size: 11px; color: #FFFFFF; }
</style>
<table border=1 cellspacing=0 cellpadding=4>
  <tr>
    <th class="darkheader" scope="col">Exposure</th>
    <th class="darkheader" scope="col">Status</th>
    <th class="darkheader" scope="col">Comment</th>
  </tr>
% for my $line (@result) { my @foo = split /\|/, $line;
  <tr>
    <td align=center>
      <!-- Exposure Name -->
	  	<% $foo[0] %>  
    </td>
    <td align=left>
        <% $foo[1] %>  
    </td>
    <td align=left>
        <% $foo[2] %>  
    </td>
  </tr>
% }
</table>

<%args>
@exp
</%args>

<%init>
my $exp_list = join(' ', @exp);

# Execute ipp_query to get exposure status and save output.
my $cmd = "ipp_query.py $exp_list 2>&1 | sort";
my @result = `$cmd`;

# Debugging code below.
#$r->content_type('text/plain');
#$m->clear_buffer;
#$m->print($cmd, "\n", @result, "\n\n");
#$m->abort;
</%init>
