#!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_8.html');
my $template = HTML::Template->new(die_on_bad_params => 0, arrayref=>\@template_buf);

my $entry_genre_0 = "";
my $entry_genre_1 = "";

if ($q->param('entry_genre') eq '0') {
$entry_genre_0 = "checked";
$entry_genre_1 = "";
}
if ($q->param('entry_genre') eq '1') {
$entry_genre_0 = "";
$entry_genre_1 = "checked";
}

$template->param(entry_genre_0 => $entry_genre_0);
$template->param(entry_genre_1 => $entry_genre_1);


my $salon_prefecture_1 = "";
my $salon_prefecture_2 = "";
my $salon_prefecture_3 = "";
my $salon_prefecture_4 = "";
my $salon_prefecture_5 = "";
my $salon_prefecture_6 = "";
my $salon_prefecture_7 = "";
my $salon_prefecture_8 = "";
my $salon_prefecture_9 = "";
my $salon_prefecture_10 = "";
my $salon_prefecture_11 = "";
my $salon_prefecture_12 = "";
my $salon_prefecture_13 = "";
my $salon_prefecture_14 = "";
my $salon_prefecture_15 = "";
my $salon_prefecture_16 = "";
my $salon_prefecture_17 = "";
my $salon_prefecture_18 = "";
my $salon_prefecture_19 = "";
my $salon_prefecture_20 = "";
my $salon_prefecture_21 = "";
my $salon_prefecture_22 = "";
my $salon_prefecture_23 = "";
my $salon_prefecture_24 = "";
my $salon_prefecture_25 = "";
my $salon_prefecture_26 = "";
my $salon_prefecture_27 = "";
my $salon_prefecture_28 = "";
my $salon_prefecture_29 = "";
my $salon_prefecture_30 = "";
my $salon_prefecture_31 = "";
my $salon_prefecture_32 = "";
my $salon_prefecture_33 = "";
my $salon_prefecture_34 = "";
my $salon_prefecture_35 = "";
my $salon_prefecture_36 = "";
my $salon_prefecture_37 = "";
my $salon_prefecture_38 = "";
my $salon_prefecture_39 = "";
my $salon_prefecture_40 = "";
my $salon_prefecture_41 = "";
my $salon_prefecture_42 = "";
my $salon_prefecture_43 = "";
my $salon_prefecture_44 = "";
my $salon_prefecture_45 = "";
my $salon_prefecture_46 = "";
my $salon_prefecture_47 = "";

