-
Notifications
You must be signed in to change notification settings - Fork 2
/
bbsonline.php
168 lines (152 loc) · 3.87 KB
/
bbsonline.php
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
require("www2-funcs.php");
$nowyear = date("Y");
$nowmonth = date("m");
$nowday = date("d");
$yesterd=0;
if (isset($_GET["year"])){
$year = $_GET["year"];
}else{
$year = 0;
$yesterd=1;
}
settype($year, "integer");
if( $year < 1990 || $year > $nowyear )
$year = $nowyear;
if (isset($_GET["month"])){
$month = $_GET["month"];
}else
$month = 0;
settype($month, "integer");
if( $month <= 0 || $month > 12 )
$month = $nowmonth;
else{
if( $month < 10 )
$month = "0".$month;
}
if (isset($_GET["day"])){
$day = $_GET["day"];
}else
$day = 0;
settype($day, "integer");
if( $day <= 0 || $day > 31 )
$day = $nowday;
else{
if( $day < 10 )
$day = "0".$day;
}
if( $yesterd ){
$pngurl = "/bbsstat/todayonline.png";
$pngurl1 = "/bbsstat/todaylogin.png";
$pngurl2 = "/bbsstat/todaylogout.png";
$pngurl3 = "/bbsstat/todaystay.png";
} else {
$pngurl = "/bbsstat/".$year."/".$month."/".$day."_useronline.png";
$pngurl1 = "/bbsstat/".$year."/".$month."/".$day."_login.png";
$pngurl2 = "/bbsstat/".$year."/".$month."/".$day."_logout.png";
$pngurl3 = "/bbsstat/".$year."/".$month."/".$day."_stay.png";
}
page_header("用户在线统计");
?>
<form action="bbsonline.php" method="get">
<select name="year" class="input" style="WIDTH: 55px">
<?php
for ($i = 2002; $i <= $nowyear; $i++) {
?>
<option value="<?php echo $i; ?>"<?php if( $year==$i ) { ?> selected="selected"<?php } ?>><?php echo $i; ?></option>
<?php
}
?>
</select>年
<select name="month" class="input" style="WIDTH: 40px">
<option value="01"<?php if( $month=="01" ) { ?> selected="selected"<?php } ?>>01</option>
<option value="02"<?php if( $month=="02" ) { ?> selected="selected"<?php } ?>>02</option>
<option value="03"<?php if( $month=="03" ) { ?> selected="selected"<?php } ?>>03</option>
<option value="04"<?php if( $month=="04" ) { ?> selected="selected"<?php } ?>>04</option>
<option value="05"<?php if( $month=="05" ) { ?> selected="selected"<?php } ?>>05</option>
<option value="06"<?php if( $month=="06" ) { ?> selected="selected"<?php } ?>>06</option>
<option value="07"<?php if( $month=="07" ) { ?> selected="selected"<?php } ?>>07</option>
<option value="08"<?php if( $month=="08" ) { ?> selected="selected"<?php } ?>>08</option>
<option value="09"<?php if( $month=="09" ) { ?> selected="selected"<?php } ?>>09</option>
<option value="10"<?php if( $month=="10" ) { ?> selected="selected"<?php } ?>>10</option>
<option value="11"<?php if( $month=="11" ) { ?> selected="selected"<?php } ?>>11</option>
<option value="12"<?php if( $month=="12" ) { ?> selected="selected"<?php } ?>>12</option>
</select>月
<select name="day" class="input" style="WIDTH: 40px">
<?php
for($i=1; $i<=31; $i++){
$nd = $i;
if($i < 10 )
$nd = "0".$i;
?>
<option value="<?php echo $nd;?>"<?php if( $day==$nd ) { ?> selected="selected"<?php } ?>><?php echo $nd?></option>
<?php
}
?>
</select>日
<input type=submit name="submit" value="Go">
数据开始于 2002年10月9日
<a href="/bbsstat/allonline.png">历史图表</a>
</form>
<?php
if( $yesterd == 0 ){
?>
<a href="/bbsonline.php">最新数据</a>
<?php
}
?>
<br>
在线人数统计<br>
<?php
if( file_exists( $_SERVER["DOCUMENT_ROOT"].$pngurl ) ){
?>
<img src="<?php echo $pngurl;?>"></img>
<?php
}else{
?>
对不起,暂时无此日统计图表
<?php
}
?>
<br>
用户登录统计(y轴为6分钟总登陆人次):<br>
<?php
if( file_exists( $_SERVER["DOCUMENT_ROOT"].$pngurl1 ) ){
?>
<img src="<?php echo $pngurl1;?>"></img>
<?php
}else{
?>
对不起,暂时无此日统计图表
<?php
}
?>
<br>
用户退出统计(y轴同上):<br>
<?php
if( file_exists( $_SERVER["DOCUMENT_ROOT"].$pngurl2 ) ){
?>
<img src="<?php echo $pngurl2;?>"></img>
<?php
}else{
?>
对不起,暂时无此日统计图表
<?php
}
?>
<br>
用户平均停留时间统计(y轴以10s为单位):<br>
<?php
if( file_exists( $_SERVER["DOCUMENT_ROOT"].$pngurl3 ) ){
?>
<img src="<?php echo $pngurl3;?>"></img>
<?php
}else{
?>
对不起,暂时无此日统计图表
<?php
}
?>
<?php
page_footer();
?>