그누보드4 게시글+댓글 엑셀다운로드

그누보드4 게시글+댓글 엑셀다운로드

QA

그누보드4 게시글+댓글 엑셀다운로드

본문

안녕하세요.

그누보드4에서 특정게시판의 특정게시글+댓글을 엑셀 다운로드 작업을 하려합니다.

 

아래 두분의 링크를 참고하여 제작해보았는데요.

https://sir.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=24559

https://sir.kr/qa/202218

 

다운로드를 하게되면 테이블에 제목외에 $is_print 부분의 데이터가 아무것도 들어가지 않은 상태로 다운되네요..
 

잘못된 부분이 있는지 고수님들의 도움 부탁드리겠습니다.

감사합니다.
 

 

[view.skin.php]


<a href='<?php echo $board_skin_path; ?>/excel_view.php?bo_table=<?php echo $bo_table; ?>&wr_id=<?php $view['wr_id']; ?>' target='_blank'>Excel</a>

 

[excel_view.skin.php]


<?php
ob_start();
include_once "_common.php";
header( "Content-type: application/vnd.ms-excel" );
header( "Content-Disposition: attachment; filename=상담일지.xls" );
$excel_down = $g4['table_prefix'] . $_GET['bo_table']; //엑셀 다운로드 테이블
$wr_id = $id = $_GET['wr_id'];
$g4[title] = "엑셀 문서 다운로드";
$bo_table=$_GET['bo_table'];
$wr_id=(int)$_GET['wr_id'];
$sql="select * from g4_write_".$bo_table." where wr_id='{$wr_id}'";
$view=sql_fetch($sql);
?>
<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<style type="text/css">
.txt {mso-number-format:'\@'}
</style>
<title><? echo $g4[title]; ?></title>
</head>
<body>
    <table>
        <tr>
        <th scope="col">번호</th>
        <th scope="col">글쓴이</th>
        <th scope="col">제목</th>
        <th scope="col">글내용</th>
        <th scope="col">조회수</th>
        <th scope="col">날짜</th>
        </tr>
        <tr>
        <td class='txt'><?=$is_print['wr_id']?></td>
        <td class='txt'><?=$is_print['wr_name']?></td>
        <td class='txt'><?=$is_print['wr_subject']?></td>
        <td class='txt'><?=$is_print['wr_content']?></td>
        <td class='txt'><?=$is_print['wr_hit']?></td>
        <td class='txt'><?=$is_print['wr_datetime']?></td>
        </tr>
    </table>
</body>
</html>

이 질문에 댓글 쓰기 :

답변 3

$is_print 

대신에

$view

라고 써 보세요.

위에 $view로 하셔서 is_print 대신 view로 해보시면 될거 같습니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 818
QA 내용 검색
filter #DB ×

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT