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

[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,643건 52 페이지
  • RSS
기술자료 목록
1623
.NET   16187  2014-11-12 14:25  
1622
PHP   27256  2014-11-12 10:28 ~ 2021-11-10 07:19  
1621
ClassicASP   28130  2014-11-04 16:47 ~ 2016-02-25 00:00  
1620
일반   19168  2014-11-03 13:02 ~ 2014-11-08 00:00  
1619
영카트   16326  2014-10-31 22:39  
1618
영카트   15855  2014-10-31 13:28  
1617
킴스큐   14254  2014-10-29 20:48 ~ 2014-10-29 00:00  
1616
킴스큐   12837  2014-10-29 20:17  
1615
그누보드   33554  2014-10-29 12:27 ~ 2020-10-21 18:52  
1614
영카트   14724  2014-10-28 14:29 ~ 2014-10-28 00:00  
1613
.NET   13559  2014-10-26 12:55  
1612
일반   14661  2014-10-21 19:24  
1611
영카트   11718  2014-10-21 15:12  
1610
그누보드   10497  2014-10-20 19:50  
1609
일반   14357  2014-10-15 21:14  
1608
일반   20172  2014-10-15 19:47  
열람
그누보드   19677  2014-10-14 19:36 ~ 2021-11-30 11:32  
1606
PHP   19439  2014-10-09 09:55 ~ 2015-12-15 00:00  
1605
그누보드   12321  2014-10-01 10:57 ~ 2024-01-12 16:23  
1604
영카트   24216  2014-09-30 01:32 ~ 2015-02-23 00:00  

검색

해피정닷컴 정보

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

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