엑셀로 게시판 다운로드 및 그룹내 모든 게시판 다운로드 같은것은 어떻게 해야 하나요?

엑셀로 게시판 다운로드 및 그룹내 모든 게시판 다운로드 같은것은 어떻게 해야 하나요?

QA

엑셀로 게시판 다운로드 및 그룹내 모든 게시판 다운로드 같은것은 어떻게 해야 하나요?

본문

엑셀다운로드 하는 방법에 대해서 많은 팁들을 공부중입니다. 찾아보고 성공한 것들중에 

https://sir.kr/qa/202218 조민님이 남겨주신 팁을 먼저 알려드리자면 보고 있는 페이지가 필요한 필드명만 선택하여 저장되는 팁입니다.

 


<?
ob_start();
include_once($_SERVER['DOCUMENT_ROOT'] ."/common.php");
 
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:attachment;filename=view.xls");
 
$is_title="엑셀 문서 다운로드";
 
$bo_table=$_GET['bo_table'];
$wr_id=(int)$_GET['wr_id'];
 
 
$sql="select * from g5_write_".$bo_table." where wr_is_comment=0 and wr_id='{$wr_id}'";
$is_print=sql_fetch($sql);
?>
<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<style type="text/css">
.txt {mso-number-format:'\@'}
</style>
<title><?=$is_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>
 
 
위에 소스를 excel_view.php 이름으로 저장후 사용중인 게시판 스킨 폴더안으로 업로드를 합니다. 
게시판 스킨 폴더 > view_skin.php 파일 소스 적당한 자리를 선택후 아래의 링크를 추가해 보세요.
 
<a href="<?=$board_skin_url?>/excel_view.php?bo_table=<?=$bo_table?>&wr_id=<?=$view['wr_id']?>">엑셀보기</a>

 

이것을 현재 보고 있는 게시판 전체

또는

그룹 전체에 적용하고자 하는데 고수님들 도움 좀 부탁드립니다.

여기에 정리해두면 아마 많은 분들께 도움될것입니다.

감사합니다.

이 질문에 댓글 쓰기 :

답변 1

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

회원로그인

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