Ignore:
Timestamp:
2003-04-11T17:55:03+12:00 (21 years ago)
Author:
dana
Message:

improving cgi library, functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/cgi-bin/readresults.cgi

    r4114 r4131  
    1212print "</head><body bgcolor=\"#ffffff\">\n";
    1313
    14 ($imageloc) = usabcgi::get_config_info("httpimg");
    15 if(!($imageloc =~ "http")) {$imageloc="http://".$ENV{HTTP_HOST}.$imageloc;}
    16 
    17 print "<table width=\"100%\"><tr>\n<td><h1>Greenstone Usability - Report Details</h1></td>\n";
    18 print "<td align=\"right\">";
    19 if ($imageloc) { print "<img src=\"$imageloc\/usabbanner.gif\" alt=\"Greenstonekoru design\" title=\"Greenstone koru design\">"; }
    20 print "</td>\n</tr></table>";
     14usabcgi::printbanner("Report Details");
    2115usabcgi::printaplinks;
    2216 
    23 if((!($ENV{QUERY_STRING}=~/\d/)) || ($ENV{QUERY_STRING}=~/\D/) ) {
    24     print "<h2>Each report sent has an ID number.  This page needs one of those numbers to work.</h2></body></html>";
    25     die;
    26 }
     17usabcgi::checkidno;
    2718
    28 ($etcfileloc) = usabcgi::get_config_info("gsdlhome");
    29 if(!($etcfileloc =~/\/$/)) {$etcfileloc.="/";}
    30 $etcfileloc .= "etc/usability.txt";
    31 open (FILEIN, $etcfileloc) or die "could not open usability.txt\n";
    32 while(<FILEIN>){
    33     $etcfile.=$_;
    34 }   
    35 close(FILEIN);
    36 
    37 if(!($etcfile=~ /$ENV{QUERY_STRING}/)) {
    38     print "<h2>Each report sent has an ID number.  This program needs one of those ID numbers to work, and the ID number provided wans't found</h2></body></html>"; 
    39     die;
    40 }
    41 
    42 #get the report for whjich details are to be viewed.
    43 $etcfile=~/report-id := $ENV{QUERY_STRING}\&usabend\;\n/;
    44 $report = $&;
    45 $tmp=$';
    46 $tmp=~/----------------------?/;
    47 $report.=$`;
    48 @pairs=split(/\&usabend\;\n/,$report);
    49 foreach $pair (@pairs) {
    50     ($name, $value)= split(/ := /,$pair);
    51     #this adds html tags for breaks
    52     $value =~ s/\n/\<br\>/g;
    53     $reportvals{$name}=$value;
    54 }
    55 
    56 
    57 
     19%reportvals=usabcgi::getusabreportdetails;
    5820
    5921print "<p>Your automatically generated report ID number is: <b>$reportvals{\"report-id\"}</b>";
     
    9355
    9456foreach $key (keys(%reportvals)){
    95     $key=~/-/;
    96     print "<tr><td>$`</td><td>$'</td><td>$reportvals{$key}</td></tr>\n";
     57    if($key ne "update"){
     58    $key=~/-/;
     59    print "<tr><td>$`</td><td>$'</td><td>$reportvals{$key}</td></tr>\n";
     60    }
    9761}
    9862print "</table>\n";
     
    10670sub make_table_entry {
    10771    local ($desc, $entry) = @_;
    108     print "<tr><td class=\"sans\" width=\"50%\"><b>$desc:</b></td>";
     72    print "<tr><td class=\"sans\" width=\"50%\"><strong>$desc:</strong></td>";
    10973    print "<td>$reportvals{$entry}</td></tr>\n";
    11074    delete $reportvals{$entry};
Note: See TracChangeset for help on using the changeset viewer.