#!/usr/bin/perl ############################################## ############################################## # SCRIPT NAME: Page_Database_Log.cgi # FUNCTION: List all Database Entries ############################################## # MINE: Molecular INformation Explorer # Copyright 2000 Dawn Field. All rights reserved. # The CGI-PERL scripts belonging to MINE # may be used and modified freely, but I do # request that this copyright notice remain attached # to this file/source code. If you make modifications # please do not distribute unless # you fully document the modifications. use CGI; require "CGI-MINE.pl"; use CGI qw/:standard :html3/; # here so the html3 functions like th can be used to make the table below ################# # START EACH MINE CGI SCRIPT ################# # this redirects the error messages to the user's screen # and is useful for debugging CGI scripts! open (STDERR, ">&STDOUT"); # print errors to screen $| = 1; # flush the print buffer continuously # make a new query object using CGI.pm module $query = new CGI; # print the required header and start the web page print $query->header; print $query->start_html('MINE'); # Each time a script is invoked for the first time (or $action undef), # log the visit in the custom MINE server log (see CGI-MINE.pl) # (put this after the header incase an error message is printed) # check value of $action $action = $query->param('action'); if ($action eq undef) {&log();} ####### # START THE WEBPAGE ####### # print the MINE menu &menu; # print out the table of file logs using the code in the CGI-MINE.pl file print "
"; ############ # START FORM ############ print $query->startform(); print "Database Log

"; print "Categories of files in the $database_name

"; # print $query->start_form(-target=>'popup-window' -width=>'800' -height=>'400'); print $query->checkbox_group(-name=>'all_extensions', -values=>[@extensions], -linebreak=>'true', -labels=>\%extensions_labels ); # print some buttons print "

"; print $query->submit('action', 'File Extensions and Category Descriptions'); print "
"; print $query->submit('action', 'Update View!'); print "
"; print $query->submit('action','Show All'); # print a 'clear' button at end of form: script self-calls print "
"; print $query->defaults('Hide All'); print "

"; print $query->endform(); ################# # END FORM ################# ################# # PROCESS FORM ################ # get the values @turned_on = $query->param('all_extensions'); @action = $query->param('action'); ################ IF "Show All" ################ # put in all extensions if select SHOW ALL if ($action =~ /Show/) { @turned_on = @extensions; } ################ IF "List Extension Descriptions" ################ # print a pop-up window with the information if ($action =~ "Category Descriptions") { # print the hash in a table @headings = ('File Extensions','File Descriptions'); @rows = th(\@headings); foreach $key (keys %extensions_labels) { push(@rows,td([$key,$extensions_labels{$key}])); } print table({-border=>undef}, caption(b('Description of File Extensions used in the Database')), Tr(\@rows) ); } # if @turned_on has values make all the columns in the log # the number of extensions called $x = @turned_on; # loop over them to make the view table for ($i = 0; $i <=$x-1; $i++ ) { &get_log("@turned_on[$i]"); print ""; } print "
"; ################# # END PROCESS FORM ################# # PRINT BOTTOM OF EACH WEB PAGE # if $show_source is set to 1 show a link # at the bottom of each script to the source # code - pass the name of this script to the # function in CGI-MINE.pl if ($show_source) { $script_name = $query->script_name(); &source ($script_name); } # attach the MINE copywrite &mine_cp; ################# # END WEBPAGE #################