#!/usr/pkg/bin/perl
# $Id: comment.cgi,v 1.6 2000/08/28 10:10:54 tom Exp $
################################################################

use strict;
use lib qw(lib);

use CGI::QueryString;
use CGI::Tools;

use TDS;
use TDS::Comment;

################################################################
my $com = new TDS::Comment;

# すべてを表示の時
if (param('show_all')){
    print "content-type: text/html\n\n";
    print $com->AsHTML(-1);
    exit;
}

my ($name, $comment) = (param('name'), param('comment'));

if (!$name || !$comment){
    print "content-type: text/html\n\n";
    print "<h1>name and comment is required.</h1>\n";
    print qq(<hr><a href="./">back</a>);
    exit;
}

$com->Add($name, $comment);
$com->ShowAccept($name, $comment);


