#!/usr/local/bin/perl
#
#  Want the script to highlight the users job in the queue, and to give the
#  option of dequeueing the job by clicking on it.
require 'cgi-lib.pl';

$printername= $ENV{'QUERY_STRING'};
$refreshtime = '10';

&ReadParse;
print &PrintHeader;

print "<html><head><title>Queue for $printername</title></head>";


@head = `/home/www/lib/scripts/header`;   # Get the good parts of the header
foreach (@head){
  s|Content-type: text/html| |;
}
print @head;
print "<center><h1>Queue for $printername</h1></center>";
print "<center>";
print "<table width=75%><tr><td>";
print "<pre width=80>";

print `/usr/bin/lpq -P$printername | grep -v $printername`, "\n";
#  Search for the user's name, put items on a print queue into an array, along 
#  with the colour that they are to be displayed in.

print "</pre>" , "\n";

print "</td></tr></table>";
print "</center>";
@foot = `./footer`;   # Get the good parts of the footer
foreach (@foot){
  s|Content-type: text/html| |;
}

print @foot;
print "</body></html>";
exit (0);
