#!/usr/local/bin/perl #Shopping System #制作:あびる #http://www.AbiStudio.com/ require './jcode.pl'; require './mimew.pl'; require './custom.cgi'; $infohtml = 'data/info.html'; #インフォメーションタグ $infomhtml = 'data/info_m.html'; #携帯インフォメーションタグ $newhtml = 'data/new.html'; #新商品ヘッダータグ $new_writehtml = 'data/new_write.html'; #新商品紹介タグ $salehtml = 'data/sale.html'; #セールヘッダータグ $sale_writehtml = 'data/sale_write.html'; #セール商品紹介タグ $saleunderhtml = 'data/saleunder.html'; #セール商品紹介下部タグ $menuhtml = 'data/menu.html'; #メニューヘッダータグ $best10html = 'data/best10.html'; #人気商品ヘッダータグ $best10_writehtml = 'data/best10_write.html'; #人気商品リンクタグ $best10under = 'data/best10under.html'; #人気商品下部のタグ $formadd = 'data/formadd.csv'; #注文フォーム追加データ $defcom = 'data/defcom.txt'; #自由コメントのデフォルトテキスト $defsend = 'data/defsend.txt'; #受注から発送にかかる日数データが無い場合のデフォルトテキスト $paysfile = 'data/pays.cgi'; #決済設定ファイル $dicfile = 'data/dic.cgi'; #辞書ファイル $defmax = "29"; #プレビュー数デフォルトマックス値(例:30の場合は29として指定) $defpages = "10"; #ページ枚数表示MAX $seout = 36000; #モバイル版のセッションアウト $from = '−.:_/〜@0123456789abcdefghijklmnopqrstuvwxyzー'; $to = '-.:_/~@0123456789abcdefghijklmnopqrstuvwxyz-'; $shop = $script; $shop =~ s/\.cgi//g; $scriptf =~ s/\.cgi//g; $script = $shop; &decode; &gettime; &gmtget; if($FORM{'cookiehtml'}){ &loaddata; &mycheckcook; &mycheckkeycook; print "Content-type: text/html\n\n"; exit; } if($FORM{'afid'}){ &afidcook; } $simagefld2 = "$simagefld"; if($FORM{'sec'}){ $top = '..'; for($i=0;$i<$FORM{'sec'}-1;$i++){ $top .= '/..'; } if($imagefld !~ /http/){ $imagefld = "$top/$imagefld";#イメージフォルダ } if($simagefld && $simagefld !~ /http/){ $simagefld = "$top/$simagefld"; } $script = "$top/$script"; } $css=<<"EOM"; #全ページ共通スタイルシート EOM $body=<<"EOM"; #BODYタグ
$allpageheadertag EOM $logoimage1 = "\"$sitenamej\""; $titlelogoimage = "\"$sitenamej\""; $method='post'; $accesskey = 'accesskey'; if($ENV{'HTTP_USER_AGENT'} =~ /UP.Browser/i && $ENV{'HTTP_USER_AGENT'} !~ /Vodafone/i){ $mobile = 'e'; }elsif($ENV{'HTTP_USER_AGENT'} =~ /DoCoMo/i){ $mobile = 'i'; }elsif($ENV{'HTTP_USER_AGENT'} =~ /J-PHONE/i || $ENV{'HTTP_USER_AGENT'} =~ /Vodafone/i){ $mobile = 'v'; }elsif($ENV{'HTTP_USER_AGENT'} =~ /ASTEL/i || $ENV{'HTTP_USER_AGENT'} =~ /PDXGW/i || $ENV{'HTTP_USER_AGENT'} =~ /L-mode/i || $FORM{'mobile'} || $FORM{'se'}){ if($FORM{'mobile'}){ $mobile = $FORM{'mobile'}; }else{ $mobile = 1; } } if($mobile eq 'e'){ $method = "get"; $defmax = 9; $inputmoden = 'format="*N"';#デフォルト数字入力属性 $inputmodea = 'format="*m"';#デフォルト半角英文字入力属性 $defmail = '@ezweb.ne.jp';#デフォルトメールアドレス $emj[0] = '';#注目マーク $emj[1] = '';#虫眼鏡 $emj[2] = '';#右矢印 $emj[3] = '';#家 $emj[4] = '';#カート $emj[5] = '';#カメラ $lang[27] = '';#中黒マーク }elsif($mobile eq 'i'){ $defmax = 9; $inputmoden = 'istyle="4"';#デフォルト数字入力属性 $inputmodea = 'istyle="3"';#デフォルト半角英文字入力属性 $defmail = '@docomo.ne.jp';#デフォルトメールアドレス $emj[0] = '';#注目マーク $emj[1] = '';#虫眼鏡 $emj[2] = '';#右矢印 $emj[3] = '';#家 $emj[4] = '';#カート $emj[5] = '';#カメラ $lang[27] = '';#中黒マーク }elsif($mobile eq 'v'){ $method = "get"; $defmax = 9; $accesskey = 'directkey'; # $gifno = 1;#GIF画像は非表示(3GからGIF表示可能) $inputmoden = 'mode="n"';#デフォルト数字入力属性 $inputmodea = 'mode="a"';#デフォルト半角英文字入力属性 $defmail = '@*.vodafone.ne.jp';#デフォルトメールアドレス $emj[0] = '$E/';#注目マーク $emj[1] = '$E4';#虫眼鏡 $emj[2] = '$FT';#右矢印 $emj[3] = '$GV';#家 $emj[4] = '$E>';#カート $emj[5] = '$G(';#カメラ $lang[27] = '$F9';#中黒マーク }elsif($mobile){ $defmax = 9; } if($notmobile && $mobile){ $mobile = ''; } $se = $FORM{'se'}; if($mobile && ($se + $seout) < $times){ $rand = int(rand(999)); $se = "$times"."_$rand"; } $afid = $FORM{'afid'}; $hmsaff = $FORM{'hmsaff'}; $scmaff = $FORM{'scmaff'}; @mobilemail = ( '@docomo.ne.jp', '@docomo-camera.ne.jp', '@ebilling.ne.jp', '@docomo-bill.ne.jp', '@mail.visualnet.mopera.ne.jp', 'vodafone.ne.jp', '@jp-d.ne.jp', '@jp-h.ne.jp', '@jp-t.ne.jp', '@jp-c.ne.jp', '@jp-r.ne.jp', '@jp-k.ne.jp', '@jp-n.ne.jp', '@jp-s.ne.jp', '@jp-q.ne.jp', '@ezweb.ne.jp', '@ido.ne.jp', '@sky.tkk.ne.jp', '@sky.tkc.ne.jp', '@sky.tu-ka.ne.jp', '@pdx.ne.jp', ); $kakuninjava=<<"EOM"; EOM open(CAT,"$catcsv");@cat=;close(CAT); $cookname = 'admin'."$cooknamefk"; &get_cookie; if($FORM{'zoom'} && "$FORM{'pass'}" eq "$mpass"){ &loaddata; &header; $ezoom = $FORM{'zoom'}; &zoomedit; }elsif($FORM{'admindel'}){ # &cartcook; &admindel; # &header; &key; }elsif("$FORM{'mode'}" eq 'adminsort'){ &header; &adminsort; }elsif("$FORM{'mode'}" eq 'mail'){ &header; &mailthanks; }elsif($FORM{'orderdownload'}){ &downloading; exit; }elsif($FORM{'entry'} && "$FORM{'pass'}" eq "$mpass"){ $ne = 1; &header; &zoomedit; }elsif($FORM{'zoom'}){ &loaddata; &mycheckcook; # &mycheckkeycook; &cartcook; &header; &zoom; }elsif($FORM{'mzoom'}){ $FORM{'zoom'} = $FORM{'mzoom'}; &loaddata; &header; &mzoom; #}elsif($FORM{'goods'} && $FORM{'cnt'} && $mobile && $FORM{'mode'} ne 'finalck' && !$FORM{'order'}){ # &loaddata; # &header; # &adressform; }elsif($FORM{'goods'} || $FORM{'mode'} eq 'cartck'){ &loaddata; &mycheckcook; &cartcook; &header; &cartck; }elsif($FORM{'c'}){ &loaddata; &mycheckcook; &catpickup; &key; }elsif($FORM{'key'}){ &loaddata; &mycheckcook; &key; }elsif($FORM{'html'}){ &html; }elsif($FORM{'keyrank'} && "$FORM{'pass'}" eq "$mpass"){ &header; &keyrank; }elsif($FORM{'catedit'} && "$FORM{'pass'}" eq "$mpass"){ &header; &catedit; }elsif($FORM{'mode'} eq 'adressform'){ $cookname = 'mailcheck'."$cooknamefk"; &get_cookie; &header; &adressform; }elsif($FORM{'order'}){ &loaddata; if(!$mobile){ $cookname = 'afidcook'."$cooknamefk"; &get_cookie; $cook = ""; print "Set-Cookie: $cookname=$cook; expires=$gmtcook\n"; } $cookname = 'mailcheck'."$cooknamefk"; &get_cookie; &cartcook; $cook = ""; $cookname = 'shopingcart'."$cooknamefk"; if($mobile){ &set_cookie; }else{ print "Set-Cookie: $cookname=$cook; expires=$gmtcook\n"; } &header; ℴ }elsif($FORM{'mode'} eq 'postseek'){ &header; &postseek; }elsif($FORM{'postin'}){ $cookname = 'mailcheck'."$cooknamefk"; &set_cookie; &header; &postin; &adressform; }elsif($FORM{'mode'} eq 'adentry'){ &adentry; }elsif($FORM{'mode'} eq 'account'){ $cookname = 'mailcheck'."$cooknamefk"; &get_cookie; &header; &account; }elsif($FORM{'mode'} eq 'accountlogin'){ &header; &accountlogin; }elsif($FORM{'mode'} eq 'admin'){ &header; &admin; }elsif($FORM{'mode'} eq 'adminlogin'){ &adminpasscheck; $cookname = 'admin'."$cooknamefk"; &set_cookie; &header; &adminlogin; }elsif($FORM{'mode'} eq 'edit'){ &mailcook; &header; &edit; }elsif($FORM{'mode'} eq 'edit2'){ &mailcook; &printck; &header; &login; }elsif($FORM{'mode'} eq 'alllist'){ &loaddata; &header; &alllist; }elsif($FORM{'mode'} eq 'alllist2'){ &loaddata; &header; &alllist2; }elsif($FORM{'mode'} eq 'sitemap'){ &loaddata; &header; &sitemap; }elsif($FORM{'mode'} eq 'logout'){ $cookname = 'admin'."$cooknamefk";$cook = ''; &set_cookie; &header; &logout; }elsif($FORM{'mode'} eq 'catcnt' && "$FORM{'pass'}" eq "$mpass"){ &loaddata; &header; &catcnt; }elsif($FORM{'mode'} eq "editsave" && "$FORM{'pass'}" eq "$mpass"){ &editsave; # &cartcook; &header; &zoom; }elsif($FORM{'mode'} eq 'finalck'){ $cookname = 'mailcheck'."$cooknamefk"; &set_cookie; &loaddata; &cartcook; &header; &finalck; }elsif("$FORM{'error'}" && "$FORM{'remark'}"){ &loaddata; &header; &gpsng; }elsif($FORM{'ssinavi'}){ &ssinavi; }elsif("$FORM{'pass'}" eq "$mpass"){ &header; &adminlogin; }else{ if($tophtml && !$mobile){ open(LOG,"$tophtml");@log=;close(LOG); print "Content-type: text/html\n\n"; print "@log"; exit; } $toppage = 1; @herecat = split(/\,/,$catname[0]); if($filelockuse){&lock;} open(LOG,"$datafile");@log=;close(LOG); if($datafileadd[0]){ for($i=0;$i<=$#datafileadd;$i++){ open(LOG,"$datafileadd[$i]");@addlog=;close(LOG); push(@log,@addlog); } } if($filelockuse){&unlock;} @sflog = @log; for($i=1;$i<=$#log;$i++){ @data = split(/$lang[222]/,$log[$i]); if( (!$cartgif && $data[3] && $data[33]) || ($cartgif && $data[9] && $data[3])){ push(@fulllog,"$log[$i]"); } } &mycheckcook; $cookname = 'mycheckcook'."$cooknamefk"; &get_cookie; $mycheck = $nowcook; $cookname = 'mycheckkey'."$cooknamefk"; &get_cookie; $mycheckkey = $nowcook; &cartcook; &header; &tophtml; opendir(DIR, $orderfld); @files = readdir(DIR); closedir(DIR); foreach (@files) { if($_ =~ /^t/){ unlink("$orderfld/$_");#ダウンロードファイルを削除する } } } &footer; exit; sub loaddata{ if($filelockuse){&lock;} open(LOG,"$datafile");@log=;close(LOG); if($datafileadd[0]){ for($i=0;$i<=$#datafileadd;$i++){ open(LOG,"$datafileadd[$i]");@addlog=;close(LOG); push(@log,@addlog); } } if($filelockuse){&unlock;} @sflog = @log; for($i=0;$i<=$#log;$i++){ $log[$i] =~ s/"//g; @data = split(/$lang[222]/,$log[$i]); if( (!$cartgif && $data[3] && $data[33]) || ($cartgif && $data[9] && $data[3] && $data[2]) || ("$FORM{'pass'}" eq "$mpass")){ push(@fulllog,"$log[$i]"); if($FORM{'zoom'} && "$FORM{'zoom'}" eq "$data[1]"){ $zhit = 1; @zoomg = @data; $zoomlog = $log[$i]; $zoomg[2] =~ s/
//g; $zoomg[2] =~ s/
//g; if($zoomg[2] =~ /^"/){$zoomg[2] =~ s/"//;$zoomg[2] =~ s/"*$//;} if($zoomg[3] =~ /^"/){$zoomg[3] =~ s/"//;$zoomg[3] =~ s/"*$//;} if($zoomg[4] =~ /^"/){$zoomg[4] =~ s/"//;$zoomg[4] =~ s/"*$//;} last; }elsif($FORM{'goods'} && "$FORM{'goods'}" eq "$data[1]"){ @zoomg = @data; }elsif(!$toppage){ push(@nlog,"$log[$i]"); } } if( (!$cartgif && $data[3] && $data[33]) || ($cartgif && $data[9] && $data[3] && $data[2])){ if("$FORM{'mode'}" eq "catcnt"){ push(@aflog,"$log[$i]"); } } } if($FORM{'zoom'} && !$zhit){ print "Location: $domain/\n\n";exit; } if(!$FORM{'cookiehtml'} && $FORM{'zoom'} && $buffer !~ /\/$/ && !$mobile){ print "Location: $scriptf/zoom_$FORM{'zoom'}/\n\n";exit; } if(!$FORM{'cookiehtml'} && $FORM{'c'} && $buffer !~ /\/$/ && !$mobile){ print "Location: $scriptf/c_$FORM{'c'}/\n\n";exit; } if($FORM{'key'}){ for($ir=0;$ir<=$#redirectkey;$ir++){ if("$FORM{'key'}" eq "$redirectkey[$ir]"){ print "Location: $redirecturl[$ir]\n\n";exit; } } } @log = @nlog; } sub mailcook{ $cookname = 'mailcook'."$cooknamefk"; &get_cookie; if($FORM{'email'}){ print "Set-Cookie: $cookname=$FORM{'email'}; expires=$gmtcook\n"; } } sub mycheckcook{ if(!$mobile){ $cookname = 'mycheckcook'."$cooknamefk"; &get_cookie; if($FORM{'zoom'}){ $zoomg[28] =~ s/ / /g; $zoomg[2] =~ s/
//g; $zoomg[2] =~ s/
//g; $cook = "$FORM{'zoom'},$zoomg[2]<>"; for($ci=0;$ci<=$#ck;$ci++){ @ckdata = split(/\,/,$ck[$ci]); if("$FORM{'zoom'}" ne "$ckdata[0]" && $ckdata[0]){ $cook = "$cook"."$ck[$ci]<>"; if(19 <= $ci){last;} } } if($FORM{'cookiehtml'}){ print "Set-Cookie: $cookname=$cook; expires=$gmtcook\n"; } $mycheck = $cook; }else{ $mycheck = $nowcook; } } } sub afidcook{ if(!$mobile){ $cookname = 'afidcook'."$cooknamefk"; &get_cookie; $cook = "afid,$FORM{'afid'}<>"; print "Set-Cookie: $cookname=$cook; expires=$gmtcook\n"; } } sub mycheckkeycook{ $cookname = 'mycheckkey'."$cooknamefk"; &get_cookie; if($FORM{'zoom'}){ if($zoomg[0] =~ / /){ @keys = split(/ /,$zoomg[0]); }elsif($zoomg[0] =~ / /){ @keys = split(/ /,$zoomg[0]); }else{ $keys[0] = $zoomg[0]; } }else{ @keys = split(/ /,$FORM{'key'}); } $cook = ""; for($i=0;$i<=$#keys;$i++){ $cook = "$keys[$i]<>"; } for($ci=0;$ci<=$#ck;$ci++){ $cook = "$cook"."$ck[$ci]<>"; if(19 <= $ci){last;} } if($FORM{'cookiehtml'}){ print "Set-Cookie: $cookname=$cook; expires=$gmtcook\n"; } } sub cartcook{ $cook = ""; $cookname = 'shopingcart'."$cooknamefk"; &get_cookie; if($FORM{'goods'}){ if(!$FORM{'cnt'}){$FORM{'cnt'} = 1;} for($i=0;$i<=$#ck;$i++){ @datac = split(/\,/,$ck[$i]); $cno = $i + 1; $tmpdata = "$cno,"; if("$datac[1]" eq "$FORM{'goods'}" && $FORM{'cnt'} && "$datac[0]" eq "$FORM{'ckno'}"){ $tmpdata = "$tmpdata$datac[1],$FORM{'cnt'},"; for($ii=3;$ii<=$#datac;$ii++){ $tmpdata .= "$datac[$ii],"; } $cook .= "$tmpdata<>"; $same = 1; }elsif("$datac[1]" eq "$FORM{'goods'}" && "$datac[0]" eq "$FORM{'del'}"){ $same = 1; }elsif("$FORM{'del'}" eq "all"){ $cook = ""; $same = 1; last; # }elsif("$datac[1]" eq "$FORM{'goods'}"){ # $same = 1; # $cook = $nowcook; # last; }else{ for($ii=1;$ii<=$#datac;$ii++){ $tmpdata .= "$datac[$ii],"; } $cook .= "$tmpdata<>"; } } if(!$same){ $cook = "0,$FORM{'goods'},$FORM{'cnt'},$FORM{'sel0'},$FORM{'sel1'},$FORM{'sel2'},$FORM{'sel3'},$FORM{'sel4'},$FORM{'sel5'},$FORM{'sel6'},$FORM{'sel7'},$FORM{'sel8'},$FORM{'sel9'},$FORM{'selhid'},$FORM{'cost'},<>$cook"; } if($mobile){ &set_cookie; }else{ print "Set-Cookie: $cookname=$cook; expires=$gmtcook\n"; } $nowcook = $cook; @ck = split(/<>/,$cook); }elsif($FORM{'order'}){ @datac = split(/\,/,$ck[0]); if($datac[1]){ @workerdata = split(/\//,$userdata[14]); &gettime; if($filelockuse){&lock;} open(LOG,"$orderfld/$orderfile.cgi");@olog=;close(LOG); if(!$olog[1]){$newmon = 1;} for($oi=0;$oi<=$#olog;$oi++){ @odata = split(/$lang[222]/,$olog[$oi]); if(index("$odata[1]", 'd') >= 0){ @odata2 = split(/d/,$odata[1]); $odata[1] = $odata2[0]; } if($odno < $odata[1]){$odno = $odata[1];} } $odno++; if($FORM{'afid'}){ $odno .= "d"."$FORM{'afid'}"; } &mailcomget; if($lang[222] eq '\t'){ push(@olog,$tline); }else{ push(@olog,@newline); } if($newmon){ open(LOG,">$orderfld/$orderfile.cgi");flock(LOG,2);truncate(LOG,0);seek(LOG,0,0);print LOG @olog;close(LOG); chmod(0666,"$orderfld/$orderfile.cgi"); }else{ open(LOG,"+<$orderfld/$orderfile.cgi");flock(LOG,2);truncate(LOG,0);seek(LOG,0,0);print LOG @olog;close(LOG); } if($filelockuse){&unlock;} }else{ $titletagp = $lang[53]; &header; $nojob = "$lang[54]
"; &cartck; &footer; exit; } } $cartcook = $nowcook; @cck = @ck; } sub mailcommake{ if($d[30] && !$d[31]){$d[31] = $d[30];} if($d[30] && $datac[2] == 2){ $cps = $d[30]; }elsif($d[31] && $datac[2] > 2){ $cps = $d[31]; }else{ $cps = $d[6]; } $tcost = $cps * $datac[2]; if($d[8]){ $makercom = "$maker$lang[91]$d[8]"; }else{ $makercom = ""; } if($d[7] && !$sendcosttype){ $sendcom = "\n["."$lang[57]"."]\n$d[7]\n"; }else{ $sendcom = ""; } local($partsno) = &urlencode("$datac[1]"); $tmpcom = ''; $tmpcom2 = ''; for($si=3;$si<=12;$si++){ if($datac[$si]){ @dsel = split(/\_/,$datac[13]); $sim = $si-3; $tmpcom .= <<"EOM"; $dsel[$sim]:$datac[$si] EOM $tmpcom2 .= "/$dsel[$sim]:$datac[$si]"; } } if(!$freeinput && $datac[1]){ $mtcomment = "$d[1] $d[2] $makercom $tmpcom×$datac[2]\n"; $tcomment = <<"EOM"; ================== $lang[58]$orderno [$lang[59]] $datac[1] [$lang[60]] $d[2] $domain/$shop/zoom_$partsno/ $makercom $tmpcom [$lang[61]] $cps $sendcom [$lang[62]] $datac[2] EOM }elsif($datac[1]){ $d[2] = ''; $mtcomment = "$d[1] $d[2] $makercom $freeinput $tmpcom×$datac[2]\n"; $tcomment = <<"EOM"; ================== $lang[58]$orderno [$lang[59]] $datac[1] $freeinput $tmpcom [$lang[61]] $cps $sendcom [$lang[62]] $datac[2] EOM } $mcomment .= "$mtcomment"; $comment .= "$tcomment"; #####A8&JANET $totapcs = $totapcs+$datac[2]; $tota = $cps*$datac[2]; if($taxplus && !$aftax){ $cpsf = int($cps / 1.05); $totaf = int($tota / 1.05); $subtotalf = $subtotalf + int($totaf / 1.05); }else{ $cpsf = $cps; $totaf = $tota; $subtotalf = $subtotalf + $totaf; } $subtotalhms = $subtotalhms + $tota; $sidata = "$sidata"."&si=$cpsf.$datac[2].$totaf.$partsno"; $jodata = "$jodata"."$partsno/$datac[2]/$cpsf:"; $scdata = "$scdata"."&sid=$partsno.$cpsf.$datac[2]"; $netalliancedata = "$netalliancedata"."$cpsf".'_'."$datac[2]".'_'."$partsno".'-'; #####A8&JANET ##### デジタルチェック $cardk++; $cardtota = $tota; $carddata = "$carddata".""; ##### デジタルチェック if("$nline2" eq '8'){ $nline[2] = $d[8]; }else{ $nline[2] = $d[0]; } if($lang[222] eq '\t'){ $tline .=<<"EOM"; $acdate\t$odno\t$nline[2]\t$datac[1]\t$d[2]$freeinput$tmpcom2\t$cps\t$datac[2]\t$tcost\t$totaf\t\t$FORM{'email'}\t$FORM{'name'}\t$FORM{'post'}\t$adresst\t$FORM{'tel'}\t$FORM{'pay'}\t$freecomment\t$fmdat\t EOM }else{ push(@newline,"$acdate$lang[222]$odno$lang[222]$nline[2]$lang[222]$datac[1]$lang[222]$d[2]$freeinput$tmpcom2$lang[222]$cps$lang[222]$datac[2]$lang[222]$tcost$lang[222]$totaf$lang[222]$lang[222]$FORM{'email'}$lang[222]$FORM{'name'}$lang[222]$FORM{'post'}$lang[222]$adresst$lang[222]$FORM{'tel'}$lang[222]$FORM{'pay'}$lang[222]$freecomment$lang[222]$fmdat\n"); } # push(@newline, $tline); if($maxsendcost < $d[7]){$maxsendcost = $d[7];} $subtotal = $subtotal + ($datac[2] * $cps); if(!$sendcosttype){ $subtotals = $subtotals + ($datac[2] * $d[7]); } $subtotalc = $subtotalc + $datac[2]; } sub mailcomget{ $adresst = "$FORM{'adress'}$FORM{'adress2'}"; $freecomment = $FORM{'freecomment'}; $adresst =~ s/
/ /g; $freecomment =~ s/
/ /g; $FORM{'adress'} =~ s/
/\n/g; $FORM{'adress2'} =~ s/
/\n/g; $FORM{'freecomment'} =~ s/
/\n/g; open(PY,"$paysfile");@pays=;close(PY); open(FM,"$formadd");@fm=;close(FM); for($ifm=1;$ifm<=$#fm;$ifm++){ $fma = "formadd$ifm"; @fmdata = split(/$lang[222]/,$fm[$ifm]); $fmdat .= "$FORM{$fma}$lang[222]"; if($FORM{$fma}){ $fmtmp = &tagdel($fmdata[0]); $fmmail .= "\n[$fmtmp]\n$FORM{$fma}\n"; } } $fmdat =~ s/
/ /g; $fmmail =~ s/
/\n/g; if($sendfreecost){ for($ic=0;$ic<=$#ck;$ic++){ @datac = split(/\,/,$ck[$ic]); $hit = 0; &costcount; } if($sendfreecost <= $subtotal){ $sendfreeflg = 1; } $subtotal = 0; $subtotals = 0; $subtotalc = 0; } if($areasendfile && !$sendfreeflg){ $adress = $FORM{'adress'}; for($ifm=1;$ifm<=$#fm;$ifm++){ $fma = "formadd$ifm"; if($FORM{$fma}){ @fmdata = split(/$lang[222]/,$fm[$ifm]); if($fmdata[5] eq '3'){ $adress = $FORM{$fma}; last; } } } &areasendget; } for($i=0;$i<=$#ck;$i++){ @datac = split(/\,/,$ck[$i]); $hit = ''; for($icc=0;$icc<=$#sflog;$icc++){ @d = split(/$lang[222]/,$sflog[$icc]); if("$d[1]" eq "$datac[1]"){ $d[2] =~ s/
//g; $d[2] =~ s/
//g; $hit = 1; last; } } $freeinput = ''; if(!$hit && $datac[14]){ @d = (); $d[1] = $datac[1]; $d[2] = $datac[3]; $d[6] = $datac[14]; $d[9] = 'm'; $hit = 1; $freeinput = "($lang[64])"; } if($hit){ $orderno = $i + 1; &mailcommake; } } for($pi=1;$pi<=$#pays;$pi++){ @dp = split(/$lang[222]/,$pays[$pi]); if("$FORM{'pay'}" eq "$dp[0]"){ $tesuryo = $dp[4]; $dp[1] =~ s/
/\n/g; last; } } &totalcostcount; $newline[0] =~ s/\s*$//; @np = split(/$lang[222]/,$newline[0]); for($in=0;$in<=$#np;$in++){ if($in == 9){ $npl .= "$totalsu$lang[222]"; }else{ $npl .= "$np[$in]$lang[222]"; } } $npl =~ s/$lang[222]*$//; splice(@newline,0,1,"$npl\n"); if(!$taxplus){ $tax = &addcamma($tax); } if($sendfreeflg){ $sc = "\n["."$lang[57]"."]\n$lang[65]\n"; }elsif($areasendfile){ $areasendcost = &addcamma($areasendcost); $sc = "\n["."$lang[57]"."]\n$lang[7]$areasendcost$lang[6]\n"; $msc = "$lang[57] $lang[7]$areasendcost$lang[6]\n"; }elsif($sends){ if($sends < 0){$tmps = "$lang[66]";} $sends = &addcamma($sends); $sc = "\n["."$lang[57]"."$tmps]\n$lang[7]$sends$lang[6]\n"; $msc = "$lang[57]$tmps $lang[7]$sends$lang[6]\n"; } if($tesuryo){ $tc = "\n["."$lang[67]"."]\n$lang[7]$tesuryo$lang[6]\n"; $mtc = "$lang[67] $lang[7]$tesuryo$lang[6]\n"; } $total = &addcamma($total); $mcomment .= "$msc$mtc$lang[68] $lang[7]$total$lang[6]"; $FORM{'adress'} =~ s/
/\n/g; $FORM{'adress2'} =~ s/
/\n/g; $FORM{'freecomment'} =~ s/
/\n/g; if(!$taxplus){ $tax = "$lang[7]$tax$lang[6]"; }else{ $tax = "$lang[75]"; } if($lang[70]){ $comment .= <<"EOM"; ================== [$lang[69]] $lang[7]$subtotal$lang[6] $sc [$lang[70]] $tax $tc [$lang[68]] $lang[7]$total$lang[6] [$lang[71]] $FORM{'pay'} $dp[1] ================== $lang[72] $lang[73]$FORM{'post'} $FORM{'adress'}$FORM{'adress2'} $FORM{'name'}($FORM{'name2'}) TEL $FORM{'tel'} mailto:$FORM{'email'} $fmmail [$lang[74]] $FORM{'freecomment'} EOM }else{ $comment .= <<"EOM"; ================== [$lang[69]] $lang[7]$subtotal$lang[6] $sc $tc [$lang[68]] $lang[7]$total$lang[6] [$lang[71]] $FORM{'pay'} $dp[1] ================== $lang[72] $FORM{'name'} $FORM{'adress2'} $lang[73]$FORM{'post'} $FORM{'adress'} Phone:$FORM{'tel'} mailto:$FORM{'email'} $fmmail [$lang[74]] $FORM{'freecomment'} EOM } } sub postin{ @tp = (# 都道府県別対象ファイルと郵便番号の下限〜上限数値 '', '北海道<>01hokkai.csv<>0010000<>0996506<>', '青森県<>02aomori.csv<>0185501<>0395312<>', '岩手県<>03iwate.csv<>0200000<>0295701<>', '宮城県<>04miyagi.csv<>9800000<>9896941<>', '秋田県<>05akita.csv<>0100000<>0192742<>', '山形県<>06yamaga.csv<>9900000<>9998531<>', '福島県<>07fukush.csv<>9600000<>9793204<>', '茨城県<>08ibarak.csv<>3000000<>3193705<>', '栃木県<>09tochig.csv<>3114411<>3491221<>', '群馬県<>10gumma.csv<>3700000<>3890121<>', '埼玉県<>11saitam.csv<>3300000<>3691912<>', '千葉県<>12chiba.csv<>2600000<>2995506<>', '東京都<>13tokyo.csv<>1000000<>2080035<>', '神奈川県<>14kanaga.csv<>1990100<>2591335<>', '新潟県<>15niigat.csv<>3892261<>9594616<>', '富山県<>16toyama.csv<>9300001<>9398282<>', '石川県<>17ishika.csv<>9200000<>9390171<>', '福井県<>18fukui.csv<>9100001<>9220679<>', '山梨県<>19yamana.csv<>4000000<>4093867<>', '長野県<>20nagano.csv<>3800801<>9498321<>', '岐阜県<>21gifu.csv<>5000000<>5099232<>', '静岡県<>22shizuo.csv<>4100000<>4390037<>', '愛知県<>23aichi.csv<>4314121<>4980068<>', '三重県<>24mie.csv<>4980000<>6471325<>', '滋賀県<>25shiga.csv<>5200000<>5291851<>', '京都府<>26kyouto.csv<>5200461<>6293579<>', '大阪府<>27osaka.csv<>5300000<>6300272<>', '兵庫県<>28hyogo.csv<>5630801<>6795654<>', '奈良県<>29nara.csv<>6300000<>6480309<>', '和歌山県<>30wakaya.csv<>5195600<>6497216<>', '鳥取県<>31tottor.csv<>6800000<>6895673<>', '島根県<>32shiman.csv<>6840100<>6995637<>', '岡山県<>33okayam.csv<>7000000<>7193814<>', '広島県<>34hirosh.csv<>7200001<>7392125<>', '山口県<>35yamagu.csv<>7400000<>7596614<>', '徳島県<>36tokush.csv<>7700000<>7795453<>', '香川県<>37kagawa.csv<>7600000<>7692908<>', '愛媛県<>38ehime.csv<>7900001<>7993772<>', '高知県<>39kochi.csv<>7800000<>7891936<>', '福岡県<>40fukuok.csv<>8000000<>8710928<>', '佐賀県<>41saga.csv<>8400001<>8495264<>', '長崎県<>42nagasa.csv<>8115100<>8596415<>', '熊本県<>43kumamo.csv<>8600001<>8696405<>', '大分県<>44oita.csv<>8391421<>8797885<>', '宮崎県<>45miyaza.csv<>8800000<>8894602<>', '鹿児島県<>46kagosh.csv<>8900000<>8998608<>', '沖縄県<>47okinaw.csv<>9000000<>9071801<>', ); $post = "$FORM{'post'}"; &jcode'tr(*post,$from,$to); $FORM{'post'} = $post; $post =~ s/\-//g; for ($i=0; $i<$#tp+1; $i++){ @bdata = split(/<>/,$tp[$i]); if($post >= $bdata[2] && $post <= $bdata[3]){ open(LOG,"$postfld/$bdata[1]");@log=;close(LOG); for($il=0;$il<=$#log;$il++){ @postdata = split(/\,/, $log[$il]); $postdata[2] =~ s/\"//g; if("$postdata[2]" eq "$post"){ $FORM{'adress'} = "$postdata[6]$postdata[7]$postdata[8]"; $FORM{'adress'} =~ s/\"//g; $FORM{'adress'} =~ s/以下に掲載がない場合//g; $hit = 1; last; } } if($hit){last;} } } if(!$FORM{'adress'}){ print <<"EOM";
その郵便番号では該当する住所がありません。
EOM } } sub postseek{ print <<"EOM";
住所の一部から郵便番号を調べたい方はこちらをご利用ください。


例:南青山

Search by ツカエルサイト
EOM } sub areasendget{ open(FM,"$areasendfile");@areasend=;close(FM); for($ia=0;$ia<=$#areasend;$ia++){ @asend = split(/\,/,$areasend[$ia]); if(index("$adress", "$asend[0]") >= 0){ $asend[1] =~ s/\s*$//; $areasendcost = $asend[1]; last; } } if(!$areasendcost){ $mes .= "$lang[76]
"; } } sub finalck{ open(FM,"$formadd");@fm=;close(FM); if(!$FORM{'name'}){ $mes .= "$lang[77]
"; } if(!$FORM{'name2'} && $lang[78]){ $mes .= "$lang[78]
"; } if(!$FORM{'post'} && !$postalno){ $mes .= "$lang[79]
"; } if(!$FORM{'adress'}){ $mes .= "$lang[80]
"; } if(!$mobile && !$FORM{'adress2'}){ $mes .= "$lang[81]
"; } if($areasendfile){ $adress = $FORM{'adress'}; for($ifm=1;$ifm<=$#fm;$ifm++){ $fma = "formadd$ifm"; if($FORM{$fma}){ @fmdata = split(/$lang[222]/,$fm[$ifm]); if($fmdata[5] eq '3'){ $adress = $FORM{$fma}; last; } } } &areasendget; } if(!$FORM{'tel'}){ $mes .= "$lang[82]
"; } if(!$FORM{'email'}){ $mes .= "$lang[83]
"; }elsif($FORM{'email'} && ($FORM{'email'} !~ /^[^@]+@[^.]+\..+/ || $FORM{'email'} =~ /\,/)){ $mes .= "$lang[84]
"; }elsif(!$mobile && "$FORM{'email'}" ne "$FORM{'email2'}"){ $mes .= "$lang[84]
"; } if(!$FORM{'pay'}){ $mes .= "$lang[85]
"; } open(PY,"$paysfile");@pays=;close(PY); for($pi=1;$pi<=$#pays;$pi++){ @dp = split(/$lang[222]/,$pays[$pi]); if("$dp[0]" eq "$FORM{'pay'}"){ $tesuryo = $dp[4]; if($dp[7]){ for ($im=0; $im<=$#mobilemail; $im++){ if($FORM{'email'} =~ /$mobilemail[$im]$/){ $mes .= "$dp[0]$lang[86]
"; last; } } } } } if($mes){ print <<"EOM";
$mes

$lang[87]
EOM &footer; exit; } $datac[1] = $FORM{'goods'}; $datac[2] = $FORM{'cnt'}; $hstep = 3; if(!$mobile){ &flowtag; print <<"EOM"; $flowtag
$lang[88]
EOM if($basebarcol eq '#FFF'){ print <<"EOM"; EOM }else{ print <<"EOM"; EOM } print <<"EOM"; EOM } @ck = split(/<>/,$cartcook); if($sendfreecost){ for($ic=0;$ic<=$#ck;$ic++){ @datac = split(/\,/,$ck[$ic]); $hit = 0; &costcount; } if($sendfreecost <= $subtotal){ $sendfreeflg = 1; } $subtotal = 0; $subtotals = 0; $subtotalc = 0; } for($ic=0;$ic<=$#ck;$ic++){ @datac = split(/\,/,$ck[$ic]); &costcount; if(!$tcns){$tcns=0;} if($mobile){ print <<"EOM"; $d[2]($d[1])
EOM }else{ print <<"EOM"; EOM } } &totalcostcount; if($mobile){ print <<"EOM"; $lang[69]:$lang[7]$subtotal$lang[6]
EOM }else{ print <<"EOM"; EOM } if($sendfreeflg){ if($mobile){ print <<"EOM"; $lang[57]:$lang[65]
EOM }else{ print <<"EOM"; EOM } }elsif($areasendcost){ if($mobile){ print <<"EOM"; $lang[57]:$lang[7]$areasendcost$lang[6]
EOM }else{ print <<"EOM"; EOM } }elsif($sends){ if($mobile){ print <<"EOM"; $lang[57]:$lang[7]$sends$lang[6]
EOM }else{ print <<"EOM"; EOM } } if(!$taxplus && $lang[70]){ if($mobile){ print <<"EOM"; $lang[70]:$lang[7]$tax$lang[6]
EOM }else{ print <<"EOM"; EOM } }elsif($lang[70]){ if($mobile){ print <<"EOM"; $lang[70]:$lang[75]
EOM }else{ print <<"EOM"; EOM } } if($tesuryo){ if($mobile){ print <<"EOM"; $lang[67]:$lang[7]$tesuryo$lang[6]
EOM }else{ print <<"EOM"; EOM } } if($mobile){ print <<"EOM"; $lang[68]:$lang[7]$total$lang[6]

$lang[27]$lang[93]
EOM }else{ print <<"EOM";
$lang[89]$lang[89]
$lang[60] $lang[61] $lang[62] $lang[69]
$d[2]($d[1])
EOM } for($si=3;$si<=12;$si++){ if($datac[$si]){ @dsel = split(/\_/,$datac[13]); $sim = $si-3; print <<"EOM"; $dsel[$sim]$lang[91]$datac[$si]
EOM } } if($mobile){ print <<"EOM"; $lang[7]$tcnt$lang[6]$lang[92]$datac[2]
EOM }else{ print <<"EOM";
$lang[7]$tcnt$lang[6] $datac[2] $lang[7]$subtcnt$lang[6]
$lang[69] $lang[7]$subtotal$lang[6]
$lang[57] $lang[65]
$lang[57] $lang[7]$areasendcost$lang[6]
$lang[57] $lang[7]$sends$lang[6]
$lang[70] $lang[7]$tax$lang[6]
$lang[70] $lang[75]
$lang[67] $lang[7]$tesuryo$lang[6]
$lang[68] $lang[7]$total$lang[6]
EOM if($basebarcol eq '#FFF'){ print <<"EOM"; EOM }else{ print <<"EOM"; EOM } print <<"EOM"; EOM } for($ifm=1;$ifm<=$#fm;$ifm++){ $fma = "formadd$ifm"; if($FORM{$fma}){ @fmdata = split(/$lang[222]/,$fm[$ifm]); $fmdata[0] =~ s/
//g; $fmdata[0] =~ s/
//g; if($mobile){ print <<"EOM"; $fmdata[0]:$FORM{$fma}
EOM }else{ print <<"EOM"; EOM } } } for($pi=1;$pi<=$#pays;$pi++){ @dp = split(/$lang[222]/,$pays[$pi]); if("$dp[0]" eq "$FORM{'pay'}"){ $hit = 1; if($dp[5] && ($totalsu - $tesuryosu) < $dp[5]){ $pmes = "総額が$dp[5]円未満のため、$FORM{'pay'}はご利用いただけません。"; } if($dp[6] && ($totalsu - $tesuryosu) > $dp[6]){ $pmes = "総額が$dp[6]円以下ではないため、$FORM{'pay'}はご利用いただけません。"; } } } if(!$hit){$pmes = "
$lang[85]
";} if(!$pmes){$pmes = "$FORM{'pay'}";} if($mobile){ print <<"EOM"; $lang[71]:$pmes
EOM }else{ print <<"EOM"; EOM } if($FORM{'freecomment'}){ if($mobile){ print <<"EOM"; $lang[74]:$FORM{'freecomment'}
EOM }else{ print <<"EOM"; EOM } } if(!$mobile){ print <<"EOM";
$lang[89]$lang[93]
$lang[113] EOM } if($FORM{'name2'}){ print <<"EOM"; $lang[73]$FORM{'post'}
$FORM{'adress'}$FORM{'adress2'}
$FORM{'name'}($FORM{'name2'}) $lang[94]
EOM }else{ print <<"EOM"; $FORM{'name'} $lang[94]
$FORM{'adress2'}
$lang[73]$FORM{'post'}
$FORM{'adress'}
EOM } if($mobile){ print <<"EOM"; $FORM{'email'}
$lang[121]:$FORM{'tel'}
EOM }else{ print <<"EOM"; mailto:$FORM{'email'}
$lang[121] $FORM{'tel'}
$fmdata[0] $FORM{$fma}
$lang[71] $pmes
$lang[74] $FORM{'freecomment'}
EOM } if("$pmes" eq "$FORM{'pay'}"){ if($mobile){ print <<"EOM";
$lang[95]

EOM }else{ print <<"EOM";
$lang[95]
EOM if($basebarcol eq '#FFF'){ print <<"EOM";
EOM }else{ print <<"EOM";
EOM } print <<"EOM";
EOM } } if($mobile){ print <<"EOM"; EOM }else{ print <<"EOM";
EOM } } sub order{ $subject = $checkmailsub; $modno[0] = substr($odno, 0, 4); $modno[1] = substr($odno, 4); $mcomment = <<"EOM"; [$lang[97]] $lang[98]$lang[91]$modno[0]_$modno[1] $mcomment [$lang[99]] $FORM{'pay'} $dp[1] $lang[100] $lang[73]$FORM{'post'} $FORM{'adress'} $FORM{'name'} TEL $FORM{'tel'} $mmailfooter EOM $comment = <<"EOM"; $lang[255]$FORM{'name'} $lang[94] $checkmailhead $lang[98]$lang[91]$odno $comment $mailfooter EOM if($mobile){$fstitle = "$lang[101]";} $pccomment = $comment; for($i=0;$i<=$#mailto;$i++){ $mmail = 0; for ($im=0; $im<$#mobilemail+1; $im++){ if($mailto[$i] =~ /$mobilemail[$im]$/){ $mmail = "1"; last; } } if($mmail){ $comment = $mcomment; }else{ $comment = $pccomment; } &send_email("$subject$fstitle", $FORM{'email'}, $mailto[$i], '', '', $comment); if($mailbcc){ $bcc .= "$mailto[$i],"; } } $mmail = 0; for ($im=0; $im<$#mobilemail+1; $im++){ if($FORM{'email'} =~ /$mobilemail[$im]$/){ $mmail = "1"; last; } } if($mmail){ $comment = $mcomment; }else{ $comment = $pccomment; } &send_email($subject, $mailfrom, $FORM{'email'}, $mailcc, $bcc, $comment); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); if ($year > 50) {$year += 1900 ;} else{$year += 2000 ;} $mon++; $date = sprintf("%04d%02d%02d%02d%02d%02d",$year,$mon,$mday,$hour,$min,$sec); if($mobile){ print <<"EOM"; $lang[102]< $FORM{'email'} >$lang[103]$lang[105]
EOM if($afid){ &afmreg($afid,$subtotalf,$odno); } if($hmsaff){ &hmsaff("$hmsaff&price=$subtotalhms"); } if($scommercem && $scmaff){ &scmsaff("ckcbnobt=$scmaff&cid=$scommercem&ri=$odno$scdata"); } }else{ $suborder=1; $hstep = 4; &flowtag; if($a8fly){ print <<"EOM";
EOM } if($janetfly){ $jodata =~ s/\:*$//; print <<"EOM";
EOM } if($bottomline){ print <<"EOM";
EOM } if($scommerce){ print <<"EOM";
EOM } if($netalliance){ $netalliancedata =~ s/\-*$//; print <<"EOM";
EOM } if($masellfly){ print <<"EOM";
EOM } print <<"EOM";
$flowtag
$lang[102]< $FORM{'email'} >$lang[103]

EOM if($dp[2] eq 'digitalcheck_eng'){#デジタルチェック英語 print <<"EOM";
$lang[104]

$carddata

EOM }elsif($dp[2] =~ /^digitalcheck/ && $dp[2] !~ /conveni/ && $dp[2] !~ /daibiki/){#デジタルチェック if($dp[2] eq 'digitalcheck_a'){ $dgurl = 'https://www.c-check.co.jp/cgi-bin/bp/bp32.dll'; }elsif($dp[2] eq 'digitalcheck_b'){ $dgurl = 'https://www.digitalcheck.ne.jp/cgi-bin/bp/bp32.dll'; }elsif($dp[2] eq 'digitalcheck_c'){ $dgurl = 'https://www.c-check.co.jp/cgi-bin/crDewE.dll'; } print <<"EOM";
$lang[104]

$carddata

EOM }elsif($dp[2] =~ /^gps/){#GPS $dategps = sprintf("%04d%02d%02d",$year,$mon,$mday); print <<"EOM";
$lang[104]

EOM &gpsform; print <<"EOM";

EOM }elsif($dp[2] =~ /^paypal/){#paypal print <<"EOM";
$lang[104]

Payment Method (Credit card payment for paypal)

EOM }elsif($dp[2] =~ /^worldpay/){#GPS print <<"EOM";
$lang[104]

Payment Method (Credit card payment for Worldpay)

EOM } print <<"EOM"; $lang[105]

$otherfly EOM } opendir(DIR, se); @files = readdir(DIR); closedir(DIR); foreach (@files) { $tmp = $_; $tmp =~ s/\.cgi//g; ($tmp,$dmy) = split('_', $tmp); if($tmp + $seout < $times){ if($_ !~ /index/ && $_ !~ /a/){ unlink("se/$_");#そのファイルを削除する } } } } sub gpsform{ print <<"EOM";
$lang[63]
EOM } sub gpsng{ &gettime; if($filelockuse){&lock;} open(LOG,"$orderfld/$orderfile.cgi");@olog=;close(LOG); if($filelockuse){&unlock;} for($i=0;$i<=$#olog;$i++){ @od = split(/$lang[222]/,$olog[$i]); if("$od[1]" eq "$FORM{'remark'}" && $od[9]){ $odno = $od[1]; $totalsu = $od[9]; $dategps = "$year$month$mday"; last; } } if($totalsu){ print <<"EOM";
$lang[106]
EOM &gpsform; print <<"EOM";

EOM } } sub printck{ &filename; open(LOG,"$usertfld/$filename.cgi");seek(LOG,0,0);@log=;close(LOG); for($i=0;$i<=$#log;$i++){ @userdata = split(/$lang[222]/,$log[$i]); if("$userdata[0]" eq "$FORM{'email'}"){ if("$userdata[14]" eq "$FORM{'password'}"){ $hitmail = 1; last; } } } } sub flowtag{ $flowtag=<<"EOM";
EOM $ft[1] = "$lang[107]"; $ft[2] = "$lang[108]"; $ft[3] = "$lang[97]"; $ft[4] = "$lang[109]"; for($i=1;$i<=$#ft;$i++){ if($i == $hstep){ $fct0 = 'flowhere'; $fct1 = 'flowcomhere'; }else{ $fct0 = 'flow'; $fct1 = 'flowcom'; } $flowtag .=<<"EOM";
STEP$i
$ft[$i]
EOM } $flowtag .=<<"EOM";
EOM } sub adressform{ $FORM{'adress'} =~ s/
/\n/g; $FORM{'adress2'} =~ s/
/\n/g; open(PY,"$paysfile");@pays=;close(PY); open(FM,"$formadd");@fm=;close(FM); if(!$FORM{'freecomment'}){ open(CAT,"$defcom");@dc=;close(CAT); for($di=0;$di<=$#dc;$di++){ $FORM{'freecomment'} .= "$dc[$di]"; } } $FORM{'freecomment'} =~ s/
/\n/g; if($mobile){ if(!$FORM{'email'}){$FORM{'email'} = "$defmail";} print <<"EOM"; $lang[112]
$lang[27]$lang[113]
$lang[114]

$lang[27]$lang[115]
$lang[116]

EOM if(!$postalno){ print <<"EOM"; $lang[27]$lang[117]
$lang[118]

EOM } print <<"EOM"; $lang[27]$lang[119]
$lang[120]

$lang[27]$lang[121]
$lang[122]

$lang[27]$lang[123]
$lang[124]

EOM if($pays[2]){ print <<"EOM"; $lang[27]$lang[99]
EOM $checked = 'checked'; for($pi=1;$pi<=$#pays;$pi++){ @dp = split(/$lang[222]/,$pays[$pi]); if($pi > 1){$checked = '';} if(!$dp[3]){ print <<"EOM"; $dp[0]
EOM if($dp[4]){ print "$lang[125]$lang[126]$lang[7]$dp[4]$lang[6]$lang[130]
"; } if($dp[5]){ print "$lang[125]$lang[68]$lang[7]$dp[5]$lang[6]$lang[127]
"; } if($dp[6]){ print "$lang[125]$lang[68]$lang[7]$dp[6]$lang[6]$lang[128]
"; } if($dp[7]){ print "$lang[125]$lang[129]
"; } } } }else{ @dp = split(/$lang[222]/,$pays[1]); print <<"EOM"; $lang[99]$lang[91]$dp[0]
EOM if($dp[4]){ print "$lang[125]$lang[126]$lang[7]$dp[4]$lang[6]$lang[130]
"; } if($dp[5]){ print "$lang[125]$lang[68]$lang[7]$dp[5]$lang[6]$lang[127]
"; } if($dp[6]){ print "$lang[125]$lang[68]$lang[7]$dp[6]$lang[6]$lang[128]
"; } if($dp[7]){ print "$lang[125]$lang[129]
"; } } for($ifm=1;$ifm<=$#fm;$ifm++){ @fmdata = split(/$lang[222]/,$fm[$ifm]); if("$fmdata[5]" ne '1'){ $fmtmp = &tagdel($fmdata[0]); print <<"EOM"; $lang[27]$fmtmp
EOM $fma = "formadd$ifm"; if("$fmdata[2]" eq 'text'){ print <<"EOM";
$fmdata[1]
EOM }elsif("$fmdata[2]" eq 'textarea' && "$fmdata[5]" ne '1'){ $FORM{$fma} =~ s/
/\n/g; print <<"EOM";
$fmdata[1]
EOM }elsif("$fmdata[2]" eq 'select'){ @fmsels = split(/\@\:/,$fmdata[4]); $cntsel = ''; for($im=0;$im<=$#fmsels;$im++){ $fmdata = $fmsels[$im]; $fmdata =~ s/▼//g; $fmdata =~ s/├//g; $fmdata =~ s/└//g; if("$FORM{$fma}" eq "$fmdata"){ $selected = 'selected'; }else{ $selected = ''; } $cntsel .= "
EOM }else{ $hstep = 2; &flowtag; if($mes){ $mes = <<"EOM"
$mes

EOM } print <<"EOM";
$flowtag
$mes
EOM if($basebarcol eq '#FFF'){ print <<"EOM"; EOM }else{ print <<"EOM"; EOM } if("$lang[112]" eq 'Shipping Address'){ print <<"EOM"; EOM if(!$postalno){ print <<"EOM"; EOM } print <<"EOM"; EOM }else{ print <<"EOM"; EOM if(!$postalno){ print <<"EOM"; EOM } print <<"EOM"; EOM } for($ifm=1;$ifm<=$#fm;$ifm++){ @fmdata = split(/$lang[222]/,$fm[$ifm]); if("$fmdata[5]" ne '2'){ print <<"EOM"; EOM } } print <<"EOM";
$lang[112]$lang[112]
$lang[113] $lang[114]
$lang[139]
$lang[140]
$lang[117] $lang[118]
$lang[137] EOM @fmsels = split(/\,/,$lang[138]); $cntsel = ''; for($im=0;$im<=$#fmsels;$im++){ $fmdata = $fmsels[$im]; if("$FORM{adress}" eq "$fmdata"){ $selected = 'selected'; }else{ $selected = ''; } $cntsel .= "
$lang[121]
$lang[122]
$lang[123]
$lang[124]
$lang[142]
$lang[143]
$lang[113] $lang[114]
$lang[115] $lang[116]
$lang[117] $lang[118]
$lang[136]
$lang[137]
$lang[138]
$lang[139]
$lang[140]
$lang[121]
$lang[122]
$lang[123]
$lang[124]
$lang[142]
$lang[143]
$fmdata[0] EOM $fma = "formadd$ifm"; if("$fmdata[2]" eq 'text'){ print <<"EOM";
$fmdata[1]
EOM }elsif("$fmdata[2]" eq 'textarea'){ $FORM{$fma} =~ s/
/\n/g; print <<"EOM";
$fmdata[1]
EOM }elsif("$fmdata[2]" eq 'select'){ @fmsels = split(/\@\:/,$fmdata[4]); $cntsel = ''; for($im=0;$im<=$#fmsels;$im++){ $fmdata = $fmsels[$im]; $fmdata =~ s/▼//g; $fmdata =~ s/├//g; $fmdata =~ s/└//g; if("$FORM{$fma}" eq "$fmdata"){ $selected = 'selected'; }else{ $selected = ''; } $cntsel .= "
EOM if($basebarcol eq '#FFF'){ print <<"EOM";
EOM }else{ print <<"EOM"; EOM } if("$cusurl[0]" eq '-'){ print <<"EOM"; $lang[99]
EOM }else{ print <<"EOM"; $lang[99]
EOM } if($pays[2]){ for($pi=1;$pi<=$#pays;$pi++){ @dp = split(/$lang[222]/,$pays[$pi]); if("$FORM{'pay'}" eq "$dp[0]"){ $checked = 'checked'; }else{ $checked = ''; } print <<"EOM"; EOM if($dp[4] || $dp[5] || $dp[6] || $dp[7] || $dp[8]){ print <<"EOM";
    EOM } if($dp[4]){ print "
  • $lang[126]$lang[7]$dp[4]$lang[6]
  • \n"; } if($dp[5]){ print "
  • $lang[68]$lang[7]$dp[5]$lang[6]$lang[127]
  • \n"; } if($dp[6]){ print "
  • $lang[68]$lang[7]$dp[6]$lang[6]$lang[128]
  • \n"; } if($dp[7]){ print "
  • $lang[129]
  • \n"; } if($dp[8]){ print "$dp[8]\n"; } if($dp[4] || $dp[5] || $dp[6] || $dp[7] || $dp[8]){ print <<"EOM";
EOM } print "
\n"; } }else{ @dp = split(/$lang[222]/,$pays[1]); print <<"EOM"; $dp[0] EOM } print <<"EOM";
EOM if($basebarcol eq '#FFF'){ print <<"EOM";
EOM }else{ print <<"EOM"; EOM } print <<"EOM"; $lang[74]

EOM if($btnimg[2]){ print <<"EOM";
EOM }else{ print <<"EOM";
EOM } } } sub costcount{ for($icc=0;$icc<=$#sflog;$icc++){ @d = split(/$lang[222]/,$sflog[$icc]); if("$d[1]" eq "$datac[1]"){ $d[2] =~ s/
//g; $d[2] =~ s/
//g; $hit = 1; last; } } if(!$hit && $datac[14]){ @d = (); $d[1] = $datac[1]; $d[2] = $datac[3]; $d[6] = $datac[14]; $d[9] = 'm'; } if($d[30] && !$d[31]){$d[31] = $d[30];} if($d[30] && $datac[2] == 2){ $cps = $d[30]; }elsif($d[31] && $datac[2] > 2){ $cps = $d[31]; }else{ $cps = $d[6]; } $tcnt = &addcamma($cps); $tcns = &addcamma($d[7]); if($maxsendcost < $d[7]){$maxsendcost = $d[7];} $subtotal = $subtotal + ($datac[2] * $cps); $subtcnt = $datac[2] * $cps; $subtcnt = &addcamma($subtcnt); if(!$sendcosttype){ $subtotals = $subtotals + ($datac[2] * $d[7]); } $subtotalc = $subtotalc + $datac[2]; } sub totalcostcount{ if(!$sendfreeflg){ $subtotal = $subtotal + $subtotals; for($is=1;$is<=$#sendcost;$is++){ if($sendcost[$is] && $is == $subtotalc){ $sends = $sendcost[$is]; } } if(!$sends && $subtotalc > $#sendcost){ $sends = $sendcost[$#sendcost]; } if($maxsendcost && $sendcosttype){ $sends = $maxsendcost; } }else{ $areasendcost = 0; } if(!$taxplus){ $tax = $subtotal * 0.05; $tax = int($tax); } $tesuryosu = $tesuryo; $totalsu = $total = $subtotal + $tax + $sends + $areasendcost + $tesuryo; $subtotal = &addcamma($subtotal); if(!$taxplus){ $tax = &addcamma($tax); } if($areasendcost){ $areasendcost = &addcamma($areasendcost); } if($sends){ $sends = &addcamma($sends); } if($tesuryo){ $tesuryo = &addcamma($tesuryo); } $total = &addcamma($total); } sub formtype1{ @ck = split(/<>/,$cartcook); $item_all_count = $#ck + 1; print <<"EOM";
EOM for($ic=0;$ic<=$#ck;$ic++){ @datac = split(/\,/,$ck[$ic]); $codecnt = $ic+1; $codecnt = sprintf("%02d",$codecnt); print <<"EOM"; EOM } } sub cartck{ $hstep = 1; if(!$mobile){ print <<"EOM";
EOM &flowtag; } if($cartcook){ if(!$mobile){ if($scriptfssl && !$mustssl){ if($FORM{'ssl'}){ $sslsw=<<"EOM"; $lang[145]: $lang[146] | $lang[147]
EOM $lockicon=<<"EOM"; EOM }else{ $sslsw=<<"EOM"; $lang[145]: $lang[146] | $lang[147]
EOM } } print <<"EOM";
$flowtag
$lang[148]
$lang[149]
EOM for($si=0;$si<=$#sendcost;$si++){ if($sendcost[$si]){last;} } if($sendcost[$si]){ print <<"EOM";
$lang[150]$si$lang[151]$sendcost[$si]$lang[152]

EOM } if($sendfreecost){ print <<"EOM";
$lang[153]$sendfreecost$lang[154]
EOM } if($scriptfssl && !$mustssl){ print <<"EOM"; $sslsw
$sslinfo

EOM } print <<"EOM"; EOM if($basebarcol eq '#FFF'){ print <<"EOM"; EOM } @ck = split(/<>/,$cartcook); if($sendfreecost){ for($ic=0;$ic<=$#ck;$ic++){ @datac = split(/\,/,$ck[$ic]); $hit = 0; &costcount; } if($sendfreecost <= $subtotal){ $sendfreeflg = 1; } $subtotal = 0; $subtotals = 0; $subtotalc = 0; } for($ic=0;$ic<=$#ck;$ic++){ @datac = split(/\,/,$ck[$ic]); $hit = 0; &costcount; $cntsel = ''; for($im=1;$im<=$cntmax;$im++){ if("$datac[2]" eq "$im"){ $selected = 'selected'; }else{ $selected = ''; } $cntsel = "$cntsel"." EOM } } } &totalcostcount; if($mobile){ print "
$lang[69]:$lang[7]$subtotal$lang[6]
"; }else{ print <<"EOM"; EOM } if($sendfreeflg){ if($mobile){ print "$lang[57]:$lang[65]
"; }else{ print <<"EOM"; EOM } }elsif($areasendfile){ if($mobile){ print "$lang[57]:$lang[159]
"; }else{ print <<"EOM"; EOM } }elsif($sends){ if($mobile){ print "$lang[57]:$lang[7]$sends$lang[6]
"; }else{ print <<"EOM"; EOM } } if($lang[70]){ if($mobile){ print "$lang[70]:"; }else{ print <<"EOM"; EOM } if(!$taxplus){ if($mobile){ print "$lang[7]$tax$lang[6]
"; }else{ print <<"EOM"; EOM } }else{ if($mobile){ print "$lang[75]
"; }else{ print <<"EOM"; EOM } } if(!$mobile){ print <<"EOM"; EOM } } if($mobile){ print "$lang[68]:$lang[7]$total$lang[6]
"; }else{ print <<"EOM";
EOM }else{ print <<"EOM"; EOM } print <<"EOM"; $lang[29]
$lang[60] $lang[61] $lang[62] $lang[69] $lang[157]
$d[2]($d[1])
EOM } for($si=3;$si<=12;$si++){ if($datac[$si]){ @dsel = split(/\_/,$datac[13]); $sim = $si-3; print <<"EOM"; $dsel[$sim]$lang[91]$datac[$si]
EOM } } if($mobile){ print <<"EOM"; $lang[7]$tcnt$lang[6]$lang[92]$datac[2] $lang[157]
EOM }else{ print <<"EOM";
$lang[7]$tcnt$lang[6] $lang[7]$subtcnt$lang[6]
$lang[69] $lang[7]$subtotal$lang[6]
$lang[57] $lang[65]
$lang[57] $lang[159]
$lang[57] $lang[7]$sends$lang[6]
$lang[70]$lang[7]$tax$lang[6]$lang[75]
$lang[68] $lang[7]$total$lang[6]
EOM } if($formurl){ if($formtype == 1){#SEMPREタイプ &formtype1; } }else{ if($mustssl){ $scriptform = $scriptfssl; }else{ $scriptform = $script; } if($mobile){ print <<"EOM";
EOM }else{ print <<"EOM"; EOM } } if($mobile){ print <<"EOM";

EOM }else{ if($btnimg[1]){ print <<"EOM"; $lockicon
EOM }else{ print <<"EOM"; $lockicon
EOM } } &neargoods; }else{ print <<"EOM";

$lang[160]
$nojob
EOM } if(!$mobile){ &mychecktag; print <<"EOM";
EOM } } sub subcarttag{ if($cartgif && ($nowcook || ($mobile && $FORM{'goods'}))){ if($mobile){ if($areasendfile){ $adress = $FORM{'adress'}; &areasendget; } if($mes){ print <<"EOM"; $mes
$lang[87]
EOM &footer; exit; } if($hit){ if($d[30] && !$d[31]){$d[31] = $d[30];} if($d[30] && $FORM{'cnt'} == 2){ $cps = $d[30]; }elsif($d[31] && $FORM{'cnt'} > 2){ $cps = $d[31]; }else{ $cps = $d[6]; } if($maxsendcost < $d[7]){$maxsendcost = $d[7];} print <<"EOM"; $lang[59]:$d[1]
$d[2]
EOM }elsif($FORM{'cost'}){ $cps = $FORM{'cost'}; } if($sendfreecost && $sendfreecost <= $cps){ $sendfreeflg = 1; } for($si=0;$si<=10;$si++){ $selhoge = "sel$si"; $datac[$si] = $FORM{$selhoge}; if($datac[$si]){ @dsel = split(/\_/,$FORM{'selhid'}); print <<"EOM"; $dsel[$si]$lang[91]$datac[$si]
EOM } } $tcnt = $cps; $tcns = $d[7]; print <<"EOM"; $lang[7]$tcnt$lang[6]$lang[92]$lang[62]:$FORM{'cnt'}
EOM if($tcns && !$sendfreeflg && !$sendcosttype){ print <<"EOM"; $lang[57]:$lang[7]$tcns$lang[6]$lang[92]$lang[62]:$FORM{'cnt'}
EOM $subtotals = $subtotals + ($FORM{'cnt'} * $d[7]); }elsif($sendfreeflg){ $subtotals = 0; } print '
'; $subtotal = $subtotal + ($FORM{'cnt'} * $cps); $subtotalc = $subtotalc + $FORM{'cnt'}; }else{ print <<"EOM";
$lang[29]
EOM if($formurl){ if($formtype == 1){#SEMPREタイプ &formtype1; } }else{ if($mustssl){ $scriptform = $scriptfssl; }else{ $scriptform = $script; } print <<"EOM";
EOM } print <<"EOM";

EOM if($sendfreecost){ for($ic=0;$ic<=$#ck;$ic++){ @datac = split(/\,/,$ck[$ic]); $hit = 0; &costcount; } if($sendfreecost <= $subtotal){ $sendfreeflg = 1; } $subtotal = 0; $subtotals = 0; $subtotalc = 0; } for($ic=0;$ic<=$#ck;$ic++){ @datac = split(/\,/,$ck[$ic]); &costcount; local($eurl) = &urlencode("$datac[1]"); if($hit){ print <<"EOM"; $d[2]
EOM }else{ print "$d[2]
"; } print <<"EOM"; $lang[7]$tcnt$lang[6]$lang[92]$lang[62]$lang[91]$datac[2]
EOM if($tcns && !$sendcosttype){ print <<"EOM"; $lang[57]:$lang[7]$tcns$lang[6]$lang[92]$lang[62]$lang[91]$datac[2]
EOM } print '
'; } } &totalcostcount; if($mobile){ print <<"EOM"; $lang[69]:$lang[7]$subtotal$lang[6]
EOM if(!$taxplus && $lang[70]){ print <<"EOM"; $lang[70]:$lang[7]$tax$lang[6]
EOM }elsif($lang[70]){ print <<"EOM"; $lang[70]:$lang[75]
EOM } if($sendfreeflg){ print <<"EOM"; $lang[57]$lang[91]$lang[65]
EOM }elsif($maxsendcost && $sendcosttype){ print <<"EOM"; $lang[57]$lang[91]$lang[7]$maxsendcost$lang[6]
EOM }elsif($areasendfile){ print <<"EOM"; $lang[57]$lang[91]$lang[7]$areasendcost$lang[6]
EOM }elsif($sends){ print <<"EOM"; $lang[162]$lang[91]$lang[7]$sends$lang[6]
EOM } print <<"EOM"; $lang[68]:$lang[7]$total$lang[6]
EOM }else{ $subtotal = &addcamma($subtotal); if(!$taxplus){ $tax = &addcamma($tax); } if($maxsendcost){ $maxsendcost = &addcamma($maxsendcost); } if($sends){ $sends = &addcamma($sends); } $total = &addcamma($total); print <<"EOM";
EOM if($sendfreeflg){ print <<"EOM"; EOM }elsif($maxsendcost && $sendcosttype){ print <<"EOM"; EOM }elsif($areasendfile){ print <<"EOM"; EOM }elsif($sends){ print <<"EOM"; EOM } if(!$taxplus && $lang[70]){ print <<"EOM"; EOM }elsif($lang[70]){ print <<"EOM"; EOM } print <<"EOM";
$lang[69]$lang[91]$lang[7]$subtotal$lang[6]
$lang[57]$lang[91]$lang[65]
$lang[57]$lang[91]$lang[7]$maxsendcost$lang[6]
$lang[57]$lang[91]$lang[163]
$lang[162]$lang[91]$lang[7]$sends$lang[6]
$lang[70]$lang[91]$lang[7]$tax$lang[6]
$lang[70]$lang[91]$lang[75]
$lang[68]$lang[91] $lang[7]$total$lang[6]
EOM if($formurl){ if($formtype == 1){#SEMPREタイプ &formtype1; } }else{ print <<"EOM";
EOM } print <<"EOM";
EOM } } } sub mychecktag{ if($mycheck){ @myc = split(/<>/,$mycheck); print <<"EOM";

$lang[12]

EOM } if($research){ if($toppage){ $buffer = ''; $scriptf = "$domain"; } $buffer =~ s/\&/\//g; $buffer =~ s/\=/\_/g; $question = '/'; print <<"EOM";
$research
$lang[123]

EOM } } sub catpickup{ for($i=0;$i<=$#cat;$i++){ if(index("$cat[$i]", "$FORM{'c'}") >= 0){ @cdata = split(/\,/,$cat[$i]); @sdata = split(/\@\:/,$cdata[0]); if("$sdata[5]" eq "$FORM{'c'}"){ $FORM{'key'} = $sdata[0]; }else{ @tdata = split(/\@\:/,$cdata[1]); if("$tdata[5]" eq "$FORM{'c'}"){ if($tdata[4] eq '1'){ $FORM{'key'} = "$sdata[0] $tdata[0]"; }else{ $FORM{'key'} = $tdata[0]; } } } } } if(!$FORM{'key'}){ print "Location: $domain/\n\n";exit; } } sub keymake{ if($FORM{'key'} =~ / /){ @keys = split(/ /,$FORM{'key'}); }elsif($FORM{'key'} =~ / /){ @keys = split(/ /,$FORM{'key'}); }elsif($FORM{'key'} =~ /\+/){ @keys = split(/\+/,$FORM{'key'}); $or = 1; }elsif($FORM{'key'} =~ /+/){ @keys = split(/+/,$FORM{'key'}); $or = 1; }elsif($FORM{'key'} =~ /・/ && $pointor){ @keys = split(/・/,$FORM{'key'}); $or = 1; }else{ $keys[0] = $FORM{'key'}; } } sub keylogmake{ @log = (); for($ii=1;$ii<=$#sflog;$ii++){ $hit = ""; $sflog[$ii] =~ s/"//g; @d = split(/$lang[222]/,$sflog[$ii]); for($i=0;$i<=$#keys;$i++){ if(!$cartgif){ $mlink = ''; if("$mobile" eq 'e' && $d[38]){ $mlink = $d[38]; }elsif("$mobile" eq 'v' && $d[37]){ $mlink = $d[37]; }elsif("$mobile" ne 'e' && "$mobile" ne 'v' && $mobile && $d[36]){ $mlink = "$d[36]"; } } if( (!$cartgif && $mobile && $d[3] && $d[33] && $mlink && index("$sflog[$ii]", "$keys[$i]") >= 0) || (!$cartgif && !$mobile && $d[3] && $d[33] && index("$sflog[$ii]", "$keys[$i]") >= 0) || ($cartgif && $d[9] && $d[3] && $d[2] && index("$sflog[$ii]", "$keys[$i]") >= 0) || (index("$sflog[$ii]", "$keys[$i]") >= 0 && "$FORM{'pass'}" eq "$mpass")){ if($catkeyhit && "$FORM{'pass'}" ne "$mpass"){ if("$catkeytype" eq '1'){ if("$d[0]" eq "$keys[$i]"){ $hit = $hit+1; } }elsif("$catkeytype" eq '2'){ if(index("$sflog[$ii]", "$keys[$i]") >= 0){ $hit = $hit+1; } }elsif("$catkeytype" eq '3'){ $tmplog = "$d[0],$d[8]"; if(index("$tmplog", "$keys[$i]") >= 0){ $hit = $hit+1; } }else{ $tmplog = "$d[0],$d[2],$d[8],$d[28]"; if(index("$tmplog", "$keys[$i]") >= 0){ $hit = $hit+1; } } }else{ $hit = $hit+1; } } } if($or){ if($hit){ if($costchara){&costcharaset;} push(@log,"$sflog[$ii]"); } }else{ if($hit == ($#keys + 1)){ if($costchara){&costcharaset;} push(@log,"$sflog[$ii]"); } } } } sub costcharaset{ if(index("$d[6]", "円") >= 0){ @tmp = split(/円/,$d[6]); } $sflog[$ii] =~ s/\s*$//; $tmp[0] =~ s/\,//g; $tmp[0] =~ s/,//g; $tmp[0] =~ s/\.//g; if(index("$tmp[0]", ":") >= 0){ @tmp = split(/:/,$tmp[0]); $tmp[0] = $tmp[1]; } if(index("$tmp[0]", ':') >= 0){ @tmp = split(/\:/,$tmp[0]); $tmp[0] = $tmp[1]; } if(index("$tmp[0]", "  ") >= 0){ @tmp = split(/  /,$tmp[0]); $tmp[0] = $tmp[1]; } if(index("$tmp[0]", " ") >= 0){ @tmp = split(/ /,$tmp[0]); $tmp[0] = $tmp[1]; } if(index("$tmp[0]", " ") >= 0){ @tmp = split(/ /,$tmp[0]); $tmp[0] = $tmp[1]; } if(index("$tmp[0]", ")") >= 0){ @tmp = split(/)/,$tmp[0]); $tmp[0] = $tmp[1]; } $tmp[0] =~ s/US\$//g; $tmp[0] =~ s/受講料//g; $tmp[0] =~ s/各//g; $tmp[0] =~ s/・基礎講座//g; $tmp[0] =~ s/1科目//g; $tmp[0] =~ s/1カ月//g; $tmp[0] =~ s/あたり//g; $tmp[0] =~ s/通学//g; $tmp[0] =~ s/・3級//g; $post = $tmp[0]; &jcode'tr(*post,$from,$to); $tmp[0] = $post; if($lang[222] eq '\t'){ $sflog[$ii] .= "\t$tmp[0]"; }else{ $sflog[$ii] .= ",$tmp[0]"; } } sub key{ if($FORM{'keyplus'}){ $FORM{'key'} = "$FORM{'key'}".' '."$FORM{'keyplus'}"; } &keymake; $kkeys = $FORM{'key'}; &subcatlist; if(@ncat){ push(@keys,@ncat); $or = 1; } # &mycheckkeycook; &cartcook; &keylogmake; if($FORM{'keycnt'}){ open(LOG,"$keydat");@klog=;close(LOG); open(LOG,"$keydatbk");@klogbk=;close(LOG); if($#klog < $#klogbk){ @klog = @klogbk; } &weekreset_key; $ip=$ENV{'REMOTE_ADDR'}; if(!$FORM{'n'}){ for($i=0;$i<=$#keys;$i++){ for($ii=1;$ii<=$#klog;$ii++){ @kdata = split(/$lang[222]/,$klog[$ii]); if("$keys[$i]" eq "$kdata[0]" && "$kdata[4]" ne "$ip"){ $kdata[1] = $kdata[1]+1; $kdata[3] = $kdata[3]+1; $newline = "$kdata[0]$lang[222]$kdata[1]$lang[222]$kdata[2]$lang[222]$kdata[3]$lang[222]$ip$lang[222]\n"; splice(@klog,$ii,1,"$newline"); $khit = 1; $khited = 1; }elsif("$keys[$i]" eq "$kdata[0]" && "$kdata[4]" eq "$ip"){ $khit = 1; $khited = 1; } } if(!$khit){ $newline = "$keys[$i]$lang[222]1$lang[222]0$lang[222]1$lang[222]$ip$lang[222]\n"; push(@klog,"$newline"); $khited = 1; }else{ $khit = ""; } } if($khited && $#klog >= $#klogbk){ if($#klog > 100){ $sn = 2; foreach $i (1..(@klog-1)) { @Buf = split(/$lang[222]/, @klog[$i]); $SSData{$i} = $Buf[$sn]; } @SortData = sort {($SSData{$b} <=> $SSData{$a}) || ($b cmp $a)} keys(%SSData); @nlog=(); foreach $i (@SortData) { push(@nlog,$klog[$i]); } @klog = @nlog; splice(@klog, 100); } open(LOG,"+<$keydat");flock(LOG,2);truncate(LOG,0);seek(LOG,0,0);print LOG @klog;close(LOG); open(LOG,"+<$keydatbk");flock(LOG,2);truncate(LOG,0);seek(LOG,0,0);print LOG @klog;close(LOG); } } @klog = (); } for($im=1;$im<=$cntmax;$im++){ $cntsel = "$cntsel"."