마크업:관리자>접속자현황 visit_list.php 작업중

This commit is contained in:
whitedot
2012-11-15 17:48:04 +09:00
parent c41d0f01ca
commit 8851b2adf8
10 changed files with 258 additions and 263 deletions

View File

@ -9,28 +9,21 @@ if (empty($to_date)) $to_date = $g4['time_ymd'];
$qstr = 'fr_date='.$fr_date.'&to_date='.$to_date; $qstr = 'fr_date='.$fr_date.'&to_date='.$to_date;
?> ?>
<table width=100% cellpadding=3 cellspacing=1> <form id="fvisit" name="fvisit" method="get">
<form id="fvisit" name="fvisit" method=get> <fieldset>
<tr> <legend>접속자현황 열람조건 지정</legend>
<td> <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="text" id="fr_date" name="fr_date" size=11 maxlength=10 value='<?=$fr_date?>'> <input type="button" value="도메인" onclick="fvisit_submit('visit_domain.php');">
- <input type="button" value="브라우저" onclick="fvisit_submit('visit_browser.php');">
<input type="text" id="to_date" name="to_date" size=11 maxlength=10 value='<?=$to_date?>'> <input type="button" value="운영체제" onclick="fvisit_submit('visit_os.php');">
&nbsp; <input type="button" value="시간" onclick="fvisit_submit('visit_hour.php');">
<input type=button class=btn1 value=' 접속자 ' onclick="fvisit_submit('visit_list.php');"> <input type="button" value="요일" onclick="fvisit_submit('visit_week.php');">
<input type=button class=btn1 value=' 도메인 ' onclick="fvisit_submit('visit_domain.php');"> <input type="button" value="일" onclick="fvisit_submit('visit_date.php');">
<input type=button class=btn1 value=' 브라우저 ' onclick="fvisit_submit('visit_browser.php');"> <input type="button" value="월" onclick="fvisit_submit('visit_month.php');">
<input type=button class=btn1 value=' OS ' onclick="fvisit_submit('visit_os.php');"> <input type="button" value="년" onclick="fvisit_submit('visit_year.php');">
<input type=button class=btn1 value=' 시간 ' onclick="fvisit_submit('visit_hour.php');"> </fieldset>
<input type=button class=btn1 value=' 요일 ' onclick="fvisit_submit('visit_week.php');">
<input type=button class=btn1 value=' 일 ' onclick="fvisit_submit('visit_date.php');">
<input type=button class=btn1 value=' 월 ' onclick="fvisit_submit('visit_month.php');">
<input type=button class=btn1 value=' 년 ' onclick="fvisit_submit('visit_year.php');">
</td>
</tr>
</form> </form>
</table>
<script type='text/javascript'> <script type='text/javascript'>
function fvisit_submit(act) function fvisit_submit(act)

View File

@ -9,28 +9,11 @@ include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
$colspan = 5; $colspan = 5;
?>
<table>
<colgroup width=100>
<colgroup width=200>
<colgroup width=100>
<colgroup width=100>
<colgroup width=''>
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr>
<tr class='bgcol1 bold col1 ht center'>
<td>순위</td>
<td>브라우저</td>
<td>방문자수</td>
<td>비율(%)</td>
<td>그래프</td>
</tr>
<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']}
where vi_date between '$fr_date' and '$to_date' "; where vi_date between '{$fr_date}' and '{$to_date}' ";
$result = sql_query($sql); $result = sql_query($sql);
while ($row=sql_fetch_array($result)) { while ($row=sql_fetch_array($result)) {
$s = get_brow($row['vi_agent']); $s = get_brow($row['vi_agent']);
@ -41,7 +24,27 @@ while ($row=sql_fetch_array($result)) {
$sum_count++; $sum_count++;
} }
?>
<table>
<caption></caption>
<thead>
<tr>
<td>순위</td>
<td>브라우저</td>
<td>방문자수</td>
<td>비율(%)</td>
<td>그래프</td>
</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;
@ -62,31 +65,27 @@ 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>
<td>$s_rate</td> <div class="visit_bar">
<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 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

@ -9,37 +9,42 @@ include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
$colspan = 4; $colspan = 4;
?>
<table>
<colgroup width=100>
<colgroup width=100>
<colgroup width=100>
<colgroup width=''>
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr>
<tr class='bgcol1 bold col1 ht center'>
<td>년-월-일</td>
<td>방문자수</td>
<td>비율(%)</td>
<td>그래프</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<?
$max = 0; $max = 0;
$sum_count = 0; $sum_count = 0;
$sql = " select vs_date, vs_count as cnt $sql = " select vs_date, 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}'
order by vs_date desc "; order by vs_date 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_date']] = $row['cnt']; $arr[$row['vs_date']] = $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;
@ -52,30 +57,26 @@ 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_list.php?fr_date=<?=$key?>&to_date=<?=$key?>"><?=$key?></a></td>
<tr class='list$list ht center'> <td><?=number_format($value)?></td>
<td><a href='./visit_list.php?fr_date=$key&to_date=$key' 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