if ($q->param('salon_prefecture') eq '北海道') {
$salon_prefecture_1 = "selected";
}
elsif ($q->param('salon_prefecture') eq '青森県') {
$salon_prefecture_2 = "selected";
}
elsif ($q->param('salon_prefecture') eq '岩手県') {
$salon_prefecture_3 = "selected";
}
elsif ($q->param('salon_prefecture') eq '宮城県') {
$salon_prefecture_4 = "selected";
}
elsif ($q->param('salon_prefecture') eq '秋田県') {
$salon_prefecture_5 = "selected";
}
elsif ($q->param('salon_prefecture') eq '山形県') {
$salon_prefecture_6 = "selected";
}
elsif ($q->param('salon_prefecture') eq '福島県') {
$salon_prefecture_7 = "selected";
}
elsif ($q->param('salon_prefecture') eq '茨城県') {
$salon_prefecture_8 = "selected";
}
elsif ($q->param('salon_prefecture') eq '栃木県') {
$salon_prefecture_9 = "selected";
}
elsif ($q->param('salon_prefecture') eq '群馬県') {
$salon_prefecture_10 = "selected";
}
elsif ($q->param('salon_prefecture') eq '埼玉県') {
$salon_prefecture_11 = "selected";
}
elsif ($q->param('salon_prefecture') eq '千葉県') {
$salon_prefecture_12 = "selected";
}
elsif ($q->param('salon_prefecture') eq '東京都') {
$salon_prefecture_13 = "selected";
}
elsif ($q->param('salon_prefecture') eq '神奈川県') {
$salon_prefecture_14 = "selected";
}
elsif ($q->param('salon_prefecture') eq '新潟県') {
$salon_prefecture_15 = "selected";
}
elsif ($q->param('salon_prefecture') eq '富山県') {
$salon_prefecture_16 = "selected";
}
elsif ($q->param('salon_prefecture') eq '石川県') {
$salon_prefecture_17 = "selected";
}
elsif ($q->param('salon_prefecture') eq '福井県') {
$salon_prefecture_18 = "selected";
}
elsif ($q->param('salon_prefecture') eq '山梨県') {
$salon_prefecture_19 = "selected";
}
elsif ($q->param('salon_prefecture') eq '長野県') {
$salon_prefecture_20 = "selected";
}
elsif ($q->param('salon_prefecture') eq '岐阜県') {
$salon_prefecture_21 = "selected";
}
elsif ($q->param('salon_prefecture') eq '静岡県') {
$salon_prefecture_22 = "selected";
}
elsif ($q->param('salon_prefecture') eq '愛知県') {
$salon_prefecture_23 = "selected";
}
elsif ($q->param('salon_prefecture') eq '三重県') {
$salon_prefecture_24 = "selected";
}
elsif ($q->param('salon_prefecture') eq '滋賀県') {
$salon_prefecture_25 = "selected";
}
elsif ($q->param('salon_prefecture') eq '京都府') {
$salon_prefecture_26 = "selected";
}
elsif ($q->param('salon_prefecture') eq '大阪府') {
$salon_prefecture_27 = "selected";
}
elsif ($q->param('salon_prefecture') eq '兵庫県') {
$salon_prefecture_28 = "selected";
}
elsif ($q->param('salon_prefecture') eq '奈良県') {
$salon_prefecture_29 = "selected";
}
elsif ($q->param('salon_prefecture') eq '和歌山県') {
$salon_prefecture_30 = "selected";
}
elsif ($q->param('salon_prefecture') eq '鳥取県') {
$salon_prefecture_31 = "selected";
}
elsif ($q->param('salon_prefecture') eq '島根県') {
$salon_prefecture_32 = "selected";
}
elsif ($q->param('salon_prefecture') eq '岡山県') {
$salon_prefecture_33 = "selected";
}
elsif ($q->param('salon_prefecture') eq '広島県') {
$salon_prefecture_34 = "selected";
}
elsif ($q->param('salon_prefecture') eq '山口県') {
$salon_prefecture_35 = "selected";
}
elsif ($q->param('salon_prefecture') eq '徳島県') {
$salon_prefecture_36 = "selected";
}
elsif ($q->param('salon_prefecture') eq '香川県') {
$salon_prefecture_37 = "selected";
}
elsif ($q->param('salon_prefecture') eq '愛媛県') {
$salon_prefecture_38 = "selected";
}
elsif ($q->param('salon_prefecture') eq '高知県') {
$salon_prefecture_39 = "selected";
}
elsif ($q->param('salon_prefecture') eq '福岡県') {
$salon_prefecture_40 = "selected";
}
elsif ($q->param('salon_prefecture') eq '佐賀県') {
$salon_prefecture_41 = "selected";
}
elsif ($q->param('salon_prefecture') eq '長崎県') {
$salon_prefecture_42 = "selected";
}
elsif ($q->param('salon_prefecture') eq '熊本県') {
$salon_prefecture_43 = "selected";
}
elsif ($q->param('salon_prefecture') eq '大分県') {
$salon_prefecture_44 = "selected";
}
elsif ($q->param('salon_prefecture') eq '宮崎県') {
$salon_prefecture_45 = "selected";
}
elsif ($q->param('salon_prefecture') eq '鹿児島県') {
$salon_prefecture_46 = "selected";
}
elsif ($q->param('salon_prefecture') eq '沖縄県') {
$salon_prefecture_47 = "selected";
}
$template->param(salon_prefecture_1 => $salon_prefecture_1);
$template->param(salon_prefecture_2 => $salon_prefecture_2);
$template->param(salon_prefecture_3 => $salon_prefecture_3);
$template->param(salon_prefecture_4 => $salon_prefecture_4);
$template->param(salon_prefecture_5 => $salon_prefecture_5);
$template->param(salon_prefecture_6 => $salon_prefecture_6);
$template->param(salon_prefecture_7 => $salon_prefecture_7);
$template->param(salon_prefecture_8 => $salon_prefecture_8);
$template->param(salon_prefecture_9 => $salon_prefecture_9);
$template->param(salon_prefecture_10 => $salon_prefecture_10);
$template->param(salon_prefecture_11 => $salon_prefecture_11);
$template->param(salon_prefecture_12 => $salon_prefecture_12);
$template->param(salon_prefecture_13 => $salon_prefecture_13);
$template->param(salon_prefecture_14 => $salon_prefecture_14);
$template->param(salon_prefecture_15 => $salon_prefecture_15);
$template->param(salon_prefecture_16 => $salon_prefecture_16);
$template->param(salon_prefecture_17 => $salon_prefecture_17);
$template->param(salon_prefecture_18 => $salon_prefecture_18);
$template->param(salon_prefecture_19 => $salon_prefecture_19);
$template->param(salon_prefecture_20 => $salon_prefecture_20);
$template->param(salon_prefecture_21 => $salon_prefecture_21);
$template->param(salon_prefecture_22 => $salon_prefecture_22);
$template->param(salon_prefecture_23 => $salon_prefecture_23);
$template->param(salon_prefecture_24 => $salon_prefecture_24);
$template->param(salon_prefecture_25 => $salon_prefecture_25);
$template->param(salon_prefecture_26 => $salon_prefecture_26);
$template->param(salon_prefecture_27 => $salon_prefecture_27);
$template->param(salon_prefecture_28 => $salon_prefecture_28);
$template->param(salon_prefecture_29 => $salon_prefecture_29);
$template->param(salon_prefecture_30 => $salon_prefecture_30);
$template->param(salon_prefecture_31 => $salon_prefecture_31);
$template->param(salon_prefecture_32 => $salon_prefecture_32);
$template->param(salon_prefecture_33 => $salon_prefecture_33);
$template->param(salon_prefecture_34 => $salon_prefecture_34);
$template->param(salon_prefecture_35 => $salon_prefecture_35);
$template->param(salon_prefecture_36 => $salon_prefecture_36);
$template->param(salon_prefecture_37 => $salon_prefecture_37);
$template->param(salon_prefecture_38 => $salon_prefecture_38);
$template->param(salon_prefecture_39 => $salon_prefecture_39);
$template->param(salon_prefecture_40 => $salon_prefecture_40);
$template->param(salon_prefecture_41 => $salon_prefecture_41);
$template->param(salon_prefecture_42 => $salon_prefecture_42);
$template->param(salon_prefecture_43 => $salon_prefecture_43);
$template->param(salon_prefecture_44 => $salon_prefecture_44);
$template->param(salon_prefecture_45 => $salon_prefecture_45);
$template->param(salon_prefecture_46 => $salon_prefecture_46);
$template->param(salon_prefecture_47 => $salon_prefecture_47);


my $applicant1_gender_m = "";
my $applicant1_gender_w = "";
if ($q->param('applicant1_gender') eq '0') {
$applicant1_gender_m = "checked";
}elsif ($q->param('applicant1_gender') eq '1'){
$applicant1_gender_w = "checked";
}
$template->param(applicant1_gender_m => $applicant1_gender_m);
$template->param(applicant1_gender_w => $applicant1_gender_w);

my $applicant2_gender_m = "";
my $applicant2_gender_w = "";
if ($q->param('applicant2_gender') eq '0') {
$applicant2_gender_m = "checked";
}elsif ($q->param('applicant2_gender') eq '1'){
$applicant2_gender_w = "checked";
}
$template->param(applicant2_gender_m => $applicant2_gender_m);
$template->param(applicant2_gender_w => $applicant2_gender_w);

my $applicant3_gender_m = "";
my $applicant3_gender_w = "";
if ($q->param('applicant3_gender') eq '0') {
$applicant3_gender_m = "checked";
}elsif ($q->param('applicant3_gender') eq '1'){
$applicant3_gender_w = "checked";
}
$template->param(applicant3_gender_m => $applicant3_gender_m);
$template->param(applicant3_gender_w => $applicant3_gender_w);


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;

