마크업:관리자>접속자

This commit is contained in:
whitedot
2012-11-16 09:51:44 +09:00
parent 8851b2adf8
commit e856b3ef74
11 changed files with 188 additions and 198 deletions

View File

@ -4,7 +4,7 @@ $menu['menu200'] = array (
array('200100', '회원관리', ''.$g4['admin_path'].'/member_list.php', 'mb_list'), array('200100', '회원관리', ''.$g4['admin_path'].'/member_list.php', 'mb_list'),
array('200200', '포인트관리', ''.$g4['admin_path'].'/point_list.php', 'mb_point'), array('200200', '포인트관리', ''.$g4['admin_path'].'/point_list.php', 'mb_point'),
array('200300', '회원메일발송', ''.$g4['admin_path'].'/mail_list.php', 'mb_mail'), array('200300', '회원메일발송', ''.$g4['admin_path'].'/mail_list.php', 'mb_mail'),
array('200800', '접속자현황', ''.$g4['admin_path'].'/visit_list.php', 'mb_visit'), array('200800', '접속자집계', ''.$g4['admin_path'].'/visit_list.php', 'mb_visit'),
array('200900', '투표관리', ''.$g4['admin_path'].'/poll_list.php', 'mb_poll') array('200900', '투표관리', ''.$g4['admin_path'].'/poll_list.php', 'mb_poll')
); );
?> ?>

View File

@ -11,7 +11,7 @@ $qstr = 'fr_date='.$fr_date.'&to_date='.$to_date;
<form id="fvisit" name="fvisit" method="get"> <form id="fvisit" name="fvisit" method="get">
<fieldset> <fieldset>
<legend>접속자현황 열람조건 지정</legend> <legend>접속자집계 열람조건 지정</legend>
<span>기간지정 <input type="text" id="fr_date" name="fr_date" size=11 maxlength=10 value='<?=$fr_date?>'> 부터 <input type="text" id="to_date" name="to_date" size=11 maxlength=10 value='<?=$to_date?>'> 까지</span> <span>기간지정 <input type="text" id="fr_date" name="fr_date" size=11 maxlength=10 value='<?=$fr_date?>'> 부터 <input type="text" id="to_date" name="to_date" size=11 maxlength=10 value='<?=$to_date?>'> 까지</span>
<input type="button" value="접속자" onclick="fvisit_submit('visit_list.php');"> <input type="button" value="접속자" onclick="fvisit_submit('visit_list.php');">
<input type="button" value="도메인" onclick="fvisit_submit('visit_domain.php');"> <input type="button" value="도메인" onclick="fvisit_submit('visit_domain.php');">
@ -25,7 +25,7 @@ $qstr = 'fr_date='.$fr_date.'&amp;to_date='.$to_date;
</fieldset> </fieldset>
</form> </form>
<script type='text/javascript'> <script>
function fvisit_submit(act) function fvisit_submit(act)
{ {
var f = document.fvisit; var f = document.fvisit;

View File

@ -4,7 +4,7 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], 'r'); auth_check($auth[$sub_menu], 'r');
$g4['title'] = '브라우저별 접속자현황'; $g4['title'] = '브라우저별 접속자집계';
include_once('./admin.head.php'); include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
@ -26,14 +26,14 @@ while ($row=sql_fetch_array($result)) {
} }
?> ?>
<table> <table>
<caption></caption> <caption>브라우저별 접속자 수</caption>
<thead> <thead>
<tr> <tr>
<td>순위</td> <th scope="col">순위</th>
<td>브라우저</td> <th scope="col">브라우저</th>
<td>방문자수</td> <th scope="col">접속자수</th>
<td>비율(%)</td> <th scope="col">비율(%)</th>
<td>그래프</td> <th scope="col">그래프</th>
</tr> </tr>
</thead> </thead>
<tfoot> <tfoot>

View File

@ -4,7 +4,7 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], 'r'); auth_check($auth[$sub_menu], 'r');
$g4['title'] = '일별 접속자현황'; $g4['title'] = '일별 접속자집계';
include_once('./admin.head.php'); include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
@ -27,11 +27,11 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
?> ?>
<table> <table>
<caption></caption> <caption>일별 접속자 수</caption>
<thead> <thead>
<tr> <tr>
<th scope="col">년-월-일</th> <th scope="col">년-월-일</th>
<th scope="col">방문자수</th> <th scope="col">접속자수</th>
<th scope="col">비율(%)</th> <th scope="col">비율(%)</th>
<th scope="col">그래프</th> <th scope="col">그래프</th>
</tr> </tr>

