<?
include_once $_SERVER[DOCUMENT_ROOT] . "/module/board/board.lib.php";
include_once $_SERVER[DOCUMENT_ROOT] . "/module/log/log.lib.php";

$yesterday = date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y")));
$monthFirst = date("Y-m")."-01";

//DB연결
$dblink = SetConn($_conf_db["main_db"]);

$arrListLogToday = getAccessCounterDaily(date("Y-m-d"), date("Y-m-d"));	//오늘방문
$arrListLogYesterday = getAccessCounterDaily($yesterday, $yesterday);
$arrListLogMonth = getAccessCounterDaily($monthFirst, date("Y-m-d"));
$arrListLogAll = getAccessCounterDaily("2012-08-31", date("Y-m-d"));

$arrCommentList = getCommentList("", "", "", "");

$sql = "select * from tbl_board_info";
$result=mysql_query($sql) ;

$i=0;
while($row=mysql_fetch_array($result)){
	$arrLeftBoard[$i] = getBoardListBase($row[boardid], "", "", "", "", "");

	$boardTotal += $arrLeftBoard[$i]["total"];
	$i++;
}

//DB해제
SetDisConn($dblink);
?>
<div class="admin-info">
	<div class="info-today">
		<span class="today-time" id="clock"></span>
		<!-- <span class="today-day">2014/07/07</span>
		<span class="today-time">10:31:56 AM</span> -->
	</div>
	<div class="info-account">
		<!-- <div class="account-group-head">
			<span style="color:#cd0000;"><strong>접속</strong></span>(손님: 0 명, 회원: 1 명)
		</div> -->
		<div class="account-group-head">
			오늘방문 : <span style="color:#000;"><strong><?=number_format($arrListLogToday["sum"])?> 명</strong></span><br />
			어제방문 : <?=number_format($arrListLogYesterday["sum"])?>명<br />
			이달방문 : <?=number_format($arrListLogMonth["sum"])?>명<br />
			<!-- 최대방문 : 32 명<br /> -->
			총방문객 : <?=number_format($arrListLogAll["sum"])?> 명
		</div>
		<div class="account-group">
			총 게시물 : <?=number_format($boardTotal)?> 개<br />
			총 코멘트 : <?=number_format($arrCommentList["total"])?> 개
		</div>
	</div>
</div>