MINI MINI MANI MO

Path : /home/lhcar/www/admin/sub11/
File Upload :
Current File : /home/lhcar/www/admin/sub11/list.php

<? include "$DOCUMENT_ROOT/admin/inc/header.php"; ?>
<?
	
if (!$stoday) {
	$smonth=date("Y-m");
	$stoday=date("Y-m",strtotime("now"." -11 months "))."-01";
}

$sql_ip="select * from counter where counter_date >= '".$stoday."' ";
//echo $sql_ip;
$result_ip=mysql_query($sql_ip);
while($data_ip=mysql_fetch_array($result_ip)){
	$co_d=explode("-" ,$data_ip[counter_date]);
	$sa_d[$co_d[0]][$co_d[1]][$co_d[2]]++;
}
?>

<table width="100%" border="0" cellpadding="0" cellspacing="0" height='100%'>
	<tr>
		<td width='150' height='100%' valign='top'  bgcolor="#ededed">
			<!--레프트메뉴--><!--/레프트메뉴-->		<? include "$DOCUMENT_ROOT/admin/inc/sub11.php"; ?></td>
		<td width='1' bgcolor='#78858c'></td>
		<td align="left" valign='top'>
<table width="1000" border="0" cellspacing="0" cellpadding="0" align="left" style="margin:20px;">
  <tr> 
    <td width="33%" height="20" align="left" class="title"><img src="/admin/img/icon_1.jpg"  style='vertical-align:middle'> <strong>일자별접속현황</strong></td>
    <td width="33%" align="left" >&nbsp;</td>
    <td width="33%" align="right" > </td>
  </tr>
    <tr> 
      <td colspan="3"><table width="1200" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
         
          <tr>
            <td align="center" valign="top"><table width="1200" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                  <td align="center" valign="top" class="con2">


				 
              
                      <table width="99%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
						  <td>


	<table width="1200" style="border-collapse:collapse;margin-top:10px;" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td style="border:1px solid #666666;width:31px;text-align:center;height:30px;">월</td>
<? for($ii=1;$ii<32;$ii++){ ?>
			<td style="border:1px solid #666666;width:31px;text-align:center;"><?=$ii?>일</td>
<? } ?>
			<td style="border:1px solid #666666;width:31px;text-align:center;">합계</td>
		</tr>
<?
for($i=0;$i<12;$i++){
?>
		<tr>
			<td style="border:1px solid #666666;width:50px;height:30px;"><?=$smonth?></td>
<? for($ii=1;$ii<32;$ii++){ ?>
<?
		$co_d_for=explode("-" ,$smonth);
		$year=$co_d_for[0];
		$month=sprintf("%02d",$co_d_for[1]);
		$day=sprintf("%02d",$ii);
		$month_sum[$i]+=$sa_d[$year][$month][$day];
?>
			<td style="border:1px solid #666666;text-align:right;"><?=number($sa_d[$year][$month][$day])?></td>
<? } ?>
			<td style="border:1px solid #666666;text-align:right;"><?=number($month_sum[$i])?></td>
		</tr>
<?
	$smonth=date("Y-m",strtotime($smonth."-01 -1 month "));
}
?>
	</table>
				 
<?
$view_article = 15; // 한화면에 나타날 게시물의 총 개수  
if (!$page) $page = 1; // 현재 페이지 지정되지 않았을 경우 1로 지정  
$start = ($page-1)*$view_article; 

$g5[visit_table]="g5_visit";
$g5[visit_sum_table]="g5_visit_sum";

define('G5_SERVER_TIME',    time());
define('G5_TIME_YMDHIS',    date('Y-m-d H:i:s', G5_SERVER_TIME));
define('G5_TIME_YMD',       substr(G5_TIME_YMDHIS, 0, 10));

if (empty($fr_date)) $fr_date = date('Y-m-d', time()-2592000);
if (empty($to_date)) $to_date = G5_TIME_YMD;


$max = 0;
$sum_count = 0;
$sql = " select * from {$g5['visit_table']}
            where vi_date between '{$fr_date}' and '{$to_date}' ";
$result = mysql_query($sql);
while ($row=mysql_fetch_array($result)) {
    $str = $row['vi_referer'];
    preg_match("/^http[s]*:\/\/([\.\-\_0-9a-zA-Z]*)\//", $str, $match);
    $s = $match[1];
    $s = preg_replace("/^(www\.|search\.|dirsearch\.|dir\.search\.|dir\.|kr\.search\.|myhome\.)(.*)/", "\\2", $s);
    $arr[$s]++;

    if ($arr[$s] > $max) $max = $arr[$s];

    $sum_count++;
}
?>
<table>
<tr>
<td style="padding-top:20px;"><?=$fr_date?>~<?=$to_date?></td>
</tr>
</table>
                      <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#646464">
                           <colgroup>
								<col width="15%" />
								<col width="30%" />
								<col width="20%" />
								<col width="20%" />
                          </colgroup>
						<tr bgcolor="#E8EEF7">
								<td height="28"  align="center" class="p_tt_n">순위</td>
								<td  align="center" class="p_tt_n">접속 도메인</td>
								<td  align="center" class="p_tt_n">접속자수</td>
								<td  align="center" class="p_tt_n">비율(%)</td>
            			</tr>
<?
    $i = 0;
    $k = 0;
    $save_count = -1;
    $tot_count = 0;
    if (count($arr)) {
        arsort($arr);
        foreach ($arr as $key=>$value) {
            $count = $arr[$key];
            if ($save_count != $count) {
                $i++;
                $no = $i;
                $save_count = $count;
            } else {
                $no = '';
            }

            if (!$key) {
                $link = '';
                $link2 = '';
                $key = '직접';
            } else {
                $link = '<a href="./visit_list.php?'.$qstr.'&amp;domain='.$key.'">';
                $link2 = '</a>';
            }

            $rate = ($count / $sum_count * 100);
            $s_rate = number_format($rate, 1);

            $bg = 'bg'.($i%2);
?>
                          <tr onblur="this.style.backgroundColor='#e5f4ff'" onfocus="this.style.backgroundColor='#FFF'" onMouseOver="this.style.backgroundColor='#e5f4ff'" onMouseOut="this.style.backgroundColor='#FFF'" style="background-color:#fff;">
							<td height="28" align="center"  ><?php echo $no ?></td>
                            <td  align="center" ><?php echo $key ?></td>
                            <td  align="center" ><?php echo $count ?></td>
                            <td  align="center" ><?php echo $s_rate ?></td>
                          </tr>
    <?php
        }
    } else {
        echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
    }
    ?>
                      </table>				 </td>
              </tr>
            </table></td>
          </tr>
        </table></td>
    </tr>
	<tr>
		<td height="20"></td>
	</tr>
  </table></td>
  </tr>
    <tr>
      <td colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3">&nbsp;</td>
    </tr>
</table>

</td></tr></table>
<? include "$DOCUMENT_ROOT/admin/inc/footer.php"; ?>

OHA YOOOO