View File

@ -4,7 +4,7 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], 'r'); auth_check($auth[$sub_menu], 'r');
$g4['title'] = '도메인별 접속자현황'; $g4['title'] = '도메인별 접속자집계';
include_once('./admin.head.php'); include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
@ -29,12 +29,12 @@ while ($row=sql_fetch_array($result)) {
?> ?>
<table> <table>
<caption></caption> <caption>도메인별 접속자 수</caption>
<thead> <thead>
<tr> <tr>
<th scope="col">순위</th> <th scope="col">순위</th>
<th scope="col">접속 도메인</th> <th scope="col">접속 도메인</th>
<th scope="col">방문자수</th> <th scope="col">접속자수</th>
<th scope="col">비율(%)</th> <th scope="col">비율(%)</th>
<th scope="col">그래프</th> <th scope="col">그래프</th>
</tr> </tr>

View File

@ -4,7 +4,7 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], 'r'); auth_check($auth[$sub_menu], 'r');
$g4['title'] = '시간별 접속자현황'; $g4['title'] = '시간별 접속자집계';
include_once('./admin.head.php'); include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
@ -28,11 +28,11 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
?> ?>
<table> <table>
<caption></caption> <caption>시간대별 접속자 수</caption>
<thead> <thead>
<tr> <tr>
<th scope="col">시간</th> <th scope="col">시간</th>
<th scope="col">방문자수</th> <th scope="col">접속자수</th>
<th scope="col">비율(%)</th> <th scope="col">비율(%)</th>
<th scope="col">그래프</th> <th scope="col">그래프</th>
</tr> </tr>

View File

@ -4,7 +4,7 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], 'r'); auth_check($auth[$sub_menu], 'r');
$g4['title'] = '접속자현황'; $g4['title'] = '접속자집계';
include_once('./admin.head.php'); include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
@ -14,38 +14,38 @@ $colspan = 5;
//unset($os); // OS //unset($os); // OS
$sql_common = " from {$g4['visit_table']} "; $sql_common = " from {$g4['visit_table']} ";
$sql_search = " where vi_date between '$fr_date' and '$to_date' "; $sql_search = " where vi_date between '{$fr_date}' and '{$to_date}' ";
if ($domain) { if ($domain) {
$sql_search .= " and vi_referer like '%$domain%' "; $sql_search .= " and vi_referer like '%{$domain}%' ";
} }
$sql = " select count(*) as cnt $sql = " select count(*) as cnt
$sql_common {$sql_common}
$sql_search "; {$sql_search} ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
$total_count = $row['cnt']; $total_count = $row[cnt];
$rows = $config['cf_page_rows']; $rows = $config[cf_page_rows];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산 $total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == '') $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지) if ($page == '') $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함 $from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select * $sql = " select *
$sql_common {$sql_common}
$sql_search {$sql_search}
order by vi_id desc order by vi_id desc
limit $from_record, $rows "; limit {$from_record}, {$rows} ";
$result = sql_query($sql); $result = sql_query($sql);
?> ?>
<table> <table>
<caption></caption> <caption>접속자 개요 (IP, 경로, 브라우저, 운영체제, 일시)</caption>
<thead> <thead>
<tr> <tr>
<th scope="col">IP</th> <th scope="col">IP</th>
<th scope="col">접속 경로</th> <th scope="col">접속 경로</th>
<th scope="col">브라우저</th> <th scope="col">브라우저</th>
<th scope="col">OS</th> <th scope="col">운영체제</th>
<th scope="col">일시</th> <th scope="col">일시</th>
</tr> </tr>
</thead> </thead>

View File

