-
Notifications
You must be signed in to change notification settings - Fork 249
/
Copy pathvisit_list.php
120 lines (98 loc) · 3.75 KB
/
visit_list.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
<?php
$sub_menu = "200800";
include_once('./_common.php');
auth_check_menu($auth, $sub_menu, 'r');
$fr_date = isset($_REQUEST['fr_date']) ? preg_replace('/[^0-9 :\-]/i', '', $_REQUEST['fr_date']) : G5_TIME_YMD;
$to_date = isset($_REQUEST['to_date']) ? preg_replace('/[^0-9 :\-]/i', '', $_REQUEST['to_date']) : G5_TIME_YMD;
$g5['title'] = '접속자집계';
include_once('./visit.sub.php');
$colspan = 6;
$sql_common = " from {$g5['visit_table']} ";
$sql_search = " where vi_date between '{$fr_date}' and '{$to_date}' ";
if (isset($domain))
$sql_search .= " and vi_referer like '%{$domain}%' ";
$sql = " select count(*) as cnt
{$sql_common}
{$sql_search} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select *
{$sql_common}
{$sql_search}
order by vi_id desc
limit {$from_record}, {$rows} ";
$result = sql_query($sql);
?>
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead>
<tr>
<th scope="col">IP</th>
<th scope="col">접속 경로</th>
<th scope="col">브라우저</th>
<th scope="col">OS</th>
<th scope="col">접속기기</th>
<th scope="col">일시</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $row=sql_fetch_array($result); $i++) {
$brow = $row['vi_browser'];
if(!$brow)
$brow = get_brow($row['vi_agent']);
$os = $row['vi_os'];
if(!$os)
$os = get_os($row['vi_agent']);
$device = $row['vi_device'];
$link = '';
$link2 = '';
$referer = '';
$title = '';
if ($row['vi_referer']) {
$referer = get_text(cut_str($row['vi_referer'], 255, ''));
$referer = urldecode($referer);
if (!is_utf8($referer)) {
$referer = iconv_utf8($referer);
}
$title = str_replace(array('<', '>', '&'), array("<", ">", "&"), $referer);
$link = '<a href="'.get_text($row['vi_referer']).'" target="_blank">';
$link = str_replace('&', "&", $link);
$link2 = '</a>';
}
if ($is_admin == 'super')
$ip = $row['vi_ip'];
else
$ip = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", G5_IP_DISPLAY, $row['vi_ip']);
if ($brow == '기타') { $brow = '<span title="'.get_text($row['vi_agent']).'">'.$brow.'</span>'; }
if ($os == '기타') { $os = '<span title="'.get_text($row['vi_agent']).'">'.$os.'</span>'; }
$bg = 'bg'.($i%2);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_category"><?php echo $ip ?></td>
<td><?php echo $link ?><?php echo $title ?><?php echo $link2 ?></td>
<td class="td_category td_category1"><?php echo $brow ?></td>
<td class="td_category td_category3"><?php echo $os ?></td>
<td class="td_category td_category2"><?php echo $device; ?></td>
<td class="td_datetime"><?php echo $row['vi_date'] ?> <?php echo $row['vi_time'] ?></td>
</tr>
<?php
}
if ($i == 0)
echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없거나 관리자에 의해 삭제되었습니다.</td></tr>';
?>
</tbody>
</table>
</div>
<?php
if (isset($domain))
$qstr .= "&domain=$domain";
$qstr .= "&page=";
$pagelist = get_paging($config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr");
echo $pagelist;
include_once('./admin.tail.php');