#!D:/Perl/bin/Perl -I D:/Inetpub/wwwroot/demi/html/cgi-bin

use strict;
use CGI qw(-no_xhtml :standard :cgi);
use CGI::Carp qw(fatalsToBrowser set_message);
use HTML::Template;

use DemiConf;
use DemiUtil;
use StringUtil;

BEGIN {
	use File::Basename;
	chdir dirname($0);	
}

my $q = new CGI;

# テンプレート
my @template_buf = openTemplate('./form_input_template_5.html');
my $template = HTML::Template->new(die_on_bad_params => 0, arrayref=>\@template_buf);

# テンプレート用の値
#my $ary_topics_list_flag = ($#ary_topics_list == -1) ? undef : '1';

# テンプレートに値をセット
#$template->param(ary_topics_list => \@ary_topics_list);
#$template->param(ary_topics_list_flag => $ary_topics_list_flag);
my $m = 0;
my $w = "checked";

if ($q->param('gender') eq '男性') {
$m = "checked";
$w = "";
}

$template->param(gender_w => $w);
$template->param(gender_m => $m);

my $y = "checked";
my $n = 0;

if ($q->param('treatment_flag') eq 'なし') {
$y = "";
$n = "checked";
}

$template->param(treatment_flag_1 => $y);
$template->param(treatment_flag_0 => $n);

my %hash_params = ();
my @params = $q->param();
foreach my $param (@params) {
	my $value = $q->param($param);
	$template->param($param => $value);
}


print "Content-Type: text/html;charset=Shift_jis\n\n";

print $template->output;

