Files
firstgarden-web-gnu/manager/vip/vip_list.excel.php

63 lines
2.3 KiB
PHP

<?php
//if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once('_common.php');
include_once('../config.php');
$sql_common = "SELECT * FROM {$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS b ON a.gr_id = b.gr_id LEFT JOIN {$fg['member_group_table']} AS c ON a.rec_team = c.tid";
$result = sql_query($sql_common);
$file_name = "viplist_".date("ymd")."_".date("His").".xls"; // 파일명지정
header("Content-Type: application/vnd.ms-excel");
header('Content-Type: application/vnd.ms-excel; charset=utf-8');
header("Content-Disposition: attachment; filename=$file_name");
header("Content-Description: PHP Generated Data");
?>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<style type="text/css">
.tit {background-color:#C0C0C0; height:30px; }
.no-text {mso-number-format:'\@'; text-align:center;}
</style>
<table cellspacing="0" cellpadding="0" border="1">
<thead>
<tr>
<th class="tit">카드번호</th>
<th class="tit">회원구분</th>
<th class="tit">상태</th>
<th class="tit">성명</th>
<th class="tit">연락처</th>
<th class="tit">생년월일</th>
<th class="tit">고객메모</th>
<th class="tit">가입일시</th>
<th class="tit">만료일</th>
<th class="tit">요청부서</th>
<th class="tit">담당자</th>
<th class="tit">입력자</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $row=sql_fetch_array($result); $i++) { // 반복문 시작
?>
<tr>
<td class="no-text"><?php echo $row['vip_card_no']; ?> </td>
<td class="no-text"><?php echo $row['gr_name']?> </td>
<td class="no-text"><?php echo $row['status']?> </td>
<td style="text-align:center"> <?php echo $row['vip_name']?> </td>
<td class="no-text"><?php echo get_text($row['vip_tel']); ?></td>
<td style="text-align:center"> <?php echo $row['vip_birth']?> </td>
<td style="text-align:center"> <?php echo $row['vip_memo'];?> </td>
<td style="text-align:center"> <?php echo date('Y-m-d H:i',strtotime($row['join_datetime']));?> </td>
<td style="text-align:center"> <?php echo ($row['vip_date'] == "9999-12-31")? "평생": $row['vip_date']?> </td>
<td class="no-text"><?php echo $row['tname']; ?> </td>
<td class="no-text"><?php echo $row['app_name']; ?> </td>
<td class="no-text"><?php echo $row['rec_name']; ?> </td>
</tr>
<?php } // 반복문 종료 ?>
</tbody>
</table>