comparison reproctool.cgi @ 26:be92d2f1ab3f

Merging -df
author Dominic Cleal <dominic@computerkb.co.uk>
date Sun, 25 Jan 2009 17:31:03 +0000
parents ccbd8fa63b9f b505b076c493
children 789877ff0e1a
comparison
equal deleted inserted replaced
25:ccbd8fa63b9f 26:be92d2f1ab3f
1 #!/usr/bin/perl -T 1 #!/usr/bin/perl -T
2 2
3 use warnings; 3 use warnings;
4 use strict; 4 use strict;
5 5
6 use Switch;
6 use CGI; 7 use CGI;
7 use DBI; 8 use DBI;
8 use LWP::UserAgent; 9 use LWP::UserAgent;
9 use Storable qw/store_fd fd_retrieve/; 10 use Storable qw/store_fd fd_retrieve/;
10 11
214 my $col = 0; 215 my $col = 0;
215 print<<END; 216 print<<END;
216 <html> 217 <html>
217 <head> 218 <head>
218 <style type="text/css"> 219 <style type="text/css">
219 .meta4, .meta5, .meta6, .meta7, .meta8, .meta9 220 .reg
220 {
221 color: #FF0000;
222 }
223 .item
224 { 221 {
225 text-align: center; 222 text-align: center;
226 } 223 }
227 </style> 224 </style>
228 </head> 225 </head>
239 { 236 {
240 print "</tr><tr>\n"; 237 print "</tr><tr>\n";
241 $col = 0; 238 $col = 0;
242 } 239 }
243 240
244 my ($style, $img, $text, $link, $colour); 241 my ($img, $text, $link, $colour);
245 242
246 if (defined $item->{id}) 243 if (defined $item->{id})
247 { 244 {
248 $style = "meta$item->{meta}";
249 if ($igb) 245 if ($igb)
250 { 246 {
251 $img = "typeicon:$item->{id}"; 247 $img = "typeicon:$item->{id}";
252 $link = "showinfo:$item->{id}"; 248 $link = "showinfo:$item->{id}";
253 } 249 }
254 else 250 else
255 { 251 {
256 $img = "$img_http_path/icons/icons_items_png/64_64/icon$item->{icon}.png"; 252 $img = "$img_http_path/icons/icons_items_png/64_64/icon$item->{icon}.png";
257 } 253 }
258 254
259 if ($item->{meta} == 4) 255 switch ($item->{meta})
256 {
257 case 0 { $colour = "#666600"; }
258 case 1 { $colour = "#777777"; }
259 case 2 { $colour = "#BBBBBB"; }
260 case 3 { $colour = "#FFFFFF"; }
261 case 4 { $colour = "#4444FF"; }
262 case 5 { $colour = "#FF0000"; }
263 case [6..30]{ $colour = "#00FF00"; }
264 }
265
266 if ($item->{meta} >= 4)
260 { 267 {
261 $text = $item->{name}; 268 $text = $item->{name};
262 $colour = "#FF0000";
263 } 269 }
264 else 270 else
265 { 271 {
266 $text = $item->{reprocessIsk}; 272 $text = $item->{reprocessIsk};
267 } 273 }
270 { 276 {
271 $text = 'Unknown item'; 277 $text = 'Unknown item';
272 $img = "typeicon:07_15"; 278 $img = "typeicon:07_15";
273 } 279 }
274 280
275 print "<td width='64' class='item'>"; 281 print "<td width='64' class='reg'>";
276 print "<a href='$link'>" if defined $link; 282 print "<a href='$link'>" if defined $link;
277 print "<img src='$img' width='64' height='64' border='1' "; 283 print "<img src='$img' width='64' height='64' border='1' ";
278 print "title=\"$item->{name}\" alt=\"$item->{name} ($item->{reprocessDetails})\" />"; 284 print "title=\"$item->{name}\" alt=\"$item->{name} ($item->{reprocessDetails})\" />";
279 print "</a>" if defined $link; 285 print "</a>" if defined $link;
280 print "<br />"; 286 print "<br />";