@ -9,28 +9,11 @@ include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
$colspan = 5; $colspan = 5;
?>
<table>
<colgroup width=100>
<colgroup width=200>
<colgroup width=100>
<colgroup width=100>
<colgroup width=''>
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr>
<tr class='bgcol1 bold col1 ht center'>
<td>순위</td>
<td>접속 도메인</td>
<td>방문자수</td>
<td>비율(%)</td>
<td>그래프</td>
</tr>
<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']}
where vi_date between '$fr_date' and '$to_date' "; where vi_date between '{$fr_date}' and '{$to_date}' ";
$result = sql_query($sql); $result = sql_query($sql);
while ($row=sql_fetch_array($result)) { while ($row=sql_fetch_array($result)) {
$str = $row['vi_referer']; $str = $row['vi_referer'];
@ -43,7 +26,28 @@ while ($row=sql_fetch_array($result)) {
$sum_count++; $sum_count++;
} }
?>
<table>
<caption></caption>
<thead>
<tr>
<th scope="col">순위</th>
<th scope="col">접속 도메인</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;
@ -57,45 +61,41 @@ if (count($arr)) {
$no = $i; $no = $i;
$save_count = $count; $save_count = $count;
} else { } else {
$no = ""; $no = '';
} }
if (!$key) { if (!$key) {
$link = ""; $link = '';
$key = "직접"; $link2 = '';
$key = '직접';
} else { } else {
$link = "<a href='./visit_list.php?$qstr&domain=$key' title='상세보기'>"; $link = '<a href="./visit_list.php?$qstr&amp;domain='.$key.'">';
$link2 = '</a>';
} }
$rate = ($count / $sum_count * 100); $rate = ($count / $sum_count * 100);
$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'>"; ?>
<tr>
$list = ($k++%2); <td><?=$no?></td>
echo " <td><?=$link?><?=$key?><?=$link2?></td>
<tr class='list$list ht center'> <td><?=$count?></td>
<td>$no</td> <td><?=$s_rate?></td>
<td align=left>$link$key</a></td> <td>
<td>$count</td> <div class="visit_graph">
<td>$s_rate</td> <span style="width:<?=$bar?>%"></span>
<td align=left>$graph</td> </div>
</tr>"; </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

