리자

원글 통계

· 2008-07-11 (금) 13:07:35 · 3561 · 3

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


<?
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개

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

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

그누4 팁자료실

3,309건

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

+
제목 글쓴이 날짜 조회
08-07-29 조회 2,617
08-07-29 조회 4,329
08-07-28 조회 7,311
08-07-23 조회 3,596
08-07-21 조회 3,702
08-07-19 조회 5,347
08-07-18 조회 5,271
08-07-18 조회 3,894
08-07-18 조회 3,356
08-07-16 조회 3,230
08-07-16 조회 1.2만
08-07-15 조회 5,421
08-07-14 조회 2,772
08-07-14 조회 6,389
08-07-14 조회 3,451
08-07-13 조회 1만
08-07-11 조회 3,903
08-07-11 조회 2,965
08-07-11 조회 3,428
08-07-11 조회 3,562