#!/usr/local/bin/perl $script = "hall.html"; require './lib/jcode.pl'; require './lib/teikei.pl'; require './lib/dbsetup.pl'; # 今月のぱっちGuuデータファイル $PACCHI_FILE = "$sv_path/private_html/protect/pc/.pacchi"; &decode; #----------------# # 書込Cookie準備 # #----------------# $setcook1 = &setCookie("ID", $COOKIE{ID}); #------------------# # ログインチェック # #------------------# &DBConnect; $sth = $db->prepare("select ID from ppass where ID = \"$COOKIE{ID}\""); if(!$sth->execute){ &error ("接続失敗2"); } $data = $sth->fetchrow; if ($data){ $LOGIN_FLAG = $data; } else{ $LOGIN_FLAG = ""; } &DBDisconnect; #----------------# # ホール情報分岐 # #----------------# if ($in{'area'} eq "tokyo"){ $hallfile = "hall_tokyo"; $imagedir = "./images/hall/tokyo"; $mini_imagedir = "./images/hall/tokyo/mini"; $bgcolor = '#00BC6A'; if ($in{'mode'} eq "all"){&all;} if ($in{'mode'} eq "shop"){&shop;} }elsif ($in{'area'} eq "keihin"){ $hallfile = "hall_keihin"; $imagedir = "./images/hall/keihin"; $mini_imagedir = "./images/hall/keihin/mini"; $bgcolor = '#0081BC'; if ($in{'mode'} eq "all"){&all;} if ($in{'mode'} eq "shop"){&shop;} }elsif ($in{'area'} eq "osaka"){ $hallfile = "hall_osaka"; $imagedir = "./images/hall/osaka"; $mini_imagedir = "./images/hall/osaka/mini"; $bgcolor = '#FF2623'; if ($in{'mode'} eq "all"){&all;} if ($in{'mode'} eq "shop"){&shop;} }elsif ($in{'area'} eq "sapporo"){ $hallfile = "hall_sapporo"; $imagedir = "./images/hall/sapporo"; $mini_imagedir = "./images/hall/sapporo/mini"; $bgcolor = '#A26EDF'; if ($in{'mode'} eq "all"){&all;} if ($in{'mode'} eq "shop"){&shop;} }else{ &count; $center .= <
ホール情報
ぱっちGuu取材班が、選りすぐりのホールイベントに突撃取材を決行!!!ご希望のエリアを選択して下さい。※取材日は誌面内で随時掲載中!!設置場所に関してはコチラから。
東京エリアはこちらから
ホール情報東京エリア!
京浜エリアはこちらから
ホール情報京浜エリア!
大阪・阪神エリアはこちらから
ホール情報大阪・阪神エリア!

携帯でアクセス!
EOF } &html; #----------# # 全件表示 # #----------# sub all { if ($in{'area'} eq "tokyo"){ $obi = '
東京エリア
'; }elsif ($in{'area'} eq "keihin"){ $obi = '
京浜エリア
'; }elsif ($in{'area'} eq "osaka"){ $obi = '
大阪・阪神エリア
'; } $center .= <
激アツホール情報
ぱっちGuu取材班が、選りすぐりのホールイベントに突撃取材を決行!!そんな熱いホールがズラリと勢揃い!ご希望のエリアを選択して下さい。※取材日は誌面内で随時掲載中!!設置場所に関してはコチラから。
$obi EOF # $center .= ''; &DBConnect; $sth = $db->prepare("select ID, hall_name, view_flag, address2, write_time, photo3 from $hallfile where view_flag = 1 order by view_No ASC"); if(!$sth->execute){ &error ("接続失敗2"); } while(@res = $sth->fetchrow) { foreach(@res){ jcode::convert(\$_, 'sjis'); } # 1列3個表示。 if ($loopcount == 0){ $tr = ''; $tdwidth = 154; $loopcount++; }elsif($loopcount == 2){ $tr = ''; $tdwidth = 150; $loopcount = 0; }else{ $tdwidth = 154; $tr = ''; $loopcount++; } # 本日激アイコン表示判定 $write_time = $res[4]; ($geki_sec,$geki_min,$geki_hour,$geki_mday,$geki_mon,$geki_year,$geki_wday,$geki_dmy) = localtime($write_time); ($gsec,$gmin,$ghour,$gmday,$gmon,$gyear,$gwday,$gdmy) = localtime(time); $gmon++; $geki_mon++; $geki_icon = ""; if (($geki_mday == $gmday) && ($res[4] ne "") && ($geki_mon == $gmon)){ # if ($geki_mday == $gmday){ $geki_icon = ''; } # NEW 60日表示(60日 = 5184000秒) $new_time = $res[0]; $nowtime = time; $new_icon = ""; if (($new_time + 5184000) > $nowtime){ $new_icon = ''; } # 画像 $thm_img = ""; if ($res[5]){ $thm_img = ""; }else{ $thm_img = ""; } # 簡易住所 $address2 = ""; if ($res[3]){ $address2 = "($res[3])"; } # 表示 $center .= <
$thm_img
$res[1] $address2
$new_icon$geki_icon
EOF } &DBDisconnect; if ($loopcount == 2){ $center .= "\n"; } $center .= "\n"; $center .= "