@ -4,44 +4,48 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], 'r'); auth_check($auth[$sub_menu], 'r');
$g4['title'] = '월별 접속자현황'; $g4['title'] = '월별 접속자집계';
include_once('./admin.head.php'); include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
$colspan = 4; $colspan = 4;
?>
<table>
<caption></caption>
<thead>
<tr>
<th scope="row">년-월</th>
<th scope="row">방문자수</th>
<th scope="row">비율(%)</th>
<th scope="row">그래프</th>
</tr>
</thead>
<tfoot>
</tfoot>
<tbody>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<?
$max = 0; $max = 0;
$sum_count = 0; $sum_count = 0;
$sql = " select SUBSTRING(vs_date,1,7) as vs_month, SUM(vs_count) as cnt $sql = " select SUBSTRING(vs_date,1,7) as vs_month, SUM(vs_count) as cnt
from {$g4['visit_sum_table']} from {$g4['visit_sum_table']}
where vs_date between '$fr_date' and '$to_date' where vs_date between '{$fr_date}' and '{$to_date}'
group by vs_month group by vs_month
order by vs_month desc "; order by vs_month desc ";
$result = sql_query($sql); $result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) { for ($i=0; $row=sql_fetch_array($result); $i++) {
$arr[$row['vs_month']] = $row['cnt']; $arr[$row['vs_month']] = $row[cnt];
if ($row['cnt'] > $max) $max = $row['cnt']; if ($row[cnt] > $max) $max = $row[cnt];
$sum_count += $row['cnt']; $sum_count += $row[cnt];
} }
?>
<table>
<caption>월별 접속자 수</caption>
<thead>
<tr>
<th scope="col">년-월</th>
<th scope="col">접속자수</th>
<th scope="col">비율(%)</th>
<th scope="col">그래프</th>
</tr>
</thead>
<tfoot>
<tr>
<td>합계</td>
<td><?=number_format($sum_count)?></td>
<td colspan="2"></td>
</tr>
</tfoot>
<tbody>
<?
$i = 0; $i = 0;
$k = 0; $k = 0;
$save_count = -1; $save_count = -1;
@ -54,30 +58,29 @@ if (count($arr)) {
$s_rate = number_format($rate, 1); $s_rate = number_format($rate, 1);
$bar = (int)($count / $max * 100); $bar = (int)($count / $max * 100);
$graph = "<img src='{$g4['admin_path']}/img/graph.gif' width='$bar%' height='18'>"; ?>
$list = ($k++%2); <tr>
echo " <td><a href="./visit_date.php?fr_date=<?=$key?>-01&amp;to_date=<?=$key?>-31"><?=$key?></a></td>
<tr class='list$list ht center'> <td><?=number_format($value)?></td>
<td><a href='./visit_date.php?fr_date=$key-01&to_date=$key-31' class=tt>$key</a></td> <td><?=$s_rate?></td>
<td>".number_format($value)."</td> <td>
<td>$s_rate</td> <div class="visit_graph">
<td align=left>$graph</td> <span style="width:<?=$bar?>%"></span>
</tr>"; </div>
</td>
</tr>
<?
} }
echo "
<tr><td colspan='$colspan' class='line2'></td></tr>
<tr class='bgcol2 bold col1 ht center'>
<td>합계</td>
<td>".number_format($sum_count)."</td>
<td colspan=2>&nbsp;</td>
</tr>";
} else { } else {
echo "<tr><td colspan='$colspan' height=100 align=center>자료가 없습니다.</td></tr>"; echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
} }
?> ?>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
</tbody>
</table> </table>
<? <?

View File

