summaryrefslogtreecommitdiff
path: root/httemplate/browse/queue.cgi
blob: 86d4a20f161d99df7937160abeb53d7062e55f17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<%
#<!-- $Id: queue.cgi,v 1.1 2001-09-11 04:44:58 ivan Exp $ -->

use strict;
use vars qw( $cgi $p ); # $part_referral );
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Date::Format;
use FS::UID qw(cgisuidsetup);
use FS::Record qw(qsearch);
use FS::CGI qw(header menubar popurl table);
use FS::queue;

$cgi = new CGI;

&cgisuidsetup($cgi);

$p = popurl(2);

print $cgi->header( '-expires' => 'now' ), header("Job Queue", menubar(
  'Main Menu' => $p,
#  'Add new referral' => "../edit/part_referral.cgi",
)), &table(), <<END;
      <TR>
        <TH COLSPAN=2>Job</TH>
        <TH>Args</TH>
        <TH>Date</TH>
        <TH>Status</TH>
      </TR>
END

foreach my $queue ( sort { 
  $a->getfield('jobnum') <=> $b->getfield('jobnum')
} qsearch('queue',{}) ) {
  my($hashref)=$queue->hashref;
  my $args = join(' ', $queue->args);
  my $date = time2str( "%a %b %e %T %Y", $queue->_date );
  print <<END;
      <TR>
        <TD>$hashref->{jobnum}</TD>
        <TD>$hashref->{job}</TD>
        <TD>$args</TD>
        <TD>$date</TD>
        <TD>$hashref->{status}</TD>
      </TR>
END

}

print <<END;
    </TABLE>
  </BODY>
</HTML>
END

%>