<!--#include virtual="/common/lib/dbcon.asp"-->
<!--#include virtual="/common/lib/func.asp"-->
<%

table			= "view_address_member"		'테이블
idx_field		= "adr_idx"			'기본키
oreder_filed	= "adr_name asc, adr_idx asc"	'정렬기준 필드
Query_Fields	= "adr_idx, bdm_idx, adr_m_id, adr_name, adr_mobile1, adr_mobile2, adr_mobile3, adr_c_memo, bdm_menuname" '불러올 필드

'==================조합 쿼리문=======================

Query_Where = " where adr_m_id = '" & session("ss_m_id") & "'"
Query_OrderBy = " ORDER BY " & oreder_filed
'==================조합 쿼리문=======================

'========================리스트 출력 쿼리문 생성======================
'MS-SQL
sql = "select " & Query_Fields & " from " & table & Query_Where & Query_OrderBy
'========================리스트 출력 쿼리문 생성 끝======================
'response.write sql


Set rs = Dbcon.Execute( sql )
If rs.bof Or rs.eof Then
	List_data = Null
	TotalCnt = 0
else
	List_data = rs.getrows
	TotalCnt = recordcount
End if



If IsNull(list_data) Then
	Back_back("생성할 주소록이 없습니다.")
Else
	Response.ContentType = "application/vnd.ms-excel"
	Response.AddHeader "Content-Disposition","attachment;filename=sheet1.xls"
End if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<table width="650" border="1">
<tr align="center">
		<td width="100" bgcolor="#FFFFFF">
			이름
		</td>
		<td width="200" bgcolor="#FFFFFF">
			핸드폰번호
		</td>
		<td width="100" bgcolor="#FFFFFF">
			그룹
		</td>
		<td bgcolor="#FFFFFF" align="left" style="padding-left:5px">
			메모
		</td>
	</tr>
<%
	For i = 0 To UBound(list_data, 2)
		Call arr2Value(Query_Fields, "list_data", i )
%>
	<tr align="center">
		<td width="100" bgcolor="#FFFFFF">
			<%=adr_name%>
		</td>
		<td width="200" bgcolor="#FFFFFF">
			<%=adr_mobile1%>-<%=adr_mobile2%>-<%=adr_mobile3%>
		</td>
		<td bgcolor="#FFFFFF" align="left" style="padding-left:5px">
			<%=bdm_menuname%>
		</td>
		<td width="100" bgcolor="#FFFFFF">
			<%=adr_c_memo%>
		</td>
	</tr>
<%
	next
%>
</table>
</body>
</html>