@ -4,29 +4,12 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], 'r'); auth_check($auth[$sub_menu], 'r');
$g4['title'] = 'OS별 접속자현황'; $g4['title'] = 'OS별 접속자집계';
include_once('./admin.head.php'); include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
$colspan = 5; $colspan = 5;
?>
<table>
<caption></caption>
<thead>
<tr>
<th scope="row">순위</th>
<th scope="row">OS</th>
<th scope="row">방문자수</th>
<th scope="row">비율(%)</th>
<th scope="row">그래프</th>
</tr>
</thead>
<tfoot>
</tfoot>
<tbody>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<?
$max = 0; $max = 0;
$sum_count = 0; $sum_count = 0;
$sql = " select * from {$g4['visit_table']} $sql = " select * from {$g4['visit_table']}
@ -41,7 +24,28 @@ while ($row=sql_fetch_array($result)) {
$sum_count++; $sum_count++;
} }
?>
<table>
<caption>운영체제별 접속자 수</caption>
<thead>
<tr>
<th scope="col">순위</th>
<th scope="col">OS</th>
<th scope="col">접속자수</th>
<th scope="col">비율(%)</th>
<th scope="col">그래프</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="2">합계</td>
<td><?=$sum_count?></td>
<td colspan="2"></td>
</tr>
</tfoot>
<tbody>
<?
$i = 0; $i = 0;
$k = 0; $k = 0;
$save_count = -1; $save_count = -1;
@ -66,31 +70,23 @@ if (count($arr)) {
$s_rate = number_format($rate, 1); $s_rate = number_format($rate, 1);
$bar = (int)($count / $max * 100); $bar = (int)($count / $max * 100);
$graph = "<img src='{$g4['admin_path']}/img/graph.gif' width='$bar%' height='18'>"; ?>
$list = ($k++%2); <tr>
echo " <td><?=$no?></td>
<tr class='list$list ht center'> <td><?=$key?></td>
<td>$no</td> <td><?=$count?></td>
<td>$key</td> <td><?=$s_rate?></td>
<td>$count</td> <td><?=$graph?></td>
<td>$s_rate</td> </tr>
<td align=left>$graph</td>
</tr>"; <?
} }
echo "
<tr><td colspan='$colspan' class='line2'></td></tr>
<tr class='bgcol2 bold col1 ht center'>
<td colspan=2>합계</td>
<td>$sum_count</td>
<td colspan=2>&nbsp;</td>
</tr>";
} else { } else {
echo "<tr><td colspan='$colspan' height=100 align=center>자료가 없습니다.</td></tr>"; echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
} }
?> ?>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr> </tbody>
</table> </table>
<? <?

View File