\n"; } #----------------# # 店舗表示処理 # #----------------# sub shop{ if ($in{'area'} eq "tokyo"){ $area_jp = "東京"; $event_mei = "最新取材イベント"; }elsif ($in{'area'} eq "keihin"){ $area_jp = "京浜"; $event_mei = "最新取材イベント"; }elsif ($in{'area'} eq "osaka"){ $area_jp = "大阪・阪神"; $event_mei = "最新取材イベント"; }elsif ($in{'area'} eq "sapporo"){ $area_jp = "札幌・道央"; $event_mei = "ぱっち的おすすめ日イベント"; } if ($in{'r'} eq "ar"){ $ref = "$area_jpエリア > ホールイベント情報 > 店舗詳細"; }elsif($in{'r'} eq "me"){ $ref = "ホールイベント情報 > $area_jpエリア一覧 > 店舗詳細"; } $center .= <

EOF &DBConnect; $sth = $db->prepare("select * from $hallfile where ID = $in{'SN'}"); if(!$sth->execute){ &error ("接続失敗 詳細"); } while(@res = $sth->fetchrow) { foreach(@res){ jcode::convert(\$_, 'sjis'); } $No = $res[0]; $s_name = $res[1]; $address = $res[2]; $opentime = $res[3]; $holiday = $res[4]; $parking = $res[5]; $pachi = $res[6]; $slot = $res[7]; $access = $res[8]; $photo1 = $res[9]; $photo2 = $res[10]; $event_title = $res[18]; $event_msg = $res[19]; $write_time = $res[15]; $geki_msg = $res[16]; ($geki_sec,$geki_min,$geki_hour,$geki_mday,$geki_mon,$geki_year,$geki_wday,$geki_dmy) = localtime($write_time); ($sec,$min,$hour,$mday,$mon,$year,$wday,$dmy) = localtime(time); $mon++; $geki_mon++; if ($pachi > 0){$pachi = "パチンコ$pachi台 ";}else{ $pachi = "";} if ($slot > 0){$slot = "スロット$slot台";}else{ $slot = "";} if ($in{'SN'} eq $No){ $center .= "
$s_name
\n"; if ( $LOGIN_FLAG ){ # ログインしていて本日激ぱっちがある場合は表示 if (($geki_mday == $mday) && ($res[15] ne "") && ($geki_mon == $mon)){ # if ($geki_mday == $mday){ $center .= <
$geki_msg
EOF } }else{ # 本日激ぱっちがある場合は表示(ログインしていない) if ($geki_mday == $mday){ $center .= "
"; } } if ($photo1){ $center .= "
\n"; } if (($event_title ne "") && ($event_msg ne "")){ # イベント情報、会員限定 # ログインしている場合 if ( $LOGIN_FLAG ){ $center .= " \n"; $center .= " \n"; $center .= " \n"; $center .= "
$event_mei
$event_title
$event_msg
\n"; }else{ # ログインしていない場合 $center .= " \n"; $center .= " \n"; $center .= " \n"; $center .= "
$event_mei
$event_title
もっと見る☆(もっと見たい方は会員登録してね☆)
\n"; } } $center .= " \n"; $center .= " \n"; $center .= " \n"; $center .= " \n"; if ($parking ne ""){ $center .= " \n"; } $center .= " \n"; # 自動リンク &auto_link($access); $center .= " \n"; $center .= "
住所$address
営業時間$opentime
定休日$holiday
駐車場$parking
設置台数$pachi$slot
アクセス$access
\n"; if ($photo2){ $center .= "
\n"; } } } &DBDisconnect; $center .= '

'; $center .= "

\n"; } #--------------# # 自動リンク # #--------------# sub auto_link { $_[0] =~ s/([^=^\"]|^)(https?\:[\w\.\~\-\/\?\&\=\@\;\#\:\%]+)/$1$2<\/a>/g; } #----------# # カウンタ # #----------# sub count { # カウントファイル $log = "count/hall.dat"; # ロックファイル名 $lockfile = 'count/lock/hall.lock'; &lock; #カウントファイル読込み open(IN,"$log"); $in_line = ; close(IN); #カウント1増やす $in_line++; #カウントファイル書込み open(OUT,">$log"); print OUT $in_line; close(OUT); &unlock; } sub lock { local($retry) = 5; while (!mkdir($lockfile, 0755)) { sleep(1); } } sub unlock { rmdir($lockfile); }