[G5] 회원정보를 엑셀,워드,파워포인트로 다운받기 > 기술자료

본문 바로가기

사이트 내 전체검색

[G5] 회원정보를 엑셀,워드,파워포인트로 다운받기 > 기술자료

그누보드 [G5] 회원정보를 엑셀,워드,파워포인트로 다운받기

페이지 정보


본문

사용법)
파일명.php?ms=다운형식

1. 그누보드5 / adm / member_list.php 상단 적당한 곳에 추가
<a href="./member_down.php?ms=excel">회원 엑셀 다운로드</a>
<a href="./member_down.php?ms=word">회원 워드 다운로드</a>
<a href="./member_down.php?ms=power">회원 파워포인트 다운로드</a>
<a href="./member_down.php?ms=memo">회원 메모 다운로드</a>


2. 그누보드5 / adm / member_down.php 파일을 생성해서 업로드
<?php
include_once("./_common.php");
if (!$is_admin =="super")
    alert_close("최고 관리자 영역 입니다.");
    
$ms = $_GET['ms'];

$filename = 'member';
if ($ms =="excel") {  // 엑셀 문서 다운로드
    header( "Content-type: application/vnd.ms-excel; charset=utf-8" );
    header( "Content-Disposition: attachment; filename={$filename}.xls" );
} else if ($ms =="power") {  // 파워포인트 문서 다운로드
    header( "Content-type: application/vnd.ms-powerpoint; charset=utf-8" );
    header( "Content-Disposition: attachment; filename={$filename}.ppt" );
} else if ($ms =="word") {  // 워드 문서 다운로드
    header( "Content-type: application/vnd.ms-word; charset=utf-8" );
    header( "Content-Disposition: attachment; filename={$filename}.doc" );
} else if ($ms =="memo") {  // 메모 문서 다운로드
    header( "Content-type: application/vnd.ms-notepad; charset=utf-8" );
    header( "Content-Disposition: attachment; filename={$filename}.txt" );
} else {
    header( "Content-type: application/vnd.ms-excel; charset=utf-8" );
    header( "Content-Disposition: attachment; filename={$filename}.xls" );
}
header( "Content-Description: PHP4 Generated Data" );

// 검색어에 대해서 처리
$s_que="";
$temp = sql_fetch_array(sql_query("select count(*) from {$g5['member_table'}{$s_que}"));
// 정보를 구해옴
$qry = sql_query("select * from {$g5['member_table']}{$s_que} order by mb_id desc");

//  앞에 붙는 가상번호
// $temp = sql_fetch_array(sql_query("select count(*) from {$g5['member_table']}{$s_que}"));
$number = $temp[0]
?>
<html>
<head>
<title>회원명단</title>
<style type="text/css">
/*
엑셀 다운로드로 저장시 숫자로 표시될 경우 방지
td {mso-number-format:'\@'}
*/
.txt {mso-number-format:'\@'}
</style>
</head>

