#!/usr/local/bin/perl require '../../sv/yoyaku/jcode.pl'; %input=Introduction(@_); ($next)=($input{'next'}); $ENV{'TZ'} = "JST-9"; ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime(time); $year = 1900 + $year; $month++; $month++ if($next==1); do{ $year++; $month="01"; } if($month==13); $month="0${month}" if((length($month))==1); push(@aria,header()); open(IN,"../../schedule/$year$month.csv2")||do{ print "Content-type: text/html\n\n"; print &jcode::sjis("次月の予定はまだ決定していません。$year$month"); exit; }; while(){ # &utf82sjis(*_); # &jcode'convert(*_,'euc'); @data=split(/,/); push(@aria,"${data[0]}日<\/TD>${data[1]}${data[2]}${data[3]}<\/TD><\/TR>"); } push(@aria,footer()); print "Content-type: text/html\n\n"; printHtml(*aria); # # # sub header{ return < 品川区弓道連盟時間割
${year}年${month}月
変更となる場合がありますので道場内の黒板か、
区生涯スポーツ課に電話でお問い合わせください。

次月 HEAD } # # # sub footer{ return < FOOT } # # OUTPUT Data # sub printHtml{ local(*data)=@_; foreach(@data){ &jcode::h2z_euc(*_); &jcode::tr(*_, ' a-zA-Z0-9', ' a-zA-Z0-9'); # &jcode::tr(*_, ' a-zA-Z0-9、ー', ' a-zA-Z0-9,-'); print &jcode::sjis($_); } } # # Usage : %cgi=INPUT_Introduction(@_); # ~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ # ↑ Association Arragement # sub Introduction{ my(%intro)=@_; local($str,$name,$value); if ($ENV{'REQUEST_METHOD'} eq "POST"){ read(STDIN, $str, $ENV{'CONTENT_LENGTH'}); }else{ $str=$ENV{'QUERY_STRING'}; } undef %intro; foreach(split(/&/, $str)){ $_ =~ tr/+/ /; ($name, $value) = split(/=/, $_); $name =~ s/%([\da-f]{2})/pack(C, hex($1))/eig; $value =~ s/%([\dA-Fa-f]{2})/pack("c", hex($1))/eg; $name=&jcode::euc($name); $value =~ s/&/\&/g; $value =~ s/'/\'/g; $value =~ s/\n/
/g; $value =~ s/\r//g; $value=&jcode::euc($value); &jcode::tr(*value,',','、'); if($value =~ /\x8E/){ @msg=SetMessage('半角カタカナが含まれている'); print "Content-type: text/html\n\n"; printHtml(*msg); exit; }; $intro{$name}=$value; } return %intro; }