-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbride.cgi
66 lines (59 loc) · 1.82 KB
/
bride.cgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
use utf8;
# 結婚 2004/01/20 由來
@BRIDEnamelist=qw(
no tm mode ida idb stbase ctbase money place reform
);
$image[0]='<IMG ALT="'.l('住宅').'" WIDTH="19" HEIGHT="22" BORDER="0" SRC="'.$IMAGE_URL.'/house1.gif">'.l('共用倉庫');
$image[1]='<IMG ALT="'.l('住宅').'" WIDTH="19" HEIGHT="22" BORDER="0" SRC="'.$IMAGE_URL.'/house1.gif">'.l('一戸建て');
$image[2]='<IMG ALT="'.l('プロポーズ').'" WIDTH="16" HEIGHT="16" BORDER="0" SRC="'.$IMAGE_URL.'/house2.png">'.l('プロポーズ');
$image[3]=GetTagImgKao(l("神父"),"father");
Lock() if ($Q{mode}); # できるだけ早くロック。
DataRead();
CheckUserPass(1);
ReadBride();
RequireFile('inc-html-bride-edit.cgi') if ($Q{mode}); # 各種データ処理
if ($Q{no})
{
RequireFile('inc-html-bride-list.cgi');
}
else
{
$disp.="<BIG>●".l('教会')."</BIG><br><br>";
RequireFile('inc-html-bride.cgi');
}
OutSkin();
1;
sub ReadBride
{
open(IN,"<:encoding(UTF-8)",GetPath('bride')) or return;
my @bride=<IN>;
close(IN);
$married=0;
$Scount=$#bride;
foreach my $cnt(0..$Scount)
{
chop $bride[$cnt];
my @buf=split(/,/,$bride[$cnt]); my $i=0;
foreach (@BRIDEnamelist) { $BRIDE[$cnt]->{$_}=$buf[$i];$i++;}
undef $BRIDE[$cnt],next if !defined($id2idx{$BRIDE[$cnt]->{ida}}) || !defined($id2idx{$BRIDE[$cnt]->{idb}}); # 閉店,移転による消滅。
@BRIDE[$cnt]->{stock}=[split(/:/,$BRIDE[$cnt]->{stbase})];
@BRIDE[$cnt]->{cnt}=[split(/:/,$BRIDE[$cnt]->{ctbase})];
$BRIDE[$cnt]->{point}=0;
$BRIDE[$cnt]->{point}=$DT[$id2idx{$BRIDE[$cnt]->{ida}}]->{point}+$DT[$id2idx{$BRIDE[$cnt]->{idb}}]->{point} if ($BRIDE[$cnt]->{mode});
$married=1 if ($DT->{id} == $BRIDE[$cnt]->{ida}) || ($DT->{id} == $BRIDE[$cnt]->{idb});
}
}
sub SearchBride
{
my($no)=@_;
my $idx=-1;
foreach(0..$Scount)
{
if($BRIDE[$_]->{no}==$no)
{
$idx=$_;
last;
}
}
return $idx;
}