<body>
<table>
    <tr>
        <td>번호</td>
        <td>id명</td>
        <td>이름</td>
        <td>닉네임</td>
        <td>생일</td>
        <td>성별</td>
        <td>레벨</td>
        <td>포인트</td>
        <td>가입일</td>
        <td>이메일</td>
        <td>홈페이지</td>
        <td>성별</td>
        <td>생일</td>
        <td>전화</td>
        <td>휴대폰</td>
        <td>메일링</td>
        <td>정보공개</td>
        <td>최근로그인</td>
        <td>우편번호</td>
        <td>주소1</td>
        <td>주소2</td>
        <td>SMS 수신여부</td>
        <td>서명</td>
        <td>자기소개</td>
        <td>추천인아이디</td>
    </tr>
    <?php
    while($row = sql_fetch_array($qry)) {
        $mb_sex = $row['mb_sex'];
        $mb_mailling = $row['mb_mailling'];
        $mb_open = $row['mb_open'];
        $mb_sms = $row['mb_sms'];
        $zip1 = $row['mb_zip1'];
        $zip2 = $row['mb_zip2'];
        if ($mb_sex =="M") { $mb_sex ="남자"; } else if ($mb_sex =="F"){ $mb_sex ="여자"; }
        if ($mb_mailling =="1") { $mb_mailling ="받음"; } else if ($mb_mailling =="0"){ $mb_mailling ="안받음"; }
        if ($mb_open =="1") { $mb_open  ="공개"; } else if ($mb_open =="0"){ $mb_open ="비공개"; }
        if ($mb_sms =="1") { $mb_sms  ="받음"; } else if ($mb_sms =="0"){ $mb_sms ="안받음"; }
        if ($zip1 <> "") { $zip  = $zip1 . $zip2; }
    
    echo "
    <tr>
        <td class='txt'>{$number}</td>
        <td class='txt'>{$row['mb_id']}</td>
        <td class='txt'>{$row['mb_name']}</td>
        <td class='txt'>{$row['mb_nick']}</td>
        <td class='txt'>{$row['mb_birth']}</td>
        <td class='txt'>{$row['mb_sex']}</td>
        <td class='txt'>{$row['mb_level']}</td>
        <td class='txt'>{$row['mb_point']}</td>
        <td class='txt'>{$row['mb_datetime']}</td>
        <td class='txt'>{$row['mb_email']}</td>
        <td class='txt'>{$row['mb_homepage']}</td>
        <td class='txt'>{$mb_sex}</td>
        <td class='txt'>{$row['mb_birth']}</td>
        <td class='txt'>{$row['mb_tel']}</td>
        <td class='txt'>{$row['mb_hp']}</td>
        <td class='txt'>{$mb_mailling}</td>
        <td class='txt'>{$mb_open}</td>
        <td class='txt'>{$row['mb_today_login']}</td>
        <td class='txt'>{$zip}</td>
        <td class='txt'>{$row['mb_addr1']}</td>
        <td class='txt'>{$row['mb_addr2']}</td>
        <td class='txt'>{$mb_sms}</td>
        <td class='txt'>{$row['mb_signature']}</td>
        <td class='txt'>{$row['mb_profile']}</td>
        <td class='txt'>{$row['mb_recommend']}</td>
    </tr>
    ";
}
?>
</table>
</body>
</html>

댓글목록

등록된 댓글이 없습니다.


Total 2,645건 1 페이지
  • RSS
기술자료 목록
2645
Search   519  2025-10-15 17:04 ~ 2025-10-23 00:29  
2644
MySQL   734  2025-08-28 17:54 ~ 2025-08-28 17:55  
2643
PHP   2116  2025-02-07 09:27 ~ 2025-02-07 16:59  
2642
그누보드   1731  2025-02-07 08:55 ~ 2025-02-07 17:04  
2641
그누보드   2003  2024-11-26 21:14 ~ 2024-11-26 21:22  
2640
그누보드   3512  2024-11-22 10:52 ~ 2024-11-22 11:03  
2639
호스팅   2344  2024-11-19 14:41 ~ 2024-11-19 21:17  
2638
Linux   1708  2024-11-18 15:45 ~ 2024-11-18 15:48  
2637
일반   1585  2024-11-15 16:45 ~ 2024-11-15 16:46  
2636
Secure   1724  2024-11-06 18:48 ~ 2024-11-06 18:50  
2635
영카트   2025  2024-10-21 13:44 ~ 2025-08-29 23:40  
2634
전자결제   3381  2024-09-05 09:30  
2633
MySQL   2571  2024-03-29 14:14 ~ 2024-03-29 14:14  
2632
그누보드   2847  2024-02-23 18:40 ~ 2024-02-24 06:13  
2631
JavaScript   2834  2024-02-16 18:50 ~ 2024-02-16 20:37  
2630
Java   2933  2024-02-06 16:49  
2629
PHP   3161  2024-02-06 16:42  
2628
호스팅   2459  2024-01-29 12:54  
2627
PHP   2462  2024-01-26 11:04 ~ 2024-01-26 11:13  
2626
MySQL   2585  2024-01-08 17:37 ~ 2024-03-14 16:00  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2026 해피정닷컴. All Rights Reserved.