@ -9,38 +9,43 @@ include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
$colspan = 4; $colspan = 4;
?>
<table>
<colgroup width=100>
<colgroup width=100>
<colgroup width=100>
<colgroup width=''>
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr>
<tr class='bgcol1 bold col1 ht center'>
<td>시간</td>
<td>방문자수</td>
<td>비율(%)</td>
<td>그래프</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<?
$max = 0; $max = 0;
$sum_count = 0; $sum_count = 0;
$sql = " select SUBSTRING(vi_time,1,2) as vi_hour, count(vi_id) as cnt $sql = " select SUBSTRING(vi_time,1,2) as vi_hour, count(vi_id) as cnt
from {$g4['visit_table']} from {$g4['visit_table']}
where vi_date between '$fr_date' and '$to_date' where vi_date between '{$fr_date}' and '{$to_date}'
group by vi_hour group by vi_hour
order by vi_hour "; order by vi_hour ";
$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['vi_hour']] = $row['cnt']; $arr[$row['vi_hour']] = $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>
<?
$k = 0; $k = 0;
if ($i) { if ($i) {
for ($i=0; $i<24; $i++) { for ($i=0; $i<24; $i++) {
@ -51,31 +56,25 @@ if ($i) {
$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'>"; ?>
<tr>
$list = ($k++%2); <td><?=$hour?></td>
echo " <td><?=number_format($count)?></td>
<tr class='list$list ht center'> <td><?=$s_rate?></td>
<td>$hour</td> <td>
<td>".number_format($count)."</td> <div class="visit_graph">
<td>$s_rate</td> <span style="width:<?=$bar?>%"></span>
<td align=left>$graph</td> </div>
</tr>"; </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><br><br> </table>
<? <?
include_once('./admin.tail.php'); include_once('./admin.tail.php');

View File

@ -9,24 +9,7 @@ include_once('./admin.head.php');
include_once('./visit.sub.php'); include_once('./visit.sub.php');
$colspan = 5; $colspan = 5;
?>
<table>
<colgroup width=100>
<colgroup width=350>
<colgroup width=100>
<colgroup width=100>
<colgroup width=''>
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr>
<tr class='bgcol1 bold col1 ht center'>
<td>IP</td>
<td>접속 경로</td>
<td>브라우저</td>
<td>OS</td>
<td>일시</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<?
//unset($br); // 브라우저 //unset($br); // 브라우저
//unset($os); // OS //unset($os); // OS
@ -53,7 +36,21 @@ $sql = " select *
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>
<caption></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>
</tr>
</thead>
<tbody>
<?
for ($i=0; $row=sql_fetch_array($result); $i++) { for ($i=0; $row=sql_fetch_array($result); $i++) {
$brow = get_brow($row['vi_agent']); $brow = get_brow($row['vi_agent']);
$os = get_os($row['vi_agent']); $os = get_os($row['vi_agent']);
@ -89,27 +86,30 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
if ($brow == '기타') { $brow = "<span title='{$row['vi_agent']}'>$brow</span>"; } if ($brow == '기타') { $brow = "<span title='{$row['vi_agent']}'>$brow</span>"; }
if ($os == '기타') { $os = "<span title='{$row['vi_agent']}'>$os</span>"; } if ($os == '기타') { $os = "<span title='{$row['vi_agent']}'>$os</span>"; }
$list = ($i%2); ?>
echo " <tr>
<tr class='list$list col1 ht center'> <td><?=$ip?></td>
<td>$ip</td> <td><?=$link?><?=$title?></a></td>
<td align=left><nobr style='display:block; overflow:hidden; width:350;'>$link$title</a></nobr></td> <td><?=$brow?></td>
<td>$brow</td> <td><?=$os?></td>
<td>$os</td> <td><?=$row['vi_date']?> <?=$row['vi_time']?></td>
<td>{$row['vi_date']} {$row['vi_time']}</td> </tr>
</tr>";
}
<?
}
if ($i == 0) if ($i == 0)
echo "<tr><td colspan='$colspan' height=100 align=center>자료가 없습니다.</td></tr>"; echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
?>
echo "<tr><td colspan='$colspan' class='line2'></td></tr>"; </tbody>
echo "</table>"; </table>
<?
$page = get_paging($config['cf_write_pages'], $page, $total_page, "$_SERVER[PHP_SELF]?$qstr&domain=$domain&page="); $page = get_paging($config['cf_write_pages'], $page, $total_page, "$_SERVER[PHP_SELF]?$qstr&amp;domain=$domain&amp;page=");
if ($page) { if ($page) {
echo "<table width=100% cellpadding=3 cellspacing=1><tr><td align=right>$page</td></tr></table>"; ?>
<div class="paginate">
<?=$page?>
</div>
<?
} }
include_once('./admin.tail.php'); include_once('./admin.tail.php');
?> ?>

View File

@ -12,17 +12,18 @@ $colspan = 4;
?> ?>
<table> <table>
<colgroup width=100> <caption></caption>
<colgroup width=100> <thead>
<colgroup width=100> <tr>
<colgroup width=''> <th scope="row">년-월</th>
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr> <th scope="row">방문자수</th>
<tr class='bgcol1 bold col1 ht center'> <th scope="row">비율(%)</th>
<td>년-월</td> <th scope="row">그래프</th>
<td>방문자수</td>
<td>비율(%)</td>
<td>그래프</td>
</tr> </tr>
</thead>
<tfoot>
</tfoot>
<tbody>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr> <tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<? <?
$max = 0; $max = 0;

View File

@ -12,19 +12,19 @@ $colspan = 5;
?> ?>
<table> <table>
<colgroup width=100> <caption></caption>
<colgroup width=200> <thead>
<colgroup width=100> <tr>
<colgroup width=100> <th scope="row">순위</th>
<colgroup width=''> <th scope="row">OS</th>
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr> <th scope="row">방문자수</th>
<tr class='bgcol1 bold col1 ht center'> <th scope="row">비율(%)</th>
<td>순위</td> <th scope="row">그래프</th>
<td>OS</td>
<td>방문자수</td>
<td>비율(%)</td>
<td>그래프</td>
</tr> </tr>
</thead>
<tfoot>
</tfoot>
<tbody>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr> <tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<? <?
$max = 0; $max = 0;

View File

@ -12,17 +12,18 @@ $colspan = 4;
?> ?>
<table> <table>
<colgroup width=100> <caption></caption>
<colgroup width=100> <thead>
<colgroup width=100> <tr>
<colgroup width=''> <th scope="row">요일</th>
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr> <th scope="row">방문자수</th>
<tr class='bgcol1 bold col1 ht center'> <th scope="row">비율(%)</th>
<td>요일</td> <th scope="row">그래프</th>
<td>방문자수</td>
<td>비율(%)</td>
<td>그래프</td>
</tr> </tr>
</thead>
<tfoot>
</tfoot>
<tbody>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr> <tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<? <?
$weekday = array ('월', '화', '수', '목', '금', '토', '일'); $weekday = array ('월', '화', '수', '목', '금', '토', '일');

View File

@ -12,17 +12,18 @@ $colspan = 4;
?> ?>
<table> <table>
<colgroup width=100> <caption></caption>
<colgroup width=100> <thead>
<colgroup width=100> <tr>
<colgroup width=''> <th scope="row">년</th>
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr> <th scope="row">방문자수</th>
<tr class='bgcol1 bold col1 ht center'> <th scope="row">비율(%)</th>
<td>년</td> <th scope="row">그래프</th>
<td>방문자수</td>
<td>비율(%)</td>
<td>그래프</td>
</tr> </tr>
</thead>
<tfoot>
</tfoot>
<tbody>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr> <tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<? <?
$max = 0; $max = 0;