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

// 리퍼러 체크
referer_check();

// 업데이트 (원글)
    $sql = " update $write_table 
                set wr_2 = '1',
                    wr_5 = '$wr_5',
                    wr_6 = '0',
                    wr_9 = '$g4[time_ymdhis]'
              where wr_id = '$wr_id' ";
    sql_query($sql);

// 업데이트 2 (채택된 코멘트)
    $sql2 = " update $write_table 
                set wr_2 = '1',
                    wr_5 = '$wr_5',
                    wr_7 = '$wr_7',
                    wr_8 = '$wr_8'
              where wr_id = '$comment_id' ";
    sql_query($sql2);

    // 채택된 회원에게 포인트 부여함
    insert_point($wr_5, (int)($write[wr_1]), "$board[bo_subject] $wr_id 답변채택", $bo_table, $wr_id, '답변채택');
?>

<script language="JavaScript">
	alert("답변을 채택하였습니다.");
	opener.location.reload();
	window.close();
</script>