summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcgi-bin/mat.cgi8
1 files changed, 5 insertions, 3 deletions
diff --git a/cgi-bin/mat.cgi b/cgi-bin/mat.cgi
index 793671a..d61db32 100755
--- a/cgi-bin/mat.cgi
+++ b/cgi-bin/mat.cgi
@@ -50,11 +50,13 @@ sub cmd_view($)
my $db = DBI->connect($Config{'database'}, "", "",
{HandleError => \&misconfigured, AutoCommit => 1});
- my $recipe_row = $db->selectrow_arrayref("SELECT name, storage, uri FROM ".
- "recipes AS r JOIN inventory AS i ON i.recipe_id=r.id WHERE i.id=".$id.
- ";");
+ my $recipe_row = $db->selectrow_arrayref("SELECT name, storage, uri, ".
+ "amount, energy FROM recipes AS r JOIN inventory AS i ".
+ "ON i.recipe_id=r.id WHERE i.id=".$id.";");
print $id, "<br />", $$recipe_row[0], "<br />", $$recipe_row[1], "<br />";
+ print ($$recipe_row[3] ? $$recipe_row[3]." g<br />" : ""), "<br />";
+ print ($$recipe_row[4] ? $$recipe_row[4]." kJ<br />" : ""), "<br />";
if(substr($$recipe_row[2], 0, 4) eq "http") {
print '<a href="'.$$recipe_row[2].'">'.$$recipe_row[2].'</a>', "<br />";
} else {