# HG changeset patch
# User df
# Date 1233005272 0
# Node ID 30bbda81f13b5de63899c44d8ccebd657f581869
# Parent bb8e080b25da9edc4947b54551c29f7fe341ff00
Quick statatistic adding and some small text changes.
diff -r bb8e080b25da -r 30bbda81f13b reproctool.cgi
--- a/reproctool.cgi Sun Jan 25 22:34:22 2009 +0000
+++ b/reproctool.cgi Mon Jan 26 21:27:52 2009 +0000
@@ -224,6 +224,11 @@
END
my $pre_reprocess = $db->prepare($sql_reprocess);
+# Global statistical vars
+my ($totalTrit, $totalPyer, $totalMexa, $totalIsog, $totalNocx, $totalZydr,
+ $totalMega, $totalMorp, $totalIsk, $meta0, $meta1, $meta2, $meta3, $meta4,
+ $meta5, $meta6Plus );
+
# Execute, bring back one row per item
my ($tid, $tname, $gname, $meta, $basePrice, $icon,
$ttrit, $tpyer, $tmexa, $tisog, $tnocx, $tzydr, $tmega, $tmorp);
@@ -243,6 +248,11 @@
($mega * $tmega) + ($morp * $tmorp);
my $repDetails = sprintf( "Trit=%d Py=%d Mex=%d Iso=%d Nocx=%d Zyd=%d Mega=%d Morp=%d",
$ttrit, $tpyer, $tmexa, $tisog, $tnocx, $tzydr, $tmega, $tmorp );
+
+ # End statistics.
+ $totalTrit += $ttrit; $totalPyer += $tpyer; $totalMexa += $tmexa;
+ $totalIsog += $tisog; $totalNocx += $tnocx; $totalZydr += $tzydr;
+ $totalMega += $tmega; $totalMorp += $tmorp; $totalIsk += $isk;
$meta = 0 unless defined $meta;
$item = { id => $tid, name => $tname, meta => $meta, icon => $icon,
@@ -270,8 +280,7 @@
-Welcome to the sell, reprocess or keep tool. :)
-
+Results
Here is how it works, the colour coding:
- Items in dark yellow are meta 0.
@@ -299,6 +308,7 @@
Ramm's RDI.
+
END
@@ -338,13 +348,13 @@
switch ($item->{meta})
{
- case 0 { $colour = "#666600"; }
- case 1 { $colour = "#777777"; }
- case 2 { $colour = "#BBBBBB"; }
- case 3 { $colour = "#FFFFFF"; }
- case 4 { $colour = "#4444FF"; }
- case 5 { $colour = "#FF0000"; }
- case [6..30]{ $colour = "#00FF00"; }
+ case 0 { $colour = "#666600"; $meta0 += 1; }
+ case 1 { $colour = "#777777"; $meta1 += 1; }
+ case 2 { $colour = "#BBBBBB"; $meta2 += 1; }
+ case 3 { $colour = "#FFFFFF"; $meta3 += 1; }
+ case 4 { $colour = "#4444FF"; $meta4 += 1; }
+ case 5 { $colour = "#FF0000"; $meta5 += 1; }
+ case [6..30]{ $colour = "#00FF00"; $meta6Plus += 1; }
}
if ($item->{meta} >= 4)
@@ -381,6 +391,43 @@
print<
+
+
+Totals
+END
+# TODO: df wonders if there is a std::map :)
+print "Total ISK baseprice: " . pretty_numbers( $totalIsk ) . "\n";
+print "
Trit: " . pretty_numbers( $totalTrit ) if ($totalTrit>0);
+print "
Py: " . pretty_numbers( $totalPyer ) if ($totalPyer>0);
+print "
Mex: " . pretty_numbers( $totalMexa ) if ($totalMexa>0);
+print "
Iso: " . pretty_numbers( $totalIsog ) if ($totalIsog>0);
+print "
Nox: " . pretty_numbers( $totalNocx ) if ($totalNocx>0);
+print "
Zyd: " . pretty_numbers( $totalZydr ) if ($totalZydr>0);
+print "
Mega: " . pretty_numbers( $totalMega ) if ($totalMega>0);
+print "
Morp: " . pretty_numbers( $totalMorp ) if ($totalMorp>0);
+print "
\n";
+print "
Meta 0: " . pretty_numbers( $meta0 ) . "" if ($meta0>0);
+print "
Meta 1: " . pretty_numbers( $meta1 ) . "" if ($meta1>0);
+print "
Meta 2: " . pretty_numbers( $meta2 ) . "" if ($meta2>0);
+print "
Meta 3: " . pretty_numbers( $meta3 ) . "" if ($meta3>0);
+print "
Meta 4: " . pretty_numbers( $meta4 ) . "" if ($meta4>0);
+print "
Meta 5: " . pretty_numbers( $meta5 ) . " (T2)" if ($meta5>0);
+print "
Meta 6+: " . pretty_numbers( $meta6Plus ) . "" if ($meta6Plus>0);
+
+print<
+
+Credits
+By an idea of hfo ohforf, coded by
+hfo Omnix. From
+Ramm's RDI.
+How about you donate 0.1% of your total (which got calucalted at
+END
+# TODO: Weird things happen when you use the pretty numbers function here :( (replace int)
+print int( $totalIsk /1000 );
+print<hfo which will distribute it towards the
+creators and corperation of this tool that you are using now :). Thanks!