티스토리 뷰
<? include "$_SERVER[DOCUMENT_ROOT]/login@admin/admin_session_login_check.php";?>
< ?
$yearTemp = $_REQUEST["yearTemp"]; if($yearTemp == "") { $yearTemp = date("Y"); }
$monthTemp = $_REQUEST["monthTemp"]; if($monthTemp == "") { $monthTemp = date("m"); }
include $_SERVER[DOCUMENT_ROOT]."/BBS/include/dbconn.inc";
$query = "SELECT * FROM visitCount";
$result = mysql_query($query);
$rowData = mysql_num_rows($result);
?>
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< HTML xmlns="http://www.w3.org/1999/xhtml">
< HEAD>
<title>::스몰킹블루베리 관리자모드::</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/login@admin/_css/main.css" rel="stylesheet" type="text/css" />
<SCRIPT language="javascript" type="text/javascript" src="/login@admin/_js/mTree.js"></SCRIPT>
< /HEAD>
< BODY>
< table border="1" style="border:1px solid #CCCCCC; font-size:12px;" cellpadding="3" cellspacing="3">
<tr>
<td colspan="2" style="padding-left:10px; padding-right:10px;"><strong>방문자 접속 현황</strong></td>
</tr>
<tr>
<td>TOTAL</td><!-- 101780 -->
<td>
<table><tr><td bgcolor="#CCCCCC" width="<?=(($rowData+101780)/150)?>"> </td></tr></table>
<?=number_format($rowData+101780)?> 명
</td>
</tr>
< ?
$today = date("Y-m-d");
$query = "SELECT * FROM visitCount WHERE regdate=`$today`";
$result = mysql_query($query);
$rowData = mysql_num_rows($result);
?>
<tr>
<td>TODAY</td>
<td>
<table><tr><td bgcolor="#CCCCCC" width="<?=$rowData?>"> </td></tr></table>
<?=number_format($rowData)?> 명
</td>
</tr>
< /table>
< br />
< table class="boardTable">
<tr>
<td class="boardLine" colspan="12"></td>
</tr>
<tr>
<td colspan="12" style="padding-left:10px; padding-right:10px;"><strong><?=$yearTemp?>년 월별 방문자 접속 현황</strong> ※ 방문자 카운트 적용일 2011년 3월 24일</td>
</tr>
<tr>
<td class="boardLine" colspan="12"></td>
</tr>
<tr>
< ?
for($i=1; $i < 13; $i++) {
if($i < 10) { $month = "0".$i; } else { $month = $i; }
?>
<td class="boardTitle" width="100"> <a href="index.php?monthTemp=<?=$month?>" onFocus="this.blur();"><?=$month?> 월</a> </td>
< ? } ?>
</tr>
<tr>
<td class="boardTitleBottomLine" colspan="12"></td>
</tr>
<tr>
< ?
for($i=1; $i < 13; $i++) {
if($i < 10) { $month = $yearTemp."-0".$i."-%"; } else { $month = $yearTemp."-".$i."-%"; }
$query = "SELECT * FROM visitCount WHERE regdate like `$month`";
$result = mysql_query($query);
$rowData = mysql_num_rows($result);
?>
<td class="boardTd" align="right"><?=number_format($rowData)?> 명</td>
< ? } ?>
</tr>
<tr>
<td class="boardLine" colspan="12"></td>
</tr>
< /table>
< br />
< table class="boardTable">
<tr>
<td class="boardLine" colspan="7"></td>
</tr>
<tr>
<td class="boardTd" align="center" colspan="7"><strong><?=$yearTemp?> 년 <?=$monthTemp?> 월</strong></td>
</tr>
<tr>
<td class="boardLine" colspan="7"></td>
</tr>
<tr>
<td class="boardTd" align="center"><strong>일</strong></td>
<td class="boardTd" align="center"><strong>월</strong></td>
<td class="boardTd" align="center"><strong>화</strong></td>
<td class="boardTd" align="center"><strong>수</strong></td>
<td class="boardTd" align="center"><strong>목</strong></td>
<td class="boardTd" align="center"><strong>금</strong></td>
<td class="boardTd" align="center"><strong>토</strong></td>
</tr>
<tr>
<td class="boardLine" colspan="7"></td>
</tr>
<tr>
< ?
function getLastDay($yStr,$mStr) {
return date("d", mktime(0,0,0,$mStr+1,1,$yStr)-1);
}
$dayTemp = getLastDay($yearTemp, $monthTemp) + 1;
for($i=1; $i < $dayTemp; $i++) {
if($i < 10) { $day = "0".$i; } else { $day = $i; }
$month = $yearTemp."-".$monthTemp."-".$day;
$query = "SELECT * FROM visitCount WHERE regdate like `$month`";
$result = mysql_query($query);
$rowData = mysql_num_rows($result);
$yoil = array("일","월","화","수","목","금","토");
?>
< ? if($i==1) {
$temp = date(`w`,strtotime($month));
for($y=0; $y<$temp; $y++) {
?>
<td></td>
< ?
}
}
$z = $i + $temp;
?>
<td class="boardTd">
<table class="boardTable">
<tr>
<td class="boardTitle" width="80"><?=$day?> 일(<? echo($yoil[date(`w`,strtotime($month))]);?>)</td>
</tr>
<tr>
<td class="boardTd"><?=number_format($rowData)?> 명</td>
</tr>
</table>
</td>
<? if(($z % 7) == 0) {?>
</tr>
<tr>
<td class="boardLine" colspan="7"></td>
</tr>
<tr>
<? } ?>
< ? } ?>
</tr>
<tr>
<td class="boardLine" colspan="7"></td>
</tr>
< /table>
< /BODY>
< /HTML>
'Language > PHP' 카테고리의 다른 글
img - image 이미지 크기 구하기 - GetImageSize() (0) | 2015.11.29 |
---|---|
XML 참조 (0) | 2015.11.29 |
현제페이지 주소 알아내기 (0) | 2015.11.29 |
방문자 카운트 만들기 (0) | 2015.11.29 |
session 세션에서 시작, 변수등록, 변수삭제, 부수기 (0) | 2015.11.29 |