인기검색어

노하우팁
그누보드 분류

그누보드 g5 게시판글 리스트및 정보 엑셀 다운로드

작성자 정보

  • Wikiutil 작성
  • 작성일

컨텐츠 정보

본문


1. 그누보드5 / skin / board / basic / _common.php 생성 

<?php

include_once('../../../common.php');

// 테마 폴더 스킨폴더 이용할때 아래꺼 사용

//include_once('../../../../../common.php');

?> 

2. 그누보드5 / skin / board / basic / list.skin.php 적절한 위치에 아래 코드 추가 


549cdb583f4061668ffb2b058d396a2d_1670943644_3344.jpg
 

<?php if ($admin_href) { ?>

<a href='<?php echo $board_skin_url; ?>/excel.php?bo_table=<?php echo $bo_table; ?>' class="btn_admin btn2" target='_blank'>

<i class="fa fa-user-circle" aria-hidden="true">

</i>

Excel

</a>

<?php } ?>

3. 그누보드5 / skin / board / basic / excel.php 파일 생성 

<?php

include_once "_common.php";

if (!$is_admin) {

alert("관리자만 접근 가능합니다.");

exit;

}

$excel_down = $g5['write_prefix'] . $_GET['bo_table']; //엑셀 다운로드 테이블

$wr_id = $_GET['wr_id'];

$hp_filename = "파일명";

//@sql_query("SET CHARACTER SET utf8"); // 한글깨지면 주석해지

if ($ms =="excel"){

$g5['title'] = "엑셀 문서 다운로드";

header( "Content-type: application/vnd.ms-excel" );

header( "Content-Disposition: attachment; filename={$hp_filename}.xls" );

//header( "Content-Description: PHP4 Generated Data" );

} else if ($ms =="power"){

$g5['title'] = "파워포인트 문서 다운로드";

header( "Content-type: application/vnd.ms-powerpoint" );

header( "Content-Disposition: attachment; filename={$hp_filename}.ppt" );

// header( "Content-Description: PHP4 Generated Data" );

} else if ($ms =="word"){

$g5['title'] = "워드 문서 다운로드";

header( "Content-type: application/vnd.ms-word" );

header( "Content-Disposition: attachment; filename={$hp_filename}.doc" );

//header( "Content-Description: PHP4 Generated Data" );

} else if ($ms =="memo"){

$g5['title'] = "메모 문서 다운로드";

header( "Content-type: application/vnd.ms-notepad" );

header( "Content-Disposition: attachment; filename={$hp_filename}.txt" );

} else {

header( "Content-type: application/vnd.ms-excel" );

header( "Content-Disposition: attachment; filename={$hp_filename}.xls" );

}

header( "Content-Description: PHP4 Generated Data" );


관련자료

댓글 0
등록된 댓글이 없습니다.
전체 12 / 1 페이지


노하우팁

최근글


  • 글이 없습니다.

새댓글


  • 댓글이 없습니다.