Exemple #1
0
<?php

require_once "../../class/Utils.php";
require_once "../../class/DBWork.php";
require_once "../../class/DBBoardWork.php";
$brdWork = new DBBoardWork(true);
//pageSize, pageGroupSize, maxPageIndex
$brdWork->setPageInfo(30, 10, 100);
$total_count = 0;
try {
    //$_POST : ['post_id'], ['tbl_kind'], ['pg_inx']
    $chk = $brdWork->getTableName($_POST['tbl_kind']) != 'noti';
    $brdWork->createWork($_POST, $chk);
    $total_count = $brdWork->requestCommentList();
    $data = array();
    //첫번째 원소로 댓글 전체 개수를 셋팅함
    array_push($data, $total_count);
    //실제 댓글 정보 셋팅
    while ($cmt = $brdWork->fetchMapRow()) {
        //htmlspecialchars 는 클라이언트 js 에서 처리한다.
        $cmt['message'] = stripslashes($cmt['message']);
        array_push($data, $cmt);
    }
    //json 객체를 json 문자열로 변환
    $data = json_encode($data);
    echo "<result><code>y</code><data><![CDATA[{$data}]]></data></result>";
} catch (Exception $e) {
    $brdWork->destoryWork();
    $errmsg = $e->getMessage();
    Util::serverLog($e);
    echo "<result><code>n</code><data>{$errmsg}</data></result>";
Exemple #2
0
    /*
    if(!((int)$_GET['tbl_kind']!=11&&(int)$_GET['tbl_kind']!=12&&(int)$_GET['tbl_kind']!=13))
    //if((int)$_GET['tbl_kind']>10&&(int)$_GET['tbl_kind']<14)
    	$brdWork->createWork($_GET, false);
    else
    	$brdWork->createWork($_GET, true);
    */
    $brdWork->createWork($_GET, false);
    $brdPost = $brdWork->requestPost();
    //다음 결과를 가져온다
    $avatar_wear = $brdWork->fetchArrayRow();
    $brdWork->nextQueryResult();
    $infoPost_prev = $brdWork->fetchArrayRow();
    $infoPost_next = $brdWork->fetchArrayRow();
    //테이블명
    $brdPost->tname = $brdWork->getTableName($_GET['tbl_kind']);
    if ($brdPost == null) {
        throw new Exception('Board view error.');
    }
    $brdWork->destoryWork();
    $tblKind = $_GET['tbl_kind'];
    $pg_inx = $_GET['pg_inx'];
} catch (Exception $e) {
    $brdWork->destoryWork();
    echo $e->getMessage();
    exit;
}
?>

<!DOCTYPE html>
<html>