@ -4,43 +4,46 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], 'r'); auth_check($auth[$sub_menu], 'r');
$g4['title'] = '요일별 접속자현황'; $g4['title'] = '요일별 접속자집계';
include_once('./admin.head.php'); include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
$colspan = 4; $colspan = 4;
?>
<table>
<caption></caption>
<thead>
<tr>
<th scope="row">요일</th>
<th scope="row">방문자수</th>
<th scope="row">비율(%)</th>
<th scope="row">그래프</th>
</tr>
</thead>
<tfoot>
</tfoot>
<tbody>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<?
$weekday = array ('월', '화', '수', '목', '금', '토', '일'); $weekday = array ('월', '화', '수', '목', '금', '토', '일');
$sum_count = 0; $sum_count = 0;
$sql = " select WEEKDAY(vs_date) as weekday_date, SUM(vs_count) as cnt $sql = " select WEEKDAY(vs_date) as weekday_date, SUM(vs_count) as cnt
from {$g4['visit_sum_table']} from {$g4['visit_sum_table']}
where vs_date between '$fr_date' and '$to_date' where vs_date between '{$fr_date}' and '{$to_date}'
group by weekday_date group by weekday_date
order by weekday_date "; order by weekday_date ";
$result = sql_query($sql); $result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) { for ($i=0; $row=sql_fetch_array($result); $i++) {
$arr[$row['weekday_date']] = $row['cnt']; $arr[$row['weekday_date']] = $row[cnt];
$sum_count += $row['cnt']; $sum_count += $row[cnt];
} }
?>
<table>
<caption>요일별 접속자 수</caption>
<thead>
<tr>
<th scope="col">요일</th>
<th scope="col">접속자수</th>
<th scope="col">비율(%)</th>
<th scope="col">그래프</th>
</tr>
</thead>
<tfoot>
<tr>
<td>합계</td>
<td><?=$sum_count?></td>
<td colspan="2"></td>
</tr>
</tfoot>
<tbody>
<?
$k = 0; $k = 0;
if ($i) { if ($i) {
for ($i=0; $i<7; $i++) { for ($i=0; $i<7; $i++) {
@ -48,30 +51,22 @@ if ($i) {
$rate = ($count / $sum_count * 100); $rate = ($count / $sum_count * 100);
$s_rate = number_format($rate, 1); $s_rate = number_format($rate, 1);
$graph = "<img src='{$g4['admin_path']}/img/graph.gif' width='$rate%' height='18'>"; ?>
$list = ($k++%2); <tr>
echo " <td><?=$weekday[$i]?></td>
<tr class='list$list ht center'> <td><?=$count?></td>
<td>$weekday[$i]</td> <td><?=$s_rate?></td>
<td>$count</td> <td><?=$graph?></td>
<td>$s_rate</td> </tr>
<td align=left>$graph</td>
</tr>"; <?
} }
echo "
<tr><td colspan='$colspan' class='line2'></td></tr>
<tr class='bgcol2 bold col1 ht center'>
<td>합계</td>
<td>$sum_count</td>
<td colspan=2>&nbsp;</td>
</tr>";
} else { } else {
echo "<tr><td colspan='$colspan' height=100 align=center>자료가 없습니다.</td></tr>"; echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
} }
?> ?>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr> </tbody>
</table> </table>
<? <?

View File

@ -4,44 +4,48 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], 'r'); auth_check($auth[$sub_menu], 'r');
$g4['title'] = '연도별 접속자현황'; $g4['title'] = '연도별 접속자집계';
include_once('./admin.head.php'); include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
$colspan = 4; $colspan = 4;
?>
<table>
<caption></caption>
<thead>
<tr>
<th scope="row">년</th>
<th scope="row">방문자수</th>
<th scope="row">비율(%)</th>
<th scope="row">그래프</th>
</tr>
</thead>
<tfoot>
</tfoot>
<tbody>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<?
$max = 0; $max = 0;
$sum_count = 0; $sum_count = 0;
$sql = " select SUBSTRING(vs_date,1,4) as vs_year, SUM(vs_count) as cnt $sql = " select SUBSTRING(vs_date,1,4) as vs_year, SUM(vs_count) as cnt
from {$g4['visit_sum_table']} from {$g4['visit_sum_table']}
where vs_date between '$fr_date' and '$to_date' where vs_date between '{$fr_date}' and '{$to_date}'
group by vs_year group by vs_year
order by vs_year desc "; order by vs_year desc ";
$result = sql_query($sql); $result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) { for ($i=0; $row=sql_fetch_array($result); $i++) {
$arr[$row['vs_year']] = $row['cnt']; $arr[$row['vs_year']] = $row[cnt];
if ($row['cnt'] > $max) $max = $row['cnt']; if ($row[cnt] > $max) $max = $row[cnt];
$sum_count += $row['cnt']; $sum_count += $row[cnt];
} }
?>
<table>
<caption>연간 접속자 수</caption>
<thead>
<tr>
<th scope="col">년</th>
<th scope="col">접속자수</th>
<th scope="col">비율(%)</th>
<th scope="col">그래프</th>
</tr>
</thead>
<tfoot>
<tr>
<td>합계</td>
<td><?=number_format($sum_count)?></td>
<td colspan="2"></td>
</tr>
</tfoot>
<tbody>
<?
$i = 0; $i = 0;
$k = 0; $k = 0;
$save_count = -1; $save_count = -1;
@ -54,30 +58,22 @@ if (count($arr)) {
$s_rate = number_format($rate, 1); $s_rate = number_format($rate, 1);
$bar = (int)($count / $max * 100); $bar = (int)($count / $max * 100);
$graph = "<img src='{$g4['admin_path']}/img/graph.gif' width='$bar%' height='18'>"; ?>
$list = ($k++%2); <tr>
echo " <td><a href="./visit_month.php?fr_date=<?=$key?>-01-01&amp;to_date=<?=$key?>-12-31"><?=$key?></a></td>
<tr class='list$list ht center'> <td><?=number_format($value)?></td>
<td><a href='./visit_month.php?fr_date=$key-01-01&to_date=$key-12-31' class=tt>$key</a></td> <td><?=$s_rate?></td>
<td>".number_format($value)."</td> <td><?=$graph?></td>
<td>$s_rate</td> </tr>
<td align=left>$graph</td>
</tr>"; <?
} }
echo "
<tr><td colspan='$colspan' class='line2'></td></tr>
<tr class='bgcol2 bold col1 ht center'>
<td>합계</td>
<td>".number_format($sum_count)."</td>
<td colspan=2>&nbsp;</td>
</tr>";
} else { } else {
echo "<tr><td colspan='$colspan' height=100 align=center>자료가 없습니다.</td></tr>"; echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
} }
?> ?>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr> </tbody>
</table> </table>
<? <?