#!/usr/bin/perl
print "Content-type: text/html\n\n";
print <<"HTML";
Riverweb Notebook data
HTML
print "Questions
\n";
use DB_File;
$dbmfile = 'riverweb.dbm';
tie %hash, DB_File, $dbmfile; # open database, to be accessed
# prints all elements of hash
while (($key, $val) = each %hash){
($parsedinfo[0], $parsedinfo[1], $parsedinfo[2],
$parsedinfo[3], $keywords, $parsedinfo[4]) = split(/\|/, $val);
# $parsedinfo[0] ID
# $parsedinfo[1] DataType
# $parsedinfo[2] User
# $parsedinfo[3] LinkID
# $keywords
# $parsedinfo[4] Data
# O.K the big issue here is that if I let em go deleting
# questions that are linked, All Hell is going to break loose.
# So you can only delete an question if there is no linkID
# which means they at least need to be able to edit the questions
# with a linkID
# put keywords in their own array
@parsedstring = split(/:/, $keywords);
print "";
if ($parsedinfo[1] eq '1'){
print "\n";
print "Edit | \n";
print "$parsedinfo[4] |
\n";
print "$keywords |
\n";
}
}
print "Responses
\n";
while (($key, $val) = each %hash){
($parsedinfo[0], $parsedinfo[1], $parsedinfo[2],
$parsedinfo[3], $keywords, $parsedinfo[4]) = split(/\|/, $val);
#print "parseDatabaseString vars: $parsedinfo[0], $parsedinfo[1], $parsedinfo[2],
#$parsedinfo[3], $keywords, $parsedinfo[3]
\n";
# put keywords in their own array
@parsedstring = split(/:/, $keywords);
if ($parsedinfo[1] eq '3'){
print "
\n";
print "$parsedinfo[0]
\n";
print "$parsedinfo[1]
\n";
print "$parsedinfo[2]
\n";
print "$parsedinfo[3]
\n";
print "$parsedinfo[4]
\n";
print "$keywords
\n";
}
}
untie %hash; # close database
while (($key, $val) = each %hash){
($parsedinfo[0], $parsedinfo[1], $parsedinfo[2],
$parsedinfo[3], $keywords, $parsedinfo[4]) = split(/\|/, $val);
#print "parseDatabaseString vars: $parsedinfo[0], $parsedinfo[1], $parsedinfo[2],
#$parsedinfo[3], $keywords, $parsedinfo[3]
\n";
# put keywords in their own array
@parsedstring = split(/:/, $keywords);
if ($parsedinfo[1] eq '2'){
print "
\n";
print "$parsedinfo[0]
\n";
print "$parsedinfo[1]
\n";
print "$parsedinfo[2]
\n";
print "$parsedinfo[3]
\n";
print "$parsedinfo[4]
\n";
print "$keywords
\n";
}
}
untie %hash; # close database
while (($key, $val) = each %hash){
($parsedinfo[0], $parsedinfo[1], $parsedinfo[2],
$parsedinfo[3], $keywords, $parsedinfo[4]) = split(/\|/, $val);
#print "parseDatabaseString vars: $parsedinfo[0], $parsedinfo[1], $parsedinfo[2],
#$parsedinfo[3], $keywords, $parsedinfo[3]
\n";
# put keywords in their own array
@parsedstring = split(/:/, $keywords);
if ($parsedinfo[1] eq '4'){
print "
\n";
print "$parsedinfo[0]
\n";
print "$parsedinfo[1]
\n";
print "$parsedinfo[2]
\n";
print "$parsedinfo[3]
\n";
print "$parsedinfo[4]
\n";
print "$keywords
\n";
}
}
untie %hash; # close database
print <<"HTML";
HTML