리자

원글 통계

일별 원글 갯수 및 그래프 출력


<?
include_once('./_common.php');

auth_check($auth[$sub_menu], "r");

if ($is_admin != "super") alert("최고관리자만 접근 가능합니다.");

$g4[title] = '원글 통계';

include_once("../admin.head.php");
?>

<?=subtitle($g4[title])?>

<table border=1 cellpadding=0 cellspacing=0 width=100%>
<tbody align=center>
<?
$week = Array(0=>"일","월","화","수","목","금","토");

$qry = sql_query("SELECT left(bn_datetime, 10) as day, date_format(left(bn_datetime, 10), '%w') as week_no, count(*) as cnt FROM $g4[board_new_table] WHERE wr_id=wr_parent group by left(bn_datetime, 10) order by bn_datetime desc ");
while ($res = sql_fetch_array($qry)) {

    $per = $res[cnt]/2;
?>
<tr>
    <td width=100> <?=$res[day]?> (<?=$week[$res[week_no]]?>)</td>
    <td width=100> <?=number_format($res[cnt])?> </td>
    <td align=left>
        <hr style="color:#4BBBE0; width:<?=$per?>%; height:10px;"/>
    </td>
<tr>
<?}?>
</tbody>
</table>


<?
include_once("../admin.tail.php");
?>

|

댓글 3개

올려주신 코드를 참조해서 월별/년별로 이쁘게 나오는 것으로 바꿔볼께요
쿼리에 as 만 들어가면 알러지가..
스크랩하겠습니다.^^

댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
17년 전 조회 1.2만
17년 전 조회 5,228
17년 전 조회 2,608
17년 전 조회 6,170
17년 전 조회 3,293
17년 전 조회 1만
17년 전 조회 3,731
17년 전 조회 2,806
17년 전 조회 3,264
17년 전 조회 3,358
17년 전 조회 2,889
17년 전 조회 3,677
17년 전 조회 1.2만
17년 전 조회 5,181
17년 전 조회 9,068
17년 전 조회 5,904
17년 전 조회 4,570
17년 전 조회 3,349
17년 전 조회 3,572
17년 전 조회 3,876
🐛